From: Björn Jacke Date: Fri, 17 Jun 2022 05:26:02 +0000 (+0200) Subject: vfs_default.c: prefer capabilities over become_root X-Git-Tag: talloc-2.4.2~646 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=62464bd2db2a95b1253364f4493bbb6770b73193;p=thirdparty%2Fsamba.git vfs_default.c: prefer capabilities over become_root Signed-off-by: Bjoern Jacke Reviewed-by: Christof Schmitt --- diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index d1a19568e4e..3c412f346e1 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -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; }