From: Ralph Boehme Date: Mon, 14 Jan 2019 12:51:23 +0000 (+0100) Subject: s3:smbd: perform impersonation in dos_mode_at_vfs_get_dosmode_done() X-Git-Tag: talloc-2.1.15~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=75e2e242de83fc880b91dacdc7622e646b05b1a0;p=thirdparty%2Fsamba.git s3:smbd: perform impersonation in dos_mode_at_vfs_get_dosmode_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/dosmode.c b/source3/smbd/dosmode.c index 177fe68c894..a4625718a56 100644 --- a/source3/smbd/dosmode.c +++ b/source3/smbd/dosmode.c @@ -811,6 +811,13 @@ static void dos_mode_at_vfs_get_dosmode_done(struct tevent_req *subreq) struct smb_filename *smb_path = NULL; struct vfs_aio_state aio_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 = SMB_VFS_GET_DOS_ATTRIBUTES_RECV(subreq, &aio_state,