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, 23 Aug 2022 14:26:49 +0000 (14:26 +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)

Autobuild-User(v4-17-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-17-test): Tue Aug 23 14:26:49 UTC 2022 on sn-devel-184

source3/smbd/dosmode.c

index 3fe84824a9470db4acefc221b0bd92e53afb0526..cb3cdc568bd57d435fb11c4fda69945296a2b61d 100644 (file)
@@ -366,7 +366,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));
@@ -377,7 +377,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));