1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-02 09:47:23 +03:00

vfs_default.c: prefer capabilities over become_root

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
This commit is contained in:
Björn Jacke 2022-06-17 07:26:02 +02:00 committed by Bjoern Jacke
parent 0e3836e396
commit 62464bd2db

View File

@ -1891,14 +1891,14 @@ static void vfswrap_get_dos_attributes_getxattr_done(struct tevent_req *subreq)
state->as_root = true;
become_root();
set_effective_capability(DAC_OVERRIDE_CAPABILITY);
subreq = SMB_VFS_GETXATTRAT_SEND(state,
state->ev,
state->dir_fsp,
state->smb_fname,
SAMBA_XATTR_DOS_ATTRIB,
sizeof(fstring));
unbecome_root();
drop_effective_capability(DAC_OVERRIDE_CAPABILITY);
if (tevent_req_nomem(subreq, req)) {
return;
}