diff options
author | Ralph Boehme <slow@samba.org> | 2019-01-14 13:51:23 +0100 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2019-01-14 19:13:14 +0100 |
commit | 2720d95d1fd921ae43c881369d10ea6ada499690 (patch) | |
tree | 1ee0b285da83637c9700221ab7eb69a1a8b439b6 /source3/smbd/vfs.c | |
parent | 3672f02e4769da244d5c2ba82b46921a88fa9472 (diff) | |
download | samba-2720d95d1fd921ae43c881369d10ea6ada499690.tar.gz |
vfs: perform impersonation in smb_vfs_call_get_dos_attributes_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>
Diffstat (limited to 'source3/smbd/vfs.c')
-rw-r--r-- | source3/smbd/vfs.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c index 6d304f068de..2910128ccf6 100644 --- a/source3/smbd/vfs.c +++ b/source3/smbd/vfs.c @@ -2382,6 +2382,7 @@ NTSTATUS smb_vfs_call_offload_write_recv(struct vfs_handle_struct *handle, } struct smb_vfs_call_get_dos_attributes_state { + files_struct *dir_fsp; NTSTATUS (*recv_fn)(struct tevent_req *req, struct vfs_aio_state *aio_state, uint32_t *dosmode); @@ -2411,6 +2412,7 @@ struct tevent_req *smb_vfs_call_get_dos_attributes_send( VFS_FIND(get_dos_attributes_send); *state = (struct smb_vfs_call_get_dos_attributes_state) { + .dir_fsp = dir_fsp, .recv_fn = handle->fns->get_dos_attributes_recv_fn, }; @@ -2440,6 +2442,13 @@ static void smb_vfs_call_get_dos_attributes_done(struct tevent_req *subreq) tevent_req_data(req, struct smb_vfs_call_get_dos_attributes_state); NTSTATUS status; + bool ok; + + /* + * Make sure we run as the user again + */ + ok = change_to_user_by_fsp(state->dir_fsp); + SMB_ASSERT(ok); status = state->recv_fn(subreq, &state->aio_state, |