]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs_media_harmony: support real dirfsps in mh_unlinkat()
authorRalph Boehme <slow@samba.org>
Wed, 20 Jan 2021 14:02:54 +0000 (15:02 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 28 Jan 2021 08:11:49 +0000 (08:11 +0000)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/vfs_media_harmony.c

index ecf8b49ccf33bfb52a2e9e7e9806b3bbc3d01efd..307d7afa9635bcdf17ea610acf93acd9de42be1d 100644 (file)
@@ -1436,6 +1436,7 @@ static int mh_unlinkat(vfs_handle_struct *handle,
                int flags)
 {
        int status;
+       struct smb_filename *full_fname = NULL;
        struct smb_filename *clientFname;
        TALLOC_CTX *ctx;
 
@@ -1451,17 +1452,25 @@ static int mh_unlinkat(vfs_handle_struct *handle,
        clientFname = NULL;
        ctx = talloc_tos();
 
+       full_fname = full_path_from_dirfsp_atname(talloc_tos(),
+                                                 dirfsp,
+                                                 smb_fname);
+       if (full_fname == NULL) {
+               return -1;
+       }
+
        if ((status = alloc_get_client_smb_fname(handle, ctx,
-                               smb_fname,
+                               full_fname,
                                &clientFname))) {
                goto err;
        }
 
        status = SMB_VFS_NEXT_UNLINKAT(handle,
-                               dirfsp,
+                               dirfsp->conn->cwd_fsp,
                                clientFname,
                                flags);
 err:
+       TALLOC_FREE(full_fname);
        TALLOC_FREE(clientFname);
 out:
        return status;