From e5105949d606f6e07035bd5d60f1b1d94d42abbe Mon Sep 17 00:00:00 2001 From: Christoph Anton Mitterer Date: Mon, 21 Nov 2022 17:49:28 +0100 Subject: [PATCH] ssh_filter_btrbk.sh: use more common exit statuses MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit POSIX designates a number of exit statuses around `127` for special use and GNU a few further. Further, using values >127 is rather uncommon for normal use-cases. Use `1` when the SSH command was rejected and `2` when the program’s arguments could not be parsed). Since this might at least in principle be used by 3rd-party programs, added a specific note to the changelog. Signed-off-by: Christoph Anton Mitterer --- ChangeLog | 6 ++++++ ssh_filter_btrbk.sh | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7b348b2..c9373c4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +btrbk-current + + * ssh_filter_btrbk.sh uses new exit statuses on failures (1 when the + SSH command was rejected, 2 when the program’s arguments could not + be parsed). + btrbk-0.32.5 * Correct handling of zero-size raw info file (close #491). diff --git a/ssh_filter_btrbk.sh b/ssh_filter_btrbk.sh index 20ef87c..94cb69c 100755 --- a/ssh_filter_btrbk.sh +++ b/ssh_filter_btrbk.sh @@ -42,7 +42,7 @@ reject_and_die() local reason="$1" log_cmd 'auth.err' 'btrbk REJECT' "$reason" printf 'ERROR: ssh_filter_btrbk.sh: ssh command rejected: %s: %s\n' "$reason" "$SSH_ORIGINAL_COMMAND" 1>&2 - exit 255 + exit 1 } run_cmd() @@ -166,7 +166,7 @@ while [ "$#" -ge 1 ]; do *) printf 'ERROR: ssh_filter_btrbk.sh: failed to parse command line option: %s\n' "$key" 1>&2 - exit 255 + exit 2 ;; esac shift