]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs_media_harmony: support real dirfsps in mh_mkdirat()
authorRalph Boehme <slow@samba.org>
Mon, 14 Dec 2020 14:35:22 +0000 (15:35 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 17 Dec 2020 18:56:29 +0000 (18:56 +0000)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/vfs_media_harmony.c

index 79fc595339eeb5b77a581e25ecaa6481ee2d4c75..33b7b0840c2b5339ebb6e20003b24ea80950bd16 100644 (file)
@@ -997,6 +997,7 @@ static int mh_mkdirat(vfs_handle_struct *handle,
        int status;
        struct smb_filename *clientFname = NULL;
        const char *path = smb_fname->base_name;
+       struct smb_filename *full_fname = NULL;
 
        DEBUG(MH_INFO_DEBUG, ("Entering with path '%s'\n", path));
 
@@ -1008,19 +1009,27 @@ static int mh_mkdirat(vfs_handle_struct *handle,
                goto out;
        }
 
+       full_fname = full_path_from_dirfsp_atname(talloc_tos(),
+                                                 dirfsp,
+                                                 smb_fname);
+       if (full_fname == NULL) {
+               return -1;
+       }
+
        status = alloc_get_client_smb_fname(handle,
                                talloc_tos(),
-                               smb_fname,
+                               full_fname,
                                &clientFname);
        if (status != 0) {
                goto err;
        }
 
        status = SMB_VFS_NEXT_MKDIRAT(handle,
-                       dirfsp,
+                       handle->conn->cwd_fsp,
                        clientFname,
                        mode);
 err:
+       TALLOC_FREE(full_fname);
        TALLOC_FREE(clientFname);
 out:
        DEBUG(MH_INFO_DEBUG, ("Leaving with path '%s'\n", path));