s3: VFS: vfs_streams_depot. Wrap Convert streams_depot_unlink() -> streams_depot_unli...
authorJeremy Allison <jra@samba.org>
Wed, 18 Sep 2019 02:23:31 +0000 (19:23 -0700)
committerRalph Boehme <slow@samba.org>
Thu, 26 Sep 2019 17:20:46 +0000 (17:20 +0000)
Make streams_depot_unlink() a wrapper calling the internal version.

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

index c85e4df6dbfa11a7659d2b2cd38ba9ef4e08228d..c51bdac0058aeea23b7cf71e28549ff67c60ec76 100644 (file)
@@ -691,8 +691,10 @@ static int streams_depot_open(vfs_handle_struct *handle,
        return ret;
 }
 
-static int streams_depot_unlink(vfs_handle_struct *handle,
-                               const struct smb_filename *smb_fname)
+static int streams_depot_unlink_internal(vfs_handle_struct *handle,
+                               struct files_struct *dirfsp,
+                               const struct smb_filename *smb_fname,
+                               int flags)
 {
        struct smb_filename *smb_fname_base = NULL;
        int ret = -1;
@@ -777,6 +779,15 @@ static int streams_depot_unlink(vfs_handle_struct *handle,
        return ret;
 }
 
+static int streams_depot_unlink(vfs_handle_struct *handle,
+                               const struct smb_filename *smb_fname)
+{
+       return streams_depot_unlink_internal(handle,
+                               handle->conn->cwd_fsp,
+                               smb_fname,
+                               0);
+}
+
 static int streams_depot_rmdir(vfs_handle_struct *handle,
                                const struct smb_filename *smb_fname)
 {
@@ -854,7 +865,10 @@ static int streams_depot_unlinkat(vfs_handle_struct *handle,
        if (flags & AT_REMOVEDIR) {
                ret = streams_depot_rmdir(handle, smb_fname);
        } else {
-               ret = streams_depot_unlink(handle, smb_fname);
+               ret = streams_depot_unlink_internal(handle,
+                               dirfsp,
+                               smb_fname,
+                               flags);
        }
        return ret;
 }