]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: avoid mangling names in smbd_dirptr_lanman2_match_fn() for POSIX master
authorRalph Boehme <slow@samba.org>
Sun, 25 May 2025 18:05:59 +0000 (20:05 +0200)
committerJeremy Allison <jra@samba.org>
Mon, 7 Jul 2025 17:45:13 +0000 (17:45 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15862

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Jul  7 17:45:13 UTC 2025 on atb-devel-224

selftest/knownfail.d/samba.tests.smb3unix [deleted file]
source3/smbd/smb2_trans2.c

diff --git a/selftest/knownfail.d/samba.tests.smb3unix b/selftest/knownfail.d/samba.tests.smb3unix
deleted file mode 100644 (file)
index 4e3f64a..0000000
+++ /dev/null
@@ -1 +0,0 @@
-^samba.tests.smb3unix.*test_posix_reserved_char\(fileserver_smb1\)
index 8c3076de603427817cd4c89e999a09ce2176c874..deb371beaba646d2736e5246d8dd98f50b2cd431 100644 (file)
@@ -920,6 +920,7 @@ struct smbd_dirptr_lanman2_state {
        uint32_t info_level;
        bool check_mangled_names;
        bool case_sensitive;
+       bool posix_paths;
 };
 
 static bool smbd_dirptr_lanman2_match_fn(TALLOC_CTX *ctx,
@@ -936,7 +937,9 @@ static bool smbd_dirptr_lanman2_match_fn(TALLOC_CTX *ctx,
        const char *fname;
 
        /* Mangle fname if it's an illegal name. */
-       if (mangle_must_mangle(dname, state->conn->params)) {
+       if (!state->posix_paths &&
+           mangle_must_mangle(dname, state->conn->params))
+       {
                /*
                 * Slow path - ensure we can push the original name as UCS2. If
                 * not, then just don't return this name.
@@ -1800,6 +1803,9 @@ NTSTATUS smbd_dirptr_lanman2_entry(TALLOC_CTX *ctx,
                state.check_mangled_names = true;
        }
        state.case_sensitive = dptr_case_sensitive(dirptr);
+       if (dirfsp->fsp_name->flags & SMB_FILENAME_POSIX_PATH) {
+               state.posix_paths = true;
+       }
 
        p = strrchr_m(path_mask,'/');
        if(p != NULL) {