From 4227b011f6ada97a4cd72a440ed887ffdb3f219e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bj=C3=B6rn=20Jacke?= Date: Fri, 17 Jun 2022 07:26:53 +0200 Subject: [PATCH] vfs_recycle.c: prefer capabilities over become_root Signed-off-by: Bjoern Jacke Reviewed-by: Christof Schmitt --- 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 b794ebc2d8c..b03db6a3b7f 100644 --- a/source3/modules/vfs_recycle.c +++ b/source3/modules/vfs_recycle.c @@ -441,10 +441,10 @@ static void recycle_do_touch(vfs_handle_struct *handle, /* mtime */ ft.mtime = touch_mtime ? ft.atime : smb_fname_tmp->st.st_ex_mtime; - become_root(); + set_effective_capability(DAC_OVERRIDE_CAPABILITY); ret = SMB_VFS_NEXT_FNTIMES(handle, smb_fname_tmp->fsp, &ft); err = errno; - unbecome_root(); + drop_effective_capability(DAC_OVERRIDE_CAPABILITY); if (ret == -1 ) { DEBUG(0, ("recycle: touching %s failed, reason = %s\n", smb_fname_str_dbg(smb_fname_tmp), strerror(err))); -- 2.47.3