mirror of https://github.com/digint/btrbk
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
parent
90503298ff
commit
e5105949d6
|
@ -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
|
btrbk-0.32.5
|
||||||
|
|
||||||
* Correct handling of zero-size raw info file (close #491).
|
* Correct handling of zero-size raw info file (close #491).
|
||||||
|
|
|
@ -42,7 +42,7 @@ reject_and_die()
|
||||||
local reason="$1"
|
local reason="$1"
|
||||||
log_cmd 'auth.err' 'btrbk REJECT' "$reason"
|
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
|
printf 'ERROR: ssh_filter_btrbk.sh: ssh command rejected: %s: %s\n' "$reason" "$SSH_ORIGINAL_COMMAND" 1>&2
|
||||||
exit 255
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
run_cmd()
|
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
|
printf 'ERROR: ssh_filter_btrbk.sh: failed to parse command line option: %s\n' "$key" 1>&2
|
||||||
exit 255
|
exit 2
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
shift
|
shift
|
||||||
|
|
Loading…
Reference in New Issue