ssh_filter_btrbk.sh: replace OpenSSH’s deprecated SSH_CLIENT

OpenSSH’s environment variable `SSH_CLIENT` has been deprecated in upstream
commit f37e246f858cdd79be4f4e158b7b04778d1cb7e9 (2002-09-19) and replaced by
`SSH_CONNECTION`.

Both contain more than just the remote information, thus adapted the log message
to reflect that.

Since this might be used by 3rd-party programs (like fail2ban), 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 21:51:04 +01:00
parent e5105949d6
commit 4888cc51e5
2 changed files with 2 additions and 1 deletions

View File

@ -3,6 +3,7 @@ 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).
* ssh_filter_btrbk.shs logging output format has changed slightly.
btrbk-0.32.5

View File

@ -23,7 +23,7 @@ file_arg_match="('${file_match}'|${file_match_sane})" # support btrbk < 0.32.0
log_cmd()
{
if [ -n "$enable_log" ]; then
logger -p "$1" -t ssh_filter_btrbk.sh "$2 (Name: ${LOGNAME:-<unknown>}; Remote: ${SSH_CLIENT:-<unknown>})${3:+: $3}: $SSH_ORIGINAL_COMMAND"
logger -p "$1" -t ssh_filter_btrbk.sh "$2 (Name: ${LOGNAME:-<unknown>}; Connection: ${SSH_CONNECTION:-<unknown>})${3:+: $3}: $SSH_ORIGINAL_COMMAND"
fi
}