From d0c295e5344d7858cf75e19184e3842de06f27ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Jacke?= Date: Mon, 25 Mar 2024 17:03:44 +0100 Subject: [PATCH] Revert "vfs_recycle.c: prefer capabilities over become_root" This reverts commit 4227b011f6ada97a4cd72a440ed887ffdb3f219e. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15583 Signed-off-by: Bjoern Jacke Reviewed-by: Ralph Boehme (cherry picked from commit 7f19afbd40d3ad3c8d186d0a2a64d07a2a8bd00a) --- source3/modules/vfs_recycle.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source3/modules/vfs_recycle.c b/source3/modules/vfs_recycle.c index a9d60f6adbb..327a7eea06e 100644 --- a/source3/modules/vfs_recycle.c +++ b/source3/modules/vfs_recycle.c @@ -401,10 +401,10 @@ static void recycle_do_touch(vfs_handle_struct *handle, /* mtime */ ft.mtime = touch_mtime ? ft.atime : smb_fname_tmp->st.st_ex_mtime; - set_effective_capability(DAC_OVERRIDE_CAPABILITY); + become_root(); ret = SMB_VFS_NEXT_FNTIMES(handle, smb_fname_tmp->fsp, &ft); err = errno; - drop_effective_capability(DAC_OVERRIDE_CAPABILITY); + unbecome_root(); if (ret == -1 ) { DEBUG(0, ("recycle: touching %s failed, reason = %s\n", smb_fname_str_dbg(smb_fname_tmp), strerror(err)));