]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: hang directory pattern matching case sensitivity on the pathname
authorRalph Boehme <slow@samba.org>
Thu, 18 Sep 2025 18:35:22 +0000 (20:35 +0200)
committerVolker Lendecke <vl@samba.org>
Fri, 10 Oct 2025 10:40:30 +0000 (10:40 +0000)
For the SMB3 POSIX client both posix_open=true and (fsp->fsp_name->flags &
SMB_FILENAME_POSIX_PATH) will always be the case, so this is no change in
behaviour for that case.

However, for the macOS client fruit will carefully setup both flags as
posix_open=true but SMB_FILENAME_POSIX_PATH will not be set.

This is a deliberate hack to give the macOS client POSIX behaviour for some
operations, but not for others, while also allowing the POSIX-ified macOS client
to continue to get case insensitive behavour.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15926

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
selftest/knownfail.d/samba3.vfs.fruit
source3/smbd/dir.c

index b51c887c21290ea16773e7f31306a8acd3974003..6307e2b34043b5f960a67ad7861eeb004b5bed3e 100644 (file)
@@ -1,3 +1,2 @@
 ^samba3.vfs.fruit streams_depot.OS X AppleDouble file conversion\(nt4_dc\)
 ^samba3.vfs.fruit streams_depot.OS X AppleDouble file conversion without embedded xattr\(nt4_dc\)
-^samba3.vfs.fruit.*case_insensitive_find\(.*\)
index 95869e054f3103e3ec86710d92fe6e7d7eca92cd..21bcbe9e1c24c0f182c907b49c136f8076ea9286 100644 (file)
@@ -1157,7 +1157,7 @@ static NTSTATUS OpenDir_fsp(
                goto fail;
        }
        dir_hnd->fsp = fsp;
-       if (fsp->fsp_flags.posix_open) {
+       if (fsp->fsp_name->flags & SMB_FILENAME_POSIX_PATH) {
                dir_hnd->case_sensitive = true;
        } else {
                dir_hnd->case_sensitive = conn->case_sensitive;