summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2021-06-22 13:47:46 -0700
committerRalph Boehme <slow@samba.org>2021-06-25 15:53:31 +0000
commitcacce8babf989b51eebb9194f5b57bef3634de67 (patch)
tree490596a7812048a892ca85895d2ceae70dcfba70 /source3
parent520a78d97527b313bae0f7596d713e6e8ab00360 (diff)
downloadsamba-cacce8babf989b51eebb9194f5b57bef3634de67.tar.gz
s3: VFS: streams_xattr: Use fsp->base_fsp for the fsp parameter to get_xattr_size() in streams_xattr_fstat().
We no longer need the 'struct smb_filename *smb_fname_base' here. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/modules/vfs_streams_xattr.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/source3/modules/vfs_streams_xattr.c b/source3/modules/vfs_streams_xattr.c
index f64ead637a5..6095c2cfde8 100644
--- a/source3/modules/vfs_streams_xattr.c
+++ b/source3/modules/vfs_streams_xattr.c
@@ -213,7 +213,6 @@ static int streams_xattr_stat_base(vfs_handle_struct *handle,
static int streams_xattr_fstat(vfs_handle_struct *handle, files_struct *fsp,
SMB_STRUCT_STAT *sbuf)
{
- struct smb_filename *smb_fname_base = NULL;
int ret = -1;
struct stream_io *io = (struct stream_io *)
VFS_FETCH_FSP_EXTENSION(handle, fsp);
@@ -228,32 +227,16 @@ static int streams_xattr_fstat(vfs_handle_struct *handle, files_struct *fsp,
return -1;
}
- /* Create an smb_filename with stream_name == NULL. */
- smb_fname_base = synthetic_smb_fname(talloc_tos(),
- io->base,
- NULL,
- NULL,
- fsp->fsp_name->twrp,
- fsp->fsp_name->flags);
- if (smb_fname_base == NULL) {
- errno = ENOMEM;
- return -1;
- }
-
- ret = vfs_stat(handle->conn, smb_fname_base);
- *sbuf = smb_fname_base->st;
-
+ ret = SMB_VFS_NEXT_FSTAT(handle, fsp->base_fsp, sbuf);
if (ret == -1) {
- TALLOC_FREE(smb_fname_base);
return -1;
}
sbuf->st_ex_size = get_xattr_size(handle->conn,
+ fsp->base_fsp,
NULL,
- smb_fname_base,
io->xattr_name);
if (sbuf->st_ex_size == -1) {
- TALLOC_FREE(smb_fname_base);
SET_STAT_INVALID(*sbuf);
return -1;
}
@@ -266,7 +249,6 @@ static int streams_xattr_fstat(vfs_handle_struct *handle, files_struct *fsp,
sbuf->st_ex_mode |= S_IFREG;
sbuf->st_ex_blocks = sbuf->st_ex_size / STAT_ST_BLOCKSIZE + 1;
- TALLOC_FREE(smb_fname_base);
return 0;
}