Prefix globs with ./ or use -- to make commands safe with files named like command-line options

This commit is contained in:
Kamil Śliwak 2020-12-12 02:59:25 +01:00
parent 04302d4828
commit e8a70e8e4b
4 changed files with 10 additions and 10 deletions

View File

@ -214,12 +214,12 @@ if wget --quiet -O $orig-tmp "$ppafilesurl/$orig"
then then
echo "[WARN] Original tarball found in Ubuntu archive, using it instead" echo "[WARN] Original tarball found in Ubuntu archive, using it instead"
mv $orig-tmp $orig mv $orig-tmp $orig
new_size=$(ls -l *.orig.tar.gz | cut -d ' ' -f 5) new_size=$(ls -l ./*.orig.tar.gz | cut -d ' ' -f 5)
new_sha1=$(sha1sum $orig | cut -d ' ' -f 1) new_sha1=$(sha1sum $orig | cut -d ' ' -f 1)
new_sha256=$(sha256sum $orig | cut -d ' ' -f 1) new_sha256=$(sha256sum $orig | cut -d ' ' -f 1)
new_md5=$(md5sum $orig | cut -d ' ' -f 1) new_md5=$(md5sum $orig | cut -d ' ' -f 1)
sed -i -e "s,$orig_sha1,$new_sha1,g" -e "s,$orig_sha256,$new_sha256,g" -e "s,$orig_size,$new_size,g" -e "s,$orig_md5,$new_md5,g" *.dsc sed -i -e "s,$orig_sha1,$new_sha1,g" -e "s,$orig_sha256,$new_sha256,g" -e "s,$orig_size,$new_size,g" -e "s,$orig_md5,$new_md5,g" ./*.dsc
sed -i -e "s,$orig_sha1,$new_sha1,g" -e "s,$orig_sha256,$new_sha256,g" -e "s,$orig_size,$new_size,g" -e "s,$orig_md5,$new_md5,g" *.changes sed -i -e "s,$orig_sha1,$new_sha1,g" -e "s,$orig_sha256,$new_sha256,g" -e "s,$orig_size,$new_size,g" -e "s,$orig_md5,$new_md5,g" ./*.changes
fi fi
) )

View File

@ -274,12 +274,12 @@ if wget --quiet -O "$orig-tmp" "$ppafilesurl/$orig"
then then
echo "[WARN] Original tarball found in Ubuntu archive, using it instead" echo "[WARN] Original tarball found in Ubuntu archive, using it instead"
mv "$orig-tmp" "$orig" mv "$orig-tmp" "$orig"
new_size=$(ls -l *.orig.tar.gz | cut -d ' ' -f 5) new_size=$(ls -l ./*.orig.tar.gz | cut -d ' ' -f 5)
new_sha1=$(sha1sum "$orig" | cut -d ' ' -f 1) new_sha1=$(sha1sum "$orig" | cut -d ' ' -f 1)
new_sha256=$(sha256sum "$orig" | cut -d ' ' -f 1) new_sha256=$(sha256sum "$orig" | cut -d ' ' -f 1)
new_md5=$(md5sum "$orig" | cut -d ' ' -f 1) new_md5=$(md5sum "$orig" | cut -d ' ' -f 1)
sed -i -e "s,$orig_sha1,$new_sha1,g" -e "s,$orig_sha256,$new_sha256,g" -e "s,$orig_size,$new_size,g" -e "s,$orig_md5,$new_md5,g" *.dsc sed -i -e "s,$orig_sha1,$new_sha1,g" -e "s,$orig_sha256,$new_sha256,g" -e "s,$orig_size,$new_size,g" -e "s,$orig_md5,$new_md5,g" ./*.dsc
sed -i -e "s,$orig_sha1,$new_sha1,g" -e "s,$orig_sha256,$new_sha256,g" -e "s,$orig_size,$new_size,g" -e "s,$orig_md5,$new_md5,g" *.changes sed -i -e "s,$orig_sha1,$new_sha1,g" -e "s,$orig_sha256,$new_sha256,g" -e "s,$orig_size,$new_size,g" -e "s,$orig_md5,$new_md5,g" ./*.changes
fi fi
) )

View File

@ -93,6 +93,6 @@ for (var optimize of [false, true])
} }
EOF EOF
chmod +x solc chmod +x solc
./solc *.sol > /tmp/report.txt ./solc -- *.sol > /tmp/report.txt
) )
rm -rf "$TMPDIR" rm -rf "$TMPDIR"

View File

@ -333,7 +333,7 @@ printTask "Compiling various other contracts and libraries..."
do do
echo " - $dir" echo " - $dir"
cd "$dir" cd "$dir"
compileFull -w *.sol */*.sol compileFull -w ./*.sol ./*/*.sol
cd .. cd ..
done done
) )
@ -499,8 +499,8 @@ SOLTMPDIR=$(mktemp -d)
"$REPO_ROOT"/scripts/isolate_tests.py "$REPO_ROOT"/test/ "$REPO_ROOT"/scripts/isolate_tests.py "$REPO_ROOT"/test/
"$REPO_ROOT"/scripts/isolate_tests.py "$REPO_ROOT"/docs/ docs "$REPO_ROOT"/scripts/isolate_tests.py "$REPO_ROOT"/docs/ docs
echo *.sol | xargs -P 4 -n 50 "${SOLIDITY_BUILD_DIR}/test/tools/solfuzzer" --quiet --input-files echo ./*.sol | xargs -P 4 -n 50 "${SOLIDITY_BUILD_DIR}/test/tools/solfuzzer" --quiet --input-files
echo *.sol | xargs -P 4 -n 50 "${SOLIDITY_BUILD_DIR}/test/tools/solfuzzer" --without-optimizer --quiet --input-files echo ./*.sol | xargs -P 4 -n 50 "${SOLIDITY_BUILD_DIR}/test/tools/solfuzzer" --without-optimizer --quiet --input-files
) )
rm -rf "$SOLTMPDIR" rm -rf "$SOLTMPDIR"