summaryrefslogtreecommitdiff
path: root/source3/modules/vfs_acl_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/modules/vfs_acl_common.c')
-rw-r--r--source3/modules/vfs_acl_common.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/source3/modules/vfs_acl_common.c b/source3/modules/vfs_acl_common.c
index aeb9ce37ea..30a59e2024 100644
--- a/source3/modules/vfs_acl_common.c
+++ b/source3/modules/vfs_acl_common.c
@@ -821,11 +821,14 @@ static int acl_common_remove_object(vfs_handle_struct *handle,
goto out;
}
+ become_root();
if (is_directory) {
ret = SMB_VFS_NEXT_RMDIR(handle, final_component);
} else {
ret = SMB_VFS_NEXT_UNLINK(handle, &local_fname);
}
+ unbecome_root();
+
if (ret == -1) {
saved_errno = errno;
}
@@ -854,12 +857,9 @@ static int rmdir_acl_common(struct vfs_handle_struct *handle,
return ret;
}
- become_root();
- ret = acl_common_remove_object(handle,
+ return acl_common_remove_object(handle,
path,
true);
- unbecome_root();
- return ret;
}
static NTSTATUS create_file_acl_common(struct vfs_handle_struct *handle,
@@ -977,10 +977,7 @@ static int unlink_acl_common(struct vfs_handle_struct *handle,
return ret;
}
- become_root();
- ret = acl_common_remove_object(handle,
+ return acl_common_remove_object(handle,
smb_fname->base_name,
false);
- unbecome_root();
- return ret;
}