/** timeout for individual rpc requests, in seconds */
uint32_t request_timeout;
+
+ /*
+ * Set for the timeout in dcerpc_pipe_connect_b_send(), to
+ * allow the timeout not to destory the stack during a nested
+ * event loop caused by gensec_update()
+ */
+ bool inhibit_timeout_processing;
+ bool timed_out;
};
/* default timeout for all rpc requests, in seconds */
* it doesn't like that either
*/
+ state->pipe->inhibit_timeout_processing = true;
+ state->pipe->timed_out = false;
+
c->status = gensec_update(sec->generic_state, state,
state->pipe->conn->event_ctx,
sec->auth_info->credentials,
&state->credentials);
+ if (state->pipe->timed_out) {
+ composite_error(c, NT_STATUS_IO_TIMEOUT);
+ return;
+ }
+ state->pipe->inhibit_timeout_processing = false;
+
data_blob_free(&sec->auth_info->credentials);
if (NT_STATUS_EQUAL(c->status, NT_STATUS_MORE_PROCESSING_REQUIRED)) {
* it doesn't like that either
*/
+ state->pipe->inhibit_timeout_processing = true;
+ state->pipe->timed_out = false;
c->status = gensec_update(sec->generic_state, state,
p->conn->event_ctx,
sec->auth_info->credentials,
&state->credentials);
+ if (state->pipe->timed_out) {
+ composite_error(c, NT_STATUS_IO_TIMEOUT);
+ return c;
+ }
+ state->pipe->inhibit_timeout_processing = false;
+
if (!NT_STATUS_IS_OK(c->status) &&
!NT_STATUS_EQUAL(c->status, NT_STATUS_MORE_PROCESSING_REQUIRED)) {
composite_error(c, c->status);
static void dcerpc_connect_timeout_handler(struct tevent_context *ev, struct tevent_timer *te,
struct timeval t, void *private_data)
{
- struct composite_context *c = talloc_get_type(private_data, struct composite_context);
- composite_error(c, NT_STATUS_IO_TIMEOUT);
+ struct composite_context *c = talloc_get_type(private_data,
+ struct composite_context);
+ struct pipe_connect_state *s = talloc_get_type(c->private_data, struct pipe_connect_state);
+ if (!s->pipe->inhibit_timeout_processing) {
+ composite_error(c, NT_STATUS_IO_TIMEOUT);
+ } else {
+ s->pipe->timed_out = true;
+ }
}
/*
s->credentials = credentials;
s->lp_ctx = lp_ctx;
- tevent_add_timer(c->event_ctx, c,
- timeval_current_ofs(DCERPC_REQUEST_TIMEOUT, 0),
- dcerpc_connect_timeout_handler, c);
+ s->pipe->timed_out = false;
+ s->pipe->inhibit_timeout_processing = false;
+
+ tevent_add_timer(c->event_ctx, s,
+ timeval_current_ofs(DCERPC_REQUEST_TIMEOUT, 0),
+ dcerpc_connect_timeout_handler, s);
switch (s->binding->transport) {
case NCA_UNKNOWN: {