s3: VFS: Modify mkdir to take a const struct smb_filename * instead of const char *
[bbaumbach/samba-autobuild/.git] / source3 / modules / vfs_catia.c
index 48e2e3ff9f3a8e6bf71cd08ebd49730ae001f486..524d9872133a0fe680becd62729dfc0c0afcebb3 100644 (file)
@@ -590,22 +590,35 @@ static int catia_rmdir(vfs_handle_struct *handle,
 }
 
 static int catia_mkdir(vfs_handle_struct *handle,
 }
 
 static int catia_mkdir(vfs_handle_struct *handle,
-                      const char *path,
+                      const struct smb_filename *smb_fname,
                       mode_t mode)
 {
        char *name = NULL;
        NTSTATUS status;
        int ret;
                       mode_t mode)
 {
        char *name = NULL;
        NTSTATUS status;
        int ret;
+       struct smb_filename *catia_smb_fname = NULL;
 
 
-       status = catia_string_replace_allocate(handle->conn, path,
-                                        &name, vfs_translate_to_unix);
+       status = catia_string_replace_allocate(handle->conn,
+                               smb_fname->base_name,
+                               &name,
+                               vfs_translate_to_unix);
        if (!NT_STATUS_IS_OK(status)) {
                errno = map_errno_from_nt_status(status);
                return -1;
        }
        if (!NT_STATUS_IS_OK(status)) {
                errno = map_errno_from_nt_status(status);
                return -1;
        }
+       catia_smb_fname = synthetic_smb_fname(talloc_tos(),
+                                       name,
+                                       NULL,
+                                       NULL);
+       if (catia_smb_fname == NULL) {
+               TALLOC_FREE(name);
+               errno = ENOMEM;
+               return -1;
+       }
 
 
-       ret = SMB_VFS_NEXT_MKDIR(handle, name, mode);
+       ret = SMB_VFS_NEXT_MKDIR(handle, catia_smb_fname, mode);
        TALLOC_FREE(name);
        TALLOC_FREE(name);
+       TALLOC_FREE(catia_smb_fname);
 
        return ret;
 }
 
        return ret;
 }