Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
/* Ok, we failed to chown and we have
SEC_STD_WRITE_OWNER access - override. */
- become_root();
+ set_effective_capability(DAC_OVERRIDE_CAPABILITY);
status = SMB_VFS_NEXT_FSET_NT_ACL(handle, fsp, security_info_sent, psd);
- unbecome_root();
+ drop_effective_capability(DAC_OVERRIDE_CAPABILITY);
return status;
}
goto out;
}
- become_root();
+ set_effective_capability(DAC_OVERRIDE_CAPABILITY);
if (is_directory) {
ret = SMB_VFS_NEXT_UNLINKAT(handle,
dirfsp,
smb_fname,
0);
}
- unbecome_root();
+ drop_effective_capability(DAC_OVERRIDE_CAPABILITY);
if (ret == -1) {
saved_errno = errno;