s4:librpc: restore inhibit_timeout_processing = true during gensec_update_send/recv()
authorStefan Metzmacher <metze@samba.org>
Mon, 29 May 2017 07:37:09 +0000 (09:37 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 30 May 2017 06:06:07 +0000 (08:06 +0200)
As not all gensec backends are fully async yet, we need the
inhibit_timeout_processing workarround in order to protect
against nested event loops.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/librpc/rpc/dcerpc_auth.c

index a2d1418ea14471c54529ac08b67d29670b2027ed..ea222c2706f7adecd7d97893f2ba0223788dc30b 100644 (file)
@@ -187,6 +187,9 @@ static void bind_auth_next_step(struct composite_context *c)
         * it doesn't like that either
         */
 
+       state->pipe->inhibit_timeout_processing = true;
+       state->pipe->timed_out = false;
+
        subreq = gensec_update_send(state,
                                    state->pipe->conn->event_ctx,
                                    sec->generic_state,
@@ -207,6 +210,8 @@ static void bind_auth_next_gensec_done(struct tevent_req *subreq)
        struct dcecli_security *sec = &p->conn->security_state;
        bool more_processing = false;
 
+       state->pipe->inhibit_timeout_processing = false;
+
        c->status = gensec_update_recv(subreq, state,
                                       &state->out_auth_info.credentials);
        TALLOC_FREE(subreq);
@@ -434,6 +439,9 @@ struct composite_context *dcerpc_bind_auth_send(TALLOC_CTX *mem_ctx,
         * it doesn't like that either
         */
 
+       state->pipe->inhibit_timeout_processing = true;
+       state->pipe->timed_out = false;
+
        subreq = gensec_update_send(state,
                                    p->conn->event_ctx,
                                    sec->generic_state,
@@ -455,6 +463,8 @@ static void dcerpc_bind_auth_gensec_done(struct tevent_req *subreq)
        struct dcerpc_pipe *p = state->pipe;
        struct dcecli_security *sec = &p->conn->security_state;
 
+       state->pipe->inhibit_timeout_processing = false;
+
        c->status = gensec_update_recv(subreq, state,
                                       &state->out_auth_info.credentials);
        TALLOC_FREE(subreq);