]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: torture: In cmd_getxattr(), SMB_VFS_GETXATTR() -> SMB_VFS_FGETXATTR().
authorJeremy Allison <jra@samba.org>
Tue, 22 Jun 2021 18:47:25 +0000 (11:47 -0700)
committerRalph Boehme <slow@samba.org>
Fri, 25 Jun 2021 15:53:31 +0000 (15:53 +0000)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/torture/cmd_vfs.c

index d1b15ac64358198d1db2dc25983e58b172fafaf9..a2bece1f5dd4858e67e43c98e4c0f215abc87111 100644 (file)
@@ -1370,6 +1370,8 @@ static NTSTATUS cmd_getxattr(struct vfs_state *vfs, TALLOC_CTX *mem_ctx,
        uint8_t *buf;
        ssize_t ret;
        struct smb_filename *smb_fname = NULL;
+       struct smb_filename *pathref_fname = NULL;
+       NTSTATUS status;
 
        if (argc != 3) {
                printf("Usage: getxattr <path> <xattr>\n");
@@ -1384,8 +1386,21 @@ static NTSTATUS cmd_getxattr(struct vfs_state *vfs, TALLOC_CTX *mem_ctx,
        if (smb_fname == NULL) {
                return NT_STATUS_NO_MEMORY;
        }
-       ret = SMB_VFS_GETXATTR(vfs->conn, smb_fname, argv[2], buf,
-                              talloc_get_size(buf));
+       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_FGETXATTR(pathref_fname->fsp,
+                               argv[2],
+                               buf,
+                               talloc_get_size(buf));
        if (ret == -1) {
                int err = errno;
                printf("getxattr returned (%s)\n", strerror(err));
@@ -1395,8 +1410,10 @@ static NTSTATUS cmd_getxattr(struct vfs_state *vfs, TALLOC_CTX *mem_ctx,
        if (buf == NULL) {
                return NT_STATUS_NO_MEMORY;
        }
-       ret = SMB_VFS_GETXATTR(vfs->conn, smb_fname, argv[2], buf,
-                              talloc_get_size(buf));
+       ret = SMB_VFS_FGETXATTR(pathref_fname->fsp,
+                               argv[2],
+                               buf,
+                               talloc_get_size(buf));
        if (ret == -1) {
                int err = errno;
                printf("getxattr returned (%s)\n", strerror(err));