From: Jeremy Allison Date: Wed, 14 Jul 2021 18:23:54 +0000 (-0700) Subject: s3: VFS: default. In vfswrap_getxattrat_do_async() always use the pathref fsp. X-Git-Tag: samba-4.15.0rc1~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=447c9380dcb2dac20512d20833f611399fc54ef1;p=thirdparty%2Fsamba.git s3: VFS: default. In vfswrap_getxattrat_do_async() always use the pathref fsp. This is always called via a path that mandates smb_fname->fsp is valid. https://bugzilla.samba.org/show_bug.cgi?id=14758 Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme Autobuild-User(master): Ralph Böhme Autobuild-Date(master): Thu Jul 15 05:48:05 UTC 2021 on sn-devel-184 --- diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index cb50342ce67..aa7dfe3192f 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -3636,6 +3636,11 @@ static void vfswrap_getxattrat_do_async(void *private_data) struct timespec start_time; struct timespec end_time; int ret; + struct files_struct *fsp = state->smb_fname->fsp; + + if (fsp->base_fsp != NULL) { + fsp = fsp->base_fsp; + } PROFILE_TIMESTAMP(&start_time); SMBPROFILE_BYTES_ASYNC_SET_BUSY(state->profile_bytes); @@ -3658,17 +3663,11 @@ static void vfswrap_getxattrat_do_async(void *private_data) goto end_profile; } - ret = fchdir(fsp_get_pathref_fd(state->dir_fsp)); - if (ret == -1) { - state->xattr_size = -1; - state->vfs_aio_state.error = errno; - goto end_profile; - } - - state->xattr_size = getxattr(state->name, - state->xattr_name, - state->xattr_value, - talloc_array_length(state->xattr_value)); + state->xattr_size = vfswrap_fgetxattr(state->handle, + fsp, + state->xattr_name, + state->xattr_value, + talloc_array_length(state->xattr_value)); if (state->xattr_size == -1) { state->vfs_aio_state.error = errno; }