Quote variables that may contain whitespace.

The variable $L_TMP_ID_FILE needs to be surrounded by quotes in order to
survive paths containing whitespace.  bz#2551, from Corinna Vinschen via
Philip Hands.
This commit is contained in:
Darren Tucker 2016-03-14 09:24:03 +11:00
parent 627824480c
commit 8ff20ec95f

View File

@ -233,17 +233,17 @@ populate_new_ids() {
-o ControlPath=none \
-o LogLevel=INFO \
-o PreferredAuthentications=publickey \
-o IdentitiesOnly=yes "$@" exit 2>$L_TMP_ID_FILE.stderr </dev/null
-o IdentitiesOnly=yes "$@" exit 2>"$L_TMP_ID_FILE.stderr" </dev/null
if [ "$?" = "$L_SUCCESS" ] ; then
: > $L_TMP_ID_FILE
: > "$L_TMP_ID_FILE"
else
grep 'Permission denied' $L_TMP_ID_FILE.stderr >/dev/null || {
sed -e 's/^/ERROR: /' <$L_TMP_ID_FILE.stderr >$L_TMP_ID_FILE
grep 'Permission denied' "$L_TMP_ID_FILE.stderr" >/dev/null || {
sed -e 's/^/ERROR: /' <"$L_TMP_ID_FILE.stderr" >"$L_TMP_ID_FILE"
cat >/dev/null #consume the other keys, causing loop to end
}
fi
cat $L_TMP_ID_FILE
cat "$L_TMP_ID_FILE"
done
}
)