2
0
mirror of https://github.com/mozilla/cipherscan.git synced 2024-11-05 07:23:42 +01:00

verify the results of pushd rather than trusting it

This commit is contained in:
Richard Soderberg 2015-09-02 21:57:24 -07:00
parent 81481cd016
commit 1c15af1ce3

View File

@ -281,8 +281,12 @@ c_hash() {
fi
if [[ ! -e $1/${h}.${num} ]]; then
# file doesn't exist, create a link
pushd "$1" > /dev/null
ln -s "$2" "${h}.${num}"
if pushd "$1" > /dev/null; then
ln -s "$2" "${h}.${num}"
else
echo "'pushd $1' failed unexpectedly, refusing to proceed" 1>&2
exit 1
fi
popd > /dev/null
break
fi