From: Jeremy Allison Date: Tue, 17 Sep 2019 00:22:58 +0000 (-0700) Subject: s3: VFS: vfs_recycle: Wrap recycle_unlink() into a call to recycle_unlink_internal(). X-Git-Tag: talloc-2.3.1~637 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f8bdb3974c5eade55bf307077fb71bf0fac8147;p=thirdparty%2Fsamba.git s3: VFS: vfs_recycle: Wrap recycle_unlink() into a call to recycle_unlink_internal(). Allows UNLINKAT parameters to be passed. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- diff --git a/source3/modules/vfs_recycle.c b/source3/modules/vfs_recycle.c index cb582acd976..8c663cb14da 100644 --- a/source3/modules/vfs_recycle.c +++ b/source3/modules/vfs_recycle.c @@ -452,8 +452,10 @@ static void recycle_do_touch(vfs_handle_struct *handle, /** * Check if file should be recycled **/ -static int recycle_unlink(vfs_handle_struct *handle, - const struct smb_filename *smb_fname) +static int recycle_unlink_internal(vfs_handle_struct *handle, + struct files_struct *dirfsp, + const struct smb_filename *smb_fname, + int flags) { connection_struct *conn = handle->conn; char *path_name = NULL; @@ -670,6 +672,15 @@ done: return rc; } +static int recycle_unlink(vfs_handle_struct *handle, + const struct smb_filename *smb_fname) +{ + return recycle_unlink_internal(handle, + handle->conn->cwd_fsp, + smb_fname, + 0); +} + static int recycle_unlinkat(vfs_handle_struct *handle, struct files_struct *dirfsp, const struct smb_filename *smb_fname, @@ -684,8 +695,10 @@ static int recycle_unlinkat(vfs_handle_struct *handle, flags); } else { SMB_ASSERT(dirfsp == dirfsp->conn->cwd_fsp); - ret = recycle_unlink(handle, - smb_fname); + ret = recycle_unlink_internal(handle, + dirfsp, + smb_fname, + flags); } return ret; }