From 6e0917b395a6d1774544fa420a3d13a6582f0f73 Mon Sep 17 00:00:00 2001 From: Tom Hale Date: Sat, 4 Oct 2025 19:40:38 +1000 Subject: [PATCH] Complete reversion of grep -q in ssh_filter_btrbk.sh `grep -q` on a non-existent file will output on STDERR. The orginal never produced output (STDERR or STDOUT) --- ssh_filter_btrbk.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ssh_filter_btrbk.sh b/ssh_filter_btrbk.sh index 76de95e..e9038e1 100755 --- a/ssh_filter_btrbk.sh +++ b/ssh_filter_btrbk.sh @@ -102,12 +102,12 @@ reject_filtered_cmd() # when an error occurred. allow_stream_match="^${stream_in_match}${allow_cmd_match}${stream_out_match}" - if printf '%s' "${SSH_ORIGINAL_COMMAND}" | grep -E -- "${allow_stream_match}"; then + if printf '%s' "${SSH_ORIGINAL_COMMAND}" | grep -E -- "${allow_stream_match}" >/dev/null 2>/dev/null; then return 0 fi exact_cmd_match="^(${allow_exact_list})$"; - if printf '%s' "${SSH_ORIGINAL_COMMAND}" | grep -E -- "${exact_cmd_match}"; then + if printf '%s' "${SSH_ORIGINAL_COMMAND}" | grep -E -- "${exact_cmd_match}" >/dev/null 2>/dev/null; then return 0 fi