ssh_filter_btrbk: allow access to "/" if no path restrictions are set.

pull/88/head
Axel Burri 2016-04-25 16:58:56 +02:00
parent 89df601ee5
commit 81feb41619
1 changed files with 2 additions and 2 deletions

View File

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