From 81feb4161950fb244fdadad857549fc105c68bda Mon Sep 17 00:00:00 2001 From: Axel Burri Date: Mon, 25 Apr 2016 16:58:56 +0200 Subject: [PATCH] ssh_filter_btrbk: allow access to "/" if no path restrictions are set. --- 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 9b214da..2ddbf6e 100755 --- a/ssh_filter_btrbk.sh +++ b/ssh_filter_btrbk.sh @@ -46,12 +46,12 @@ reject_filtered_cmd() { # note that the backslash is NOT a metacharacter in a POSIX bracket expression! option_match='-[a-zA-Z-]+' # matches short as well as long options - file_match='[0-9a-zA-Z_@+./-]+' # matches file path (equal to $file_match in btrbk) + file_match='[0-9a-zA-Z_@+./-]*' # matches file path (equal to $file_match in btrbk) if [[ -n "$restrict_path_list" ]]; then # match any of restrict_path_list with or without trailing slash, # or any file/directory (matching file_match) below restrict_path - path_match="(${restrict_path_list})(/|/${file_match})?" + path_match="(${restrict_path_list})(/${file_match})?" else # match any absolute file/directory (matching file_match) path_match="/${file_match}"