diff options
author | Stefan Metzmacher <metze@samba.org> | 2012-08-24 08:29:21 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2012-08-25 01:39:41 +0200 |
commit | 89a5a7165469da35f0f6c87c4c34579aa4f75531 (patch) | |
tree | b4a084ffe213be2d73d48ed531f154b219ecb63e /source4/librpc/rpc | |
parent | 0bd0ad967d1b5f82cbbd2df8fcb8a54d1ed5db40 (diff) | |
download | samba-89a5a7165469da35f0f6c87c4c34579aa4f75531.tar.gz samba-89a5a7165469da35f0f6c87c4c34579aa4f75531.tar.bz2 samba-89a5a7165469da35f0f6c87c4c34579aa4f75531.zip |
s4:librpc/rpc: don't do async requests if gensec doesn't support async replies (bug #9097)
metze
Diffstat (limited to 'source4/librpc/rpc')
-rw-r--r-- | source4/librpc/rpc/dcerpc.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/source4/librpc/rpc/dcerpc.c b/source4/librpc/rpc/dcerpc.c index 331a6b018e..4440395e94 100644 --- a/source4/librpc/rpc/dcerpc.c +++ b/source4/librpc/rpc/dcerpc.c @@ -60,6 +60,7 @@ struct rpc_request { uint16_t opnum; DATA_BLOB request_data; bool ignore_timeout; + bool wait_for_sync; /* use by the ndr level async recv call */ struct { @@ -1535,6 +1536,7 @@ static void dcerpc_ship_next_request(struct dcecli_connection *c) bool first_packet = true; size_t sig_size = 0; bool need_async = false; + bool can_async = true; req = c->request_queue; if (req == NULL) { @@ -1548,6 +1550,32 @@ static void dcerpc_ship_next_request(struct dcecli_connection *c) need_async = true; } + if (c->security_state.auth_info && + c->security_state.generic_state) + { + struct gensec_security *gensec = c->security_state.generic_state; + + switch (c->security_state.auth_info->auth_level) { + case DCERPC_AUTH_LEVEL_PRIVACY: + case DCERPC_AUTH_LEVEL_INTEGRITY: + can_async = gensec_have_feature(gensec, + GENSEC_FEATURE_ASYNC_REPLIES); + break; + case DCERPC_AUTH_LEVEL_CONNECT: + case DCERPC_AUTH_LEVEL_NONE: + can_async = true; + break; + default: + can_async = false; + break; + } + } + + if (need_async && !can_async) { + req->wait_for_sync = true; + return; + } + DLIST_REMOVE(c->request_queue, req); DLIST_ADD(c->pending, req); req->state = RPC_REQUEST_PENDING; @@ -1662,6 +1690,10 @@ static void dcerpc_schedule_io_trigger(struct dcecli_connection *c) return; } + if (c->request_queue->wait_for_sync && c->pending) { + return; + } + if (c->io_trigger_pending) { return; } |