mirror of
https://github.com/samba-team/samba.git
synced 2025-01-25 06:04:04 +03:00
Revert "dosmode: prefer capabilities over become_root"
This reverts commit 5e925f9755fad180863861157aa7548d83dd3fde. 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 58ea952fd0c716f94b1b79b8ed1829bb72732ccc)
This commit is contained in:
parent
aee05f1167
commit
bb68b73029
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user