mirror of
https://github.com/mozilla/cipherscan.git
synced 2024-11-22 14:23:41 +01:00
verify the results of pushd rather than trusting it
This commit is contained in:
parent
81481cd016
commit
1c15af1ce3
@ -281,8 +281,12 @@ c_hash() {
|
|||||||
fi
|
fi
|
||||||
if [[ ! -e $1/${h}.${num} ]]; then
|
if [[ ! -e $1/${h}.${num} ]]; then
|
||||||
# file doesn't exist, create a link
|
# file doesn't exist, create a link
|
||||||
pushd "$1" > /dev/null
|
if pushd "$1" > /dev/null; then
|
||||||
ln -s "$2" "${h}.${num}"
|
ln -s "$2" "${h}.${num}"
|
||||||
|
else
|
||||||
|
echo "'pushd $1' failed unexpectedly, refusing to proceed" 1>&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
popd > /dev/null
|
popd > /dev/null
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user