Revert "vfs_default.c: prefer capabilities over become_root"
authorBjörn Jacke <bjacke@samba.org>
Mon, 25 Mar 2024 16:03:57 +0000 (17:03 +0100)
committerRalph Boehme <slow@samba.org>
Wed, 27 Mar 2024 09:40:34 +0000 (09:40 +0000)
This reverts commit 62464bd2db2a95b1253364f4493bbb6770b73193.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15583
Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/modules/vfs_default.c

index 98188a50c3480d75d9da581224a2bf1f76b35d78..62ad5063af0f4cb2cb78a9184f72c655a723edc7 100644 (file)
@@ -1897,14 +1897,14 @@ static void vfswrap_get_dos_attributes_getxattr_done(struct tevent_req *subreq)
 
                state->as_root = true;
 
-               set_effective_capability(DAC_OVERRIDE_CAPABILITY);
+               become_root();
                subreq = SMB_VFS_GETXATTRAT_SEND(state,
                                                 state->ev,
                                                 state->dir_fsp,
                                                 state->smb_fname,
                                                 SAMBA_XATTR_DOS_ATTRIB,
                                                 sizeof(fstring));
-               drop_effective_capability(DAC_OVERRIDE_CAPABILITY);
+               unbecome_root();
                if (tevent_req_nomem(subreq, req)) {
                        return;
                }