From ff8383ce9092335de6c00447bb45a2a7fbbf8685 Mon Sep 17 00:00:00 2001 From: Jameson Graef Rollins Date: Sat, 21 Feb 2009 14:57:41 -0500 Subject: make sure we're explicitly capturing return codes in places where they are tested, in case things are being run set -e --- src/share/m/ssh_proxycommand | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/share/m/ssh_proxycommand') diff --git a/src/share/m/ssh_proxycommand b/src/share/m/ssh_proxycommand index bd09588..abe068d 100644 --- a/src/share/m/ssh_proxycommand +++ b/src/share/m/ssh_proxycommand @@ -18,6 +18,7 @@ # "marginal case" ouput in the case that there is not a full # validation path to the host output_no_valid_key() { + local returnCode=0 local sshKeyOffered local userID local type @@ -112,11 +113,11 @@ EOF fi ;; esac - done + done || returnCode="$?" # if no key match was made (and the "while read" subshell returned # 1) output how many keys were found - if (($? != 1)) ; then + if (( returnCode != 1 )) ; then cat < Date: Sat, 21 Feb 2009 16:11:07 -0500 Subject: fixing typo in ssh_proxycommand. --- src/share/m/ssh_proxycommand | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/share/m/ssh_proxycommand') diff --git a/src/share/m/ssh_proxycommand b/src/share/m/ssh_proxycommand index abe068d..ca87c08 100644 --- a/src/share/m/ssh_proxycommand +++ b/src/share/m/ssh_proxycommand @@ -117,7 +117,7 @@ EOF # if no key match was made (and the "while read" subshell returned # 1) output how many keys were found - if (( returnCode != 1 )) ; then + if (( "$returnCode" != 1 )) ; then cat < Date: Sat, 21 Feb 2009 16:14:38 -0500 Subject: un-fix non-typo in ssh_proxycommand. (my mistake!) --- src/share/m/ssh_proxycommand | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/share/m/ssh_proxycommand') diff --git a/src/share/m/ssh_proxycommand b/src/share/m/ssh_proxycommand index ca87c08..abe068d 100644 --- a/src/share/m/ssh_proxycommand +++ b/src/share/m/ssh_proxycommand @@ -117,7 +117,7 @@ EOF # if no key match was made (and the "while read" subshell returned # 1) output how many keys were found - if (( "$returnCode" != 1 )) ; then + if (( returnCode != 1 )) ; then cat <