vfs_unityed_media: support real dirfsps in um_unlinkat()
authorRalph Boehme <slow@samba.org>
Wed, 20 Jan 2021 14:20:15 +0000 (15:20 +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_unityed_media.c

index 7901b2390d77cf60798c805f6c45fbb9d61244af..4ad2d2bb6564945ea09d1da75442d675e527c32b 100644 (file)
@@ -1117,6 +1117,7 @@ static int um_unlinkat(vfs_handle_struct *handle,
                        int flags)
 {
        int ret;
+       struct smb_filename *full_fname = NULL;
        struct smb_filename *client_fname = NULL;
 
        DEBUG(10, ("Entering um_unlinkat\n"));
@@ -1128,19 +1129,27 @@ static int um_unlinkat(vfs_handle_struct *handle,
                                flags);
        }
 
+       full_fname = full_path_from_dirfsp_atname(talloc_tos(),
+                                                 dirfsp,
+                                                 smb_fname);
+       if (full_fname == NULL) {
+               return -1;
+       }
+
        ret = alloc_get_client_smb_fname(handle, talloc_tos(),
-                                           smb_fname,
+                                           full_fname,
                                            &client_fname);
        if (ret != 0) {
                goto err;
        }
 
        ret = SMB_VFS_NEXT_UNLINKAT(handle,
-                               dirfsp,
+                               dirfsp->conn->cwd_fsp,
                                client_fname,
                                flags);
 
 err:
+       TALLOC_FREE(full_fname);
        TALLOC_FREE(client_fname);
        return ret;
 }