From: Ralph Boehme Date: Thu, 18 Sep 2025 18:35:22 +0000 (+0200) Subject: smbd: hang directory pattern matching case sensitivity on the pathname X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b3132202cf787cc9fb061e39eaf1509157f53953;p=thirdparty%2Fsamba.git smbd: hang directory pattern matching case sensitivity on the pathname 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 Reviewed-by: Volker Lendecke --- diff --git a/selftest/knownfail.d/samba3.vfs.fruit b/selftest/knownfail.d/samba3.vfs.fruit index b51c887c212..6307e2b3404 100644 --- a/selftest/knownfail.d/samba3.vfs.fruit +++ b/selftest/knownfail.d/samba3.vfs.fruit @@ -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\(.*\) diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c index 95869e054f3..21bcbe9e1c2 100644 --- a/source3/smbd/dir.c +++ b/source3/smbd/dir.c @@ -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;