return -1;
}
- set_effective_capability(DAC_OVERRIDE_CAPABILITY);
+ become_root();
ret = SMB_VFS_FCHMOD(smb_fname->fsp, unixmode);
- drop_effective_capability(DAC_OVERRIDE_CAPABILITY);
+ unbecome_root();
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. */
- set_effective_capability(DAC_OVERRIDE_CAPABILITY);
+ become_root();
ret = SMB_VFS_FNTIMES(fsp, ft);
- drop_effective_capability(DAC_OVERRIDE_CAPABILITY);
+ unbecome_root();
}
return ret;