]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs_default.c: prefer capabilities over become_root
authorBjörn Jacke <bj@sernet.de>
Fri, 17 Jun 2022 05:26:02 +0000 (07:26 +0200)
committerBjoern Jacke <bjacke@samba.org>
Thu, 16 Nov 2023 21:38:38 +0000 (21:38 +0000)
Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
source3/modules/vfs_default.c

index d1a19568e4eb9d999db5fd01c0084aab0ebbc1cc..3c412f346e1659e4ea01f5b1c0b65c91a69644f0 100644 (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;
                }