]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: VFS: default. In vfswrap_getxattrat_do_async() always use the pathref fsp.
authorJeremy Allison <jra@samba.org>
Wed, 14 Jul 2021 18:23:54 +0000 (11:23 -0700)
committerRalph Boehme <slow@samba.org>
Thu, 15 Jul 2021 05:48:04 +0000 (05:48 +0000)
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 <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu Jul 15 05:48:05 UTC 2021 on sn-devel-184

source3/modules/vfs_default.c

index cb50342ce679c6dc5ef304d87975a09f9a609b80..aa7dfe3192f8fcca88c198a9d448b8b4550d48ca 100644 (file)
@@ -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;
        }