From: Jeremy Allison Date: Fri, 18 Mar 2022 18:56:53 +0000 (-0700) Subject: s3: smbd: mdssvc: All calls to SMB_VFS_FSTAT(fsp, &fsp->fsp_name->st) clobber fsp... X-Git-Tag: tevent-0.12.0~274 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2b246dbf687cbb6ef1e31e22fd64a95bdca8f4e9;p=thirdparty%2Fsamba.git s3: smbd: mdssvc: All calls to SMB_VFS_FSTAT(fsp, &fsp->fsp_name->st) clobber fsp->fsp_name->st.st_ex_iflags. If doing an SMB_VFS_FSTAT() returning onto the stat struct stored in the fsp, we must call vfs_stat_fsp() as this preserves the iflags. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15022 Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- diff --git a/source3/rpc_server/mdssvc/mdssvc.c b/source3/rpc_server/mdssvc/mdssvc.c index fa31b55a183..956e097eaf4 100644 --- a/source3/rpc_server/mdssvc/mdssvc.c +++ b/source3/rpc_server/mdssvc/mdssvc.c @@ -1354,13 +1354,13 @@ static bool slrpc_fetch_attributes(struct mds_ctx *mds_ctx, return true; } - result = SMB_VFS_FSTAT(smb_fname->fsp, &smb_fname->st); - if (result != 0) { + status = vfs_stat_fsp(smb_fname->fsp); + if (!NT_STATUS_IS_OK(status)) { TALLOC_FREE(smb_fname); return true; } - sp = &smb_fname->st; + sp = &smb_fname->fsp->fsp_name->st; } ok = add_filemeta(mds_ctx, reqinfo, fm_array, path, sp);