From: Stefan Metzmacher Date: Wed, 4 Sep 2019 10:47:07 +0000 (+0200) Subject: s3:smb2_lock: call change_to_user_by_fsp() when dbwrap_watched_watch* finishes X-Git-Tag: talloc-2.3.1~981 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8b565de1acb0fda121cb0bd4cff42d66ee027529;p=thirdparty%2Fsamba.git s3:smb2_lock: 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/smb2_lock.c b/source3/smbd/smb2_lock.c index 36ec36301b1..e9c8d7f890e 100644 --- a/source3/smbd/smb2_lock.c +++ b/source3/smbd/smb2_lock.c @@ -421,6 +421,16 @@ static void smbd_smb2_lock_retry(struct tevent_req *subreq) struct server_id blocking_pid = { 0 }; uint64_t blocking_smblctx; 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);