]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:vfs_streams_xattr: Use dirfsp in streams_xattr_unlinkat()
authorAndreas Schneider <asn@samba.org>
Fri, 12 Jun 2026 13:50:40 +0000 (15:50 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Tue, 16 Jun 2026 12:41:25 +0000 (12:41 +0000)
Since commit 09f49fb56a4 ("smbd: Simplify delete_all_streams()"),
delete_all_streams() uses synthetic_smb_fname() instead of
synthetic_pathref(), passing a relative base_name to SMB_VFS_UNLINKAT()
that is relative to dirfsp, not the share root.

streams_xattr_unlinkat() creates a synthetic_pathref() for the base file
when fsp is NULL, but was using handle->conn->cwd_fsp (the share root)
instead of the passed dirfsp. This caused path resolution to fail for
files in subdirectories, leaving xattr streams intact after an OVERWRITE
or OVERWRITE_IF disposition.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Jun 16 12:41:25 UTC 2026 on atb-devel-224

selftest/knownfail.d/samba3.smb2.streams [deleted file]
source3/modules/vfs_streams_xattr.c

diff --git a/selftest/knownfail.d/samba3.smb2.streams b/selftest/knownfail.d/samba3.smb2.streams
deleted file mode 100644 (file)
index b4a75b6..0000000
+++ /dev/null
@@ -1 +0,0 @@
-^samba3.smb2.streams streams_xattr.create-disposition\(.*\)
index a8cc9cd10bde01994f376ee062334e3435d08d2c..726f60ecd3e399e2360645db03a1f7a817d84f2c 100644 (file)
@@ -1095,7 +1095,7 @@ static int streams_xattr_unlinkat(vfs_handle_struct *handle,
 
        if (fsp == NULL) {
                status = synthetic_pathref(talloc_tos(),
-                                       handle->conn->cwd_fsp,
+                                       dirfsp,
                                        smb_fname->base_name,
                                        NULL,
                                        NULL,