summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalph Boehme <slow@samba.org>2019-01-14 13:51:23 +0100
committerJeremy Allison <jra@samba.org>2019-01-14 19:13:14 +0100
commit0b7c6d500991afebf15c5c6d9bb256ff234076de (patch)
tree29cdc4e9b86196339ef0e3b85cc97e1399c8ed81
parent333a180b6a550ae7422c1199a515095c42ff1738 (diff)
downloadsamba-0b7c6d500991afebf15c5c6d9bb256ff234076de.tar.gz
vfs: perform impersonation in smb_vfs_call_getxattrat_done()
This is needed as the callback might be called in an arbitrary impersonation state. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r--source3/smbd/vfs.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c
index d31610f8ebb..d3bb9c5d63f 100644
--- a/source3/smbd/vfs.c
+++ b/source3/smbd/vfs.c
@@ -2659,6 +2659,7 @@ ssize_t smb_vfs_call_getxattr(struct vfs_handle_struct *handle,
struct smb_vfs_call_getxattrat_state {
+ files_struct *dir_fsp;
ssize_t (*recv_fn)(struct tevent_req *req,
struct vfs_aio_state *aio_state,
TALLOC_CTX *mem_ctx,
@@ -2692,6 +2693,7 @@ struct tevent_req *smb_vfs_call_getxattrat_send(
VFS_FIND(getxattrat_send);
*state = (struct smb_vfs_call_getxattrat_state) {
+ .dir_fsp = dir_fsp,
.recv_fn = handle->fns->getxattrat_recv_fn,
};
@@ -2717,6 +2719,13 @@ static void smb_vfs_call_getxattrat_done(struct tevent_req *subreq)
subreq, struct tevent_req);
struct smb_vfs_call_getxattrat_state *state = tevent_req_data(
req, struct smb_vfs_call_getxattrat_state);
+ bool ok;
+
+ /*
+ * Make sure we run as the user again
+ */
+ ok = change_to_user_by_fsp(state->dir_fsp);
+ SMB_ASSERT(ok);
state->retval = state->recv_fn(subreq,
&state->aio_state,