]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:lib: Do not try to match '.' and '..' directories in is_in_path()
authorAndreas Schneider <asn@samba.org>
Wed, 19 Apr 2023 14:23:10 +0000 (16:23 +0200)
committerJeremy Allison <jra@samba.org>
Wed, 19 Apr 2023 22:30:19 +0000 (22:30 +0000)
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>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Apr 19 22:30:19 UTC 2023 on atb-devel-224

selftest/knownfail.d/veto_files [deleted file]
source3/lib/util.c

diff --git a/selftest/knownfail.d/veto_files b/selftest/knownfail.d/veto_files
deleted file mode 100644 (file)
index be28da8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-^samba3.blackbox.test_veto_files.list.files.fileserver
index b010d035cdd42c638d7f5f99b4c0346bb6628428..9fd913ba72908c94d72fe84ad4922713dffd09c1 100644 (file)
@@ -743,6 +743,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. */