]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3/torture: migrate SMB_VFS_FLISTXATTR calls to SMB_VFS_FLISTXATTR
authorNoel Power <noel.power@suse.com>
Fri, 5 Feb 2021 17:10:20 +0000 (17:10 +0000)
committerJeremy Allison <jra@samba.org>
Fri, 26 Feb 2021 21:28:33 +0000 (21:28 +0000)
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/torture/cmd_vfs.c

index b47cdea4929168066e7007c9a397a21695adf818..9b1fa1bbdfedaa347d00f90b82ab67eb51635a2a 100644 (file)
@@ -1402,7 +1402,8 @@ static NTSTATUS cmd_listxattr(struct vfs_state *vfs, TALLOC_CTX *mem_ctx,
        char *buf, *p;
        ssize_t ret;
        struct smb_filename *smb_fname = NULL;
-
+       struct smb_filename *pathref_fname = NULL;
+       NTSTATUS status;
        if (argc != 2) {
                printf("Usage: listxattr <path>\n");
                return NT_STATUS_OK;
@@ -1416,7 +1417,19 @@ static NTSTATUS cmd_listxattr(struct vfs_state *vfs, TALLOC_CTX *mem_ctx,
        if (smb_fname == NULL) {
                return NT_STATUS_NO_MEMORY;
        }
-       ret = SMB_VFS_LISTXATTR(vfs->conn, smb_fname,
+       status = synthetic_pathref(mem_ctx,
+                               vfs->conn->cwd_fsp,
+                               smb_fname->base_name,
+                               NULL,
+                               NULL,
+                               smb_fname->twrp,
+                               smb_fname->flags,
+                               &pathref_fname);
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       ret = SMB_VFS_FLISTXATTR(pathref_fname->fsp,
                                buf, talloc_get_size(buf));
        if (ret == -1) {
                int err = errno;
@@ -1427,7 +1440,7 @@ static NTSTATUS cmd_listxattr(struct vfs_state *vfs, TALLOC_CTX *mem_ctx,
        if (buf == NULL) {
                return NT_STATUS_NO_MEMORY;
        }
-       ret = SMB_VFS_LISTXATTR(vfs->conn, smb_fname,
+       ret = SMB_VFS_FLISTXATTR(pathref_fname->fsp,
                                buf, talloc_get_size(buf));
        if (ret == -1) {
                int err = errno;