From 968a5ae89f0d0da219e7dd05dd1f7f7c96dbb910 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Sun, 14 Aug 2022 16:39:37 +0200 Subject: [PATCH] smbd: directly pass fsp to SMB_VFS_FGETXATTR() in fget_ea_dos_attribute() 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 Reviewed-by: Stefan Metzmacher --- source3/smbd/dosmode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c index 3fe84824a94..cb3cdc568bd 100644 --- a/source3/smbd/dosmode.c +++ b/source3/smbd/dosmode.c @@ -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)); -- 2.47.3