From: Stefan Metzmacher Date: Wed, 4 Sep 2019 10:50:06 +0000 (+0200) Subject: s3:blocking: call change_to_user_by_fsp() when dbwrap_watched_watch* finishes X-Git-Tag: talloc-2.3.1~982 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=28ac2cbaf92a8619f0380f024c5a220d9fdc4622;p=thirdparty%2Fsamba.git s3:blocking: call change_to_user_by_fsp() when dbwrap_watched_watch* finishes This is not strictly required as fd-based calls are used, but it's more consistent to call SMB_VFS_BRL_LOCK_WINDOWS() in the same environment on retry. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113 Signed-off-by: Stefan Metzmacher Reviewed-by: Volker Lendecke --- diff --git a/source3/smbd/blocking.c b/source3/smbd/blocking.c index ffc3142b74c..ca8a625ba9d 100644 --- a/source3/smbd/blocking.c +++ b/source3/smbd/blocking.c @@ -334,6 +334,15 @@ static void smbd_smb1_do_locks_retry(struct tevent_req *subreq) NTSTATUS status; bool ok; + /* + * Make sure we run as the user again + */ + ok = change_to_user_by_fsp(state->fsp); + if (!ok) { + tevent_req_nterror(req, NT_STATUS_ACCESS_DENIED); + return; + } + status = dbwrap_watched_watch_recv(subreq, NULL, NULL); TALLOC_FREE(subreq);