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

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/nfs4_acls.c

index 0cc2b6cf364265b06bb7db31271dc544357b106e..c80f8390170b92a3e87e76571f833e2a4a86b229 100644 (file)
@@ -1201,12 +1201,12 @@ NTSTATUS smb_set_nt_acl_nfs4(vfs_handle_struct *handle, files_struct *fsp,
        smbacl4_dump_nfs4acl(10, theacl);
 
        if (set_acl_as_root) {
-               set_effective_capability(DAC_OVERRIDE_CAPABILITY);
+               become_root();
        }
        result = set_nfs4_native(handle, fsp, theacl);
        saved_errno = errno;
        if (set_acl_as_root) {
-               drop_effective_capability(DAC_OVERRIDE_CAPABILITY);
+               unbecome_root();
        }
 
        TALLOC_FREE(frame);