From: Stefan Metzmacher Date: Wed, 12 Oct 2022 12:15:53 +0000 (+0200) Subject: smbXsrv_client: make sure we only wait for smb2srv_client_mc_negprot_filter once... X-Git-Tag: talloc-2.4.0~730 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8c8d8cf01e01c2726d03fa1c81e0ce9992ee736c;p=thirdparty%2Fsamba.git smbXsrv_client: make sure we only wait for smb2srv_client_mc_negprot_filter once and only when needed This will simplify the following changes... BUG: https://bugzilla.samba.org/show_bug.cgi?id=15200 Signed-off-by: Stefan Metzmacher Reviewed-by: Ralph Boehme --- diff --git a/source3/smbd/smbXsrv_client.c b/source3/smbd/smbXsrv_client.c index ba0a96d75dc..2d9938606f3 100644 --- a/source3/smbd/smbXsrv_client.c +++ b/source3/smbd/smbXsrv_client.c @@ -471,6 +471,7 @@ struct smb2srv_client_mc_negprot_state { struct db_record *db_rec; uint64_t watch_instance; uint32_t last_seqnum; + struct tevent_req *filter_subreq; }; static void smb2srv_client_mc_negprot_cleanup(struct tevent_req *req, @@ -534,6 +535,7 @@ static void smb2srv_client_mc_negprot_next(struct tevent_req *req) NTSTATUS status; uint32_t seqnum = 0; + TALLOC_FREE(state->filter_subreq); SMB_ASSERT(state->db_rec == NULL); state->db_rec = smbXsrv_client_global_fetch_locked(table->global.db_ctx, &client_guid, @@ -610,6 +612,7 @@ static void smb2srv_client_mc_negprot_next(struct tevent_req *req) return; } tevent_req_set_callback(subreq, smb2srv_client_mc_negprot_done, req); + state->filter_subreq = subreq; } if (procid_is_local(&global->server_id)) { @@ -692,6 +695,9 @@ static void smb2srv_client_mc_negprot_done(struct tevent_req *subreq) NTSTATUS status; int ret; + SMB_ASSERT(state->filter_subreq == subreq); + state->filter_subreq = NULL; + ret = messaging_filtered_read_recv(subreq, state, &rec); TALLOC_FREE(subreq); if (ret != 0) {