Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
return -1;
}
- become_root();
+ set_effective_capability(DAC_OVERRIDE_CAPABILITY);
ret = SMB_VFS_FCHMOD(smb_fname->fsp, unixmode);
- unbecome_root();
+ drop_effective_capability(DAC_OVERRIDE_CAPABILITY);
done:
if (!newfile) {
/* Check if we have write access. */
if (can_write_to_fsp(fsp)) {
/* We are allowed to become root and change the filetime. */
- become_root();
+ set_effective_capability(DAC_OVERRIDE_CAPABILITY);
ret = SMB_VFS_FNTIMES(fsp, ft);
- unbecome_root();
+ drop_effective_capability(DAC_OVERRIDE_CAPABILITY);
}
return ret;