1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

smbd: use metadata_fsp() with SMB_VFS_FSET_NT_ACL()

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: Volker Lendecke <vl@samba.org>
This commit is contained in:
Ralph Boehme 2022-07-29 14:54:07 +02:00 committed by Volker Lendecke
parent c949e4b2a4
commit 4ab29e2a34
3 changed files with 10 additions and 4 deletions

View File

@ -5251,7 +5251,7 @@ static NTSTATUS inherit_new_acl(files_struct *dirfsp, files_struct *fsp)
/* We need to be root to force this. */
become_root();
}
status = SMB_VFS_FSET_NT_ACL(fsp,
status = SMB_VFS_FSET_NT_ACL(metadata_fsp(fsp),
security_info_sent,
psd);
if (inherit_owner) {

View File

@ -281,7 +281,7 @@ static NTSTATUS set_nt_acl_conn(const char *fname,
return status;
}
status = SMB_VFS_FSET_NT_ACL(fsp, security_info_sent, sd);
status = SMB_VFS_FSET_NT_ACL(metadata_fsp(fsp), security_info_sent, sd);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("set_nt_acl_no_snum: fset_nt_acl returned %s.\n", nt_errstr(status)));
}

View File

@ -1717,7 +1717,10 @@ static NTSTATUS cmd_fset_nt_acl(struct vfs_state *vfs, TALLOC_CTX *mem_ctx,
return NT_STATUS_INVALID_PARAMETER;
}
status = SMB_VFS_FSET_NT_ACL(vfs->files[fd], SECINFO_OWNER | SECINFO_GROUP | SECINFO_DACL, sd);
status = SMB_VFS_FSET_NT_ACL(
metadata_fsp(vfs->files[fd]),
SECINFO_OWNER | SECINFO_GROUP | SECINFO_DACL,
sd);
if (!NT_STATUS_IS_OK(status)) {
printf("fset_nt_acl returned (%s)\n", nt_errstr(status));
return status;
@ -1823,7 +1826,10 @@ static NTSTATUS cmd_set_nt_acl(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int a
goto out;
}
status = SMB_VFS_FSET_NT_ACL(fsp, SECINFO_OWNER | SECINFO_GROUP | SECINFO_DACL, sd);
status = SMB_VFS_FSET_NT_ACL(
metadata_fsp(fsp),
SECINFO_OWNER | SECINFO_GROUP | SECINFO_DACL,
sd);
if (!NT_STATUS_IS_OK(status)) {
printf("fset_nt_acl returned (%s)\n", nt_errstr(status));
goto out;