summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2021-06-22 11:47:25 -0700
committerRalph Boehme <slow@samba.org>2021-06-25 15:53:31 +0000
commitff09fc77a21dd8baa75e64037b4cbdfc841ffb78 (patch)
treecd86613c3e80e8727e71795228116ea2ac01f132 /source3
parent198413da763ee652dad65a430962031be974b51c (diff)
downloadsamba-ff09fc77a21dd8baa75e64037b4cbdfc841ffb78.tar.gz
s3: torture: In cmd_getxattr(), SMB_VFS_GETXATTR() -> SMB_VFS_FGETXATTR().
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/torture/cmd_vfs.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/source3/torture/cmd_vfs.c b/source3/torture/cmd_vfs.c
index d1b15ac6435..a2bece1f5dd 100644
--- a/source3/torture/cmd_vfs.c
+++ b/source3/torture/cmd_vfs.c
@@ -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));