]> 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)
committerJule Anger <janger@samba.org>
Fri, 28 Apr 2023 15:57:35 +0000 (15:57 +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>
(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

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 912ce1d3004c1e2f2bbfd06ffdd2badfedad6195..919dbcf68c576c44976279bf3fbd7e6bffa896ee 100644 (file)
@@ -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. */