diff options
author | Andreas Schneider <asn@samba.org> | 2023-04-19 16:23:10 +0200 |
---|---|---|
committer | Jule Anger <janger@samba.org> | 2023-04-28 15:57:35 +0000 |
commit | b026bbe24c12dcbfb716c7be26df183d339eac8b (patch) | |
tree | 2541dc37103f5f53db6279dc7456468a01785827 | |
parent | c13b5b7dc89039cb4ee6a74b766fe944ce311d67 (diff) | |
download | samba-b026bbe24c12dcbfb716c7be26df183d339eac8b.tar.gz |
s3:lib: Do not try to match '.' and '..' directories in is_in_path()
This fixes setting veto files to '.*' to not list hidden files and
directories starting with a dot.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15360
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 9eb44306623fc4897b373b04763e475f696ab92d)
Autobuild-User(v4-17-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-17-test): Fri Apr 28 15:57:35 UTC 2023 on sn-devel-184
-rw-r--r-- | selftest/knownfail.d/veto_files | 1 | ||||
-rw-r--r-- | source3/lib/util.c | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/selftest/knownfail.d/veto_files b/selftest/knownfail.d/veto_files deleted file mode 100644 index be28da859b7..00000000000 --- a/selftest/knownfail.d/veto_files +++ /dev/null @@ -1 +0,0 @@ -^samba3.blackbox.test_veto_files.list.files.fileserver diff --git a/source3/lib/util.c b/source3/lib/util.c index 912ce1d3004..919dbcf68c5 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -748,6 +748,11 @@ bool is_in_path(const char *name, name_compare_entry *namelist, bool case_sensit return False; } + /* Do not reject path components if namelist is set to '.*' */ + if (ISDOT(name) || ISDOTDOT(name)) { + return false; + } + DEBUG(8, ("is_in_path: %s\n", name)); /* Get the last component of the unix name. */ |