]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: directly pass fsp to SMB_VFS_FGETXATTR() in fget_ea_dos_attribute()
authorRalph Boehme <slow@samba.org>
Sun, 14 Aug 2022 14:39:37 +0000 (16:39 +0200)
committerJule Anger <janger@samba.org>
Tue, 6 Sep 2022 06:32:13 +0000 (06:32 +0000)
We're now consistently passing the base_fsp to SMB_VFS_FSET_DOS_ATTRIBUTES(), so
we don't need to check for a stream_fsp here anymore.

Additionally vfs_default will assert a non-stream fsp inside
vfswrap_fgetxattr(), so in case any caller wrongly passes a stream fsp, this is
caught in vfs_default.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15126
MR: https://gitlab.com/samba-team/samba/-/merge_requests/2643

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 968a5ae89f0d0da219e7dd05dd1f7f7c96dbb910)

source3/smbd/dosmode.c

index f32401e787b1db65444bd8619ccfd3c93344f297..37bd3b5f78ed4ac7f7434056c72255247b9f88c2 100644 (file)
@@ -375,7 +375,7 @@ NTSTATUS fget_ea_dos_attribute(struct files_struct *fsp,
        /* Don't reset pattr to zero as we may already have filename-based attributes we
           need to preserve. */
 
-       sizeret = SMB_VFS_FGETXATTR(fsp->base_fsp ? fsp->base_fsp : fsp,
+       sizeret = SMB_VFS_FGETXATTR(fsp,
                                    SAMBA_XATTR_DOS_ATTRIB,
                                    attrstr,
                                    sizeof(attrstr));
@@ -386,7 +386,7 @@ NTSTATUS fget_ea_dos_attribute(struct files_struct *fsp,
                   rights than the real user
                */
                become_root();
-               sizeret = SMB_VFS_FGETXATTR(fsp->base_fsp ? fsp->base_fsp : fsp,
+               sizeret = SMB_VFS_FGETXATTR(fsp,
                                            SAMBA_XATTR_DOS_ATTRIB,
                                            attrstr,
                                            sizeof(attrstr));