From: Jeremy Allison Date: Fri, 18 Mar 2022 19:02:35 +0000 (-0700) Subject: s3: smbd: open_internal_dirfsp(). All calls to SMB_VFS_FSTAT(fsp, &fsp->fsp_name... X-Git-Tag: tevent-0.12.0~272 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a604dd02ffb468ba472ac4dd64f06d30ecdcc810;p=thirdparty%2Fsamba.git s3: smbd: open_internal_dirfsp(). 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/smbd/files.c b/source3/smbd/files.c index 6062a41902f..51ad489ef16 100644 --- a/source3/smbd/files.c +++ b/source3/smbd/files.c @@ -245,7 +245,6 @@ NTSTATUS open_internal_dirfsp(connection_struct *conn, { struct files_struct *fsp = NULL; NTSTATUS status; - int ret; status = create_internal_dirfsp(conn, smb_dname, &fsp); if (!NT_STATUS_IS_OK(status)) { @@ -264,10 +263,10 @@ NTSTATUS open_internal_dirfsp(connection_struct *conn, return status; } - ret = SMB_VFS_FSTAT(fsp, &fsp->fsp_name->st); - if (ret != 0) { + status = vfs_stat_fsp(fsp); + if (!NT_STATUS_IS_OK(status)) { file_free(NULL, fsp); - return map_nt_error_from_unix(errno); + return status; } if (!S_ISDIR(fsp->fsp_name->st.st_ex_mode)) {