summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2022-03-18 15:04:34 -0700
committerJule Anger <janger@samba.org>2022-04-11 08:32:10 +0000
commit0671b340fbbc00e07412b5f8f8d3bed4f9c53cfb (patch)
treedc8ca3607161507b151772e381832846cd015272 /source3
parent687e9cc84581e930060ecd79236e4801eed476f4 (diff)
downloadsamba-0671b340fbbc00e07412b5f8f8d3bed4f9c53cfb.tar.gz
s3: cmd_vfs: cmd_set_nt_acl(). 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 <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> (back-ported picked from commit 23d5c909286d438534f1a7defb2faacd1877fea1)
Diffstat (limited to 'source3')
-rw-r--r--source3/torture/cmd_vfs.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/source3/torture/cmd_vfs.c b/source3/torture/cmd_vfs.c
index b1273cd9fe5..43a34d98c5e 100644
--- a/source3/torture/cmd_vfs.c
+++ b/source3/torture/cmd_vfs.c
@@ -1772,18 +1772,13 @@ static NTSTATUS cmd_set_nt_acl(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int a
}
fsp_set_fd(fsp, fd);
- status = NT_STATUS_OK;
- ret = SMB_VFS_FSTAT(fsp, &smb_fname->st);
- if (ret == -1) {
+ status = vfs_stat_fsp(fsp);
+ if (!NT_STATUS_IS_OK(status)) {
/* If we have an fd, this stat should succeed. */
DEBUG(0,("Error doing fstat on open file %s "
"(%s)\n",
smb_fname_str_dbg(smb_fname),
- strerror(errno) ));
- status = map_nt_error_from_unix(errno);
- }
-
- if (!NT_STATUS_IS_OK(status)) {
+ nt_errstr(status) ));
goto out;
}