summaryrefslogtreecommitdiffstats
path: root/regress/agent.sh
diff options
context:
space:
mode:
authorTim Rice <tim@multitalents.net>2014-01-28 19:26:25 +0100
committerTim Rice <tim@multitalents.net>2014-01-28 19:26:25 +0100
commit6f917ad376481995ab7d29fb53b08ec8d507eb9e (patch)
tree28b8e366f294cb729598cdb826f626682be73a9b /regress/agent.sh
parent - (djm) [sshd.c] Use kill(0, ...) instead of killpg(0, ...); the (diff)
downloadopenssh-6f917ad376481995ab7d29fb53b08ec8d507eb9e.tar.xz
openssh-6f917ad376481995ab7d29fb53b08ec8d507eb9e.zip
- (tim) [regress/agent.sh regress/agent-ptrace.sh] Assign $? to a variable
when used as an error message inside an if statement so we display the correct into. agent.sh patch from Petr Lautrbach.
Diffstat (limited to 'regress/agent.sh')
-rw-r--r--regress/agent.sh30
1 files changed, 18 insertions, 12 deletions
diff --git a/regress/agent.sh b/regress/agent.sh
index 90bad15d4..cf1a45fe0 100644
--- a/regress/agent.sh
+++ b/regress/agent.sh
@@ -34,40 +34,46 @@ else
fi
done
${SSHADD} -l > /dev/null 2>&1
- if [ $? -ne 0 ]; then
- fail "ssh-add -l failed: exit code $?"
+ r=$?
+ if [ $r -ne 0 ]; then
+ fail "ssh-add -l failed: exit code $r"
fi
# the same for full pubkey output
${SSHADD} -L > /dev/null 2>&1
- if [ $? -ne 0 ]; then
- fail "ssh-add -L failed: exit code $?"
+ r=$?
+ if [ $r -ne 0 ]; then
+ fail "ssh-add -L failed: exit code $r"
fi
trace "simple connect via agent"
for p in 1 2; do
${SSH} -$p -F $OBJ/ssh_proxy somehost exit 5$p
- if [ $? -ne 5$p ]; then
- fail "ssh connect with protocol $p failed (exit code $?)"
+ r=$?
+ if [ $r -ne 5$p ]; then
+ fail "ssh connect with protocol $p failed (exit code $r)"
fi
done
trace "agent forwarding"
for p in 1 2; do
${SSH} -A -$p -F $OBJ/ssh_proxy somehost ${SSHADD} -l > /dev/null 2>&1
- if [ $? -ne 0 ]; then
- fail "ssh-add -l via agent fwd proto $p failed (exit code $?)"
+ r=$?
+ if [ $r -ne 0 ]; then
+ fail "ssh-add -l via agent fwd proto $p failed (exit code $r)"
fi
${SSH} -A -$p -F $OBJ/ssh_proxy somehost \
"${SSH} -$p -F $OBJ/ssh_proxy somehost exit 5$p"
- if [ $? -ne 5$p ]; then
- fail "agent fwd proto $p failed (exit code $?)"
+ r=$?
+ if [ $r -ne 5$p ]; then
+ fail "agent fwd proto $p failed (exit code $r)"
fi
done
trace "delete all agent keys"
${SSHADD} -D > /dev/null 2>&1
- if [ $? -ne 0 ]; then
- fail "ssh-add -D failed: exit code $?"
+ r=$?
+ if [ $r -ne 0 ]; then
+ fail "ssh-add -D failed: exit code $r"
fi
trace "kill agent"