mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-31 01:35:11 +02:00
Save $? before case statement.
In some shells (FreeBSD 9, ash) the case statement resets $?, so save for later testing.
This commit is contained in:
parent
4c4e7f783b
commit
c6cb2565c9
@ -101,9 +101,10 @@ check_valid_before() {
|
|||||||
sed "s/.*/$opts &/" $origkeys >$authkeys
|
sed "s/.*/$opts &/" $origkeys >$authkeys
|
||||||
verbose "key option expiry-time $which"
|
verbose "key option expiry-time $which"
|
||||||
${SSH} -q -F $OBJ/ssh_proxy somehost true
|
${SSH} -q -F $OBJ/ssh_proxy somehost true
|
||||||
|
r=$?
|
||||||
case "$expect" in
|
case "$expect" in
|
||||||
fail) test $? -eq 0 && fail "key option succeeded $which" ;;
|
fail) test $r -eq 0 && fail "key option succeeded $which" ;;
|
||||||
pass) test $? -ne 0 && fail "key option failed $which" ;;
|
pass) test $r -ne 0 && fail "key option failed $which" ;;
|
||||||
*) fatal "unknown expectation $expect" ;;
|
*) fatal "unknown expectation $expect" ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user