1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-10 01:18:15 +03:00

Revert "dosmode: prefer capabilities over become_root"

This reverts commit 5e925f9755.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15583
Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit 58ea952fd0)
This commit is contained in:
Björn Jacke 2024-03-25 17:03:14 +01:00 committed by Jule Anger
parent aee05f1167
commit bb68b73029

View File

@ -1035,9 +1035,9 @@ int file_set_dosmode(connection_struct *conn,
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) {
@ -1207,9 +1207,9 @@ int file_ntimes(connection_struct *conn,
/* 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;