]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: VFS: vfs_recycle: Wrap recycle_unlink() into a call to recycle_unlink_internal().
authorJeremy Allison <jra@samba.org>
Tue, 17 Sep 2019 00:22:58 +0000 (17:22 -0700)
committerRalph Boehme <slow@samba.org>
Thu, 26 Sep 2019 17:20:46 +0000 (17:20 +0000)
Allows UNLINKAT parameters to be passed.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/modules/vfs_recycle.c

index cb582acd9764205454257479040e64470d8f03d2..8c663cb14da5ebd8b0a51ecf452b8232a59cda9f 100644 (file)
@@ -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;
 }