Skip to content

Commit

Permalink
Use quotation marks in variable
Browse files Browse the repository at this point in the history
Prevents possible remote code execution.
Thx @blackwinter.
  • Loading branch information
dr0i committed Aug 27, 2024
1 parent ac779ce commit 6befacb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/generateRvkConcordance.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ URL_ROOT="https://data.dnb.de/culturegraph/"
TARGET_FNAME="/data/other/cg/aggregate.marcxml.gz"

FNAME=$(curl $URL_ROOT | grep '<a href="aggregate_' | sed 's#.*\<a href="aggregate_\(.*\)".*#aggregate_\1#g')
echo "Got filename: $FNAME"
wget $URL_ROOT$FNAME -O $TARGET_FNAME
echo Got filename: "$FNAME"
wget "$URL_ROOT$FNAME" -O $TARGET_FNAME

FNAME_SIZE=$(ls -s $TARGET_FNAME |cut -d ' ' -f1)
if [ $FNAME_SIZE -gt 8654321 ]; then # 9593288 blocks was aggregate_20240507.marcxml.gz
Expand Down

0 comments on commit 6befacb

Please sign in to comment.