]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs: Slightly simplify acl_common_remove_object()
authorVolker Lendecke <vl@samba.org>
Mon, 30 Dec 2024 19:15:53 +0000 (20:15 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 23 Jan 2025 23:08:38 +0000 (23:08 +0000)
This makes it more obvious to me that it's just the flag that differs
between the if-branches.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/vfs_acl_common.c

index 5686c15c777100b86e194329c7aaeb7f65048aee..322c2ea48d7d2fee31322798487d9dd8c22d78db 100644 (file)
@@ -1041,17 +1041,10 @@ static int acl_common_remove_object(vfs_handle_struct *handle,
        }
 
        become_root();
-       if (is_directory) {
-               ret = SMB_VFS_NEXT_UNLINKAT(handle,
-                               dirfsp,
-                               smb_fname,
-                               AT_REMOVEDIR);
-       } else {
-               ret = SMB_VFS_NEXT_UNLINKAT(handle,
-                               dirfsp,
-                               smb_fname,
-                               0);
-       }
+       ret = SMB_VFS_NEXT_UNLINKAT(handle,
+                                   dirfsp,
+                                   smb_fname,
+                                   is_directory ? AT_REMOVEDIR : 0);
        unbecome_root();
 
        return ret;