ssh_filter_btrbk.sh: use more common exit statuses

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 <mail@christoph.anton.mitterer.name>
pull/511/head
Christoph Anton Mitterer 2022-11-21 17:49:28 +01:00
parent 90503298ff
commit e5105949d6
2 changed files with 8 additions and 2 deletions

View File

@ -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 programs arguments could not
be parsed).
btrbk-0.32.5
* Correct handling of zero-size raw info file (close #491).

View File

@ -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