From: Ralph Boehme Date: Mon, 14 Jan 2019 12:51:23 +0000 (+0100) Subject: s3:smbd: perform impersonation in smb2_query_directory_dos_mode_done() X-Git-Tag: talloc-2.1.15~19 X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=c6728403b07361a276078a264c576edeebd92abf;p=samba.git s3:smbd: perform impersonation in smb2_query_directory_dos_mode_done() This is needed as the callback might be called in an arbitrary impersonation state. Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/smb2_query_directory.c b/source3/smbd/smb2_query_directory.c index fdb87188f93..2a426a0dfa3 100644 --- a/source3/smbd/smb2_query_directory.c +++ b/source3/smbd/smb2_query_directory.c @@ -752,6 +752,13 @@ static void smb2_query_directory_dos_mode_done(struct tevent_req *subreq) tevent_req_data(req, struct smbd_smb2_query_directory_state); NTSTATUS status; + bool ok; + + /* + * Make sure we run as the user again + */ + ok = change_to_user_by_fsp(state->fsp); + SMB_ASSERT(ok); status = fetch_dos_mode_recv(subreq); TALLOC_FREE(subreq);