From: Björn Jacke Date: Fri, 17 Jun 2022 05:26:53 +0000 (+0200) Subject: vfs_recycle.c: prefer capabilities over become_root X-Git-Tag: talloc-2.4.2~644 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4227b011f6ada97a4cd72a440ed887ffdb3f219e;p=thirdparty%2Fsamba.git vfs_recycle.c: prefer capabilities over become_root Signed-off-by: Bjoern Jacke Reviewed-by: Christof Schmitt --- 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)));