mirror of https://github.com/digint/btrbk
ssh_filter_btrbk: allow access to "/" if no path restrictions are set.
parent
89df601ee5
commit
81feb41619
|
@ -46,12 +46,12 @@ reject_filtered_cmd()
|
||||||
{
|
{
|
||||||
# note that the backslash is NOT a metacharacter in a POSIX bracket expression!
|
# 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
|
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
|
if [[ -n "$restrict_path_list" ]]; then
|
||||||
# match any of restrict_path_list with or without trailing slash,
|
# match any of restrict_path_list with or without trailing slash,
|
||||||
# or any file/directory (matching file_match) below restrict_path
|
# 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
|
else
|
||||||
# match any absolute file/directory (matching file_match)
|
# match any absolute file/directory (matching file_match)
|
||||||
path_match="/${file_match}"
|
path_match="/${file_match}"
|
||||||
|
|
Loading…
Reference in New Issue