1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

Modification of fix for bug 6876 - Delete of an object whose parent folder does not have delete rights fails even if the delete right is set on the object

Suggested by Volker. Reduce the surface area of the
become_root() unbecome_root() code to reduce the chance
of errors.

Jeremy.
This commit is contained in:
Jeremy Allison 2010-01-16 17:03:06 -08:00
parent dde836adbd
commit 98a495f1e6

View File

@ -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;
}