]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs_unityed_media: support real dirfsps in um_mkdirat()
authorRalph Boehme <slow@samba.org>
Mon, 14 Dec 2020 14:29:10 +0000 (15:29 +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_unityed_media.c

index 72c2e488dd63ae1a8d6613f8e732753094bf104a..4c2cc778c88f67227cad3298c3e6bf04cf59f483 100644 (file)
@@ -744,6 +744,7 @@ static int um_mkdirat(vfs_handle_struct *handle,
        int status;
        const char *path = smb_fname->base_name;
        struct smb_filename *client_fname = NULL;
+       struct smb_filename *full_fname = NULL;
 
        DEBUG(10, ("Entering with path '%s'\n", path));
 
@@ -754,20 +755,28 @@ static int um_mkdirat(vfs_handle_struct *handle,
                                mode);
        }
 
+       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,
                                &client_fname);
        if (status != 0) {
                goto err;
        }
 
        status = SMB_VFS_NEXT_MKDIRAT(handle,
-                               dirfsp,
+                               handle->conn->cwd_fsp,
                                client_fname,
                                mode);
 err:
        TALLOC_FREE(client_fname);
+       TALLOC_FREE(full_fname);
        DEBUG(10, ("Leaving with path '%s'\n", path));
        return status;
 }