summaryrefslogtreecommitdiff
path: root/source4/librpc/rpc/dcerpc_auth.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2012-03-13 15:37:49 +0100
committerStefan Metzmacher <metze@samba.org>2012-03-15 07:35:28 +0100
commit198c5ace6f9a7d1b1f99473168b0b5b1d191f355 (patch)
tree9790ea4e717711f8ccf91d5ce0d88af3a758f654 /source4/librpc/rpc/dcerpc_auth.c
parent6b81d71f3e0ae89bf1352ea469446a902613de01 (diff)
downloadsamba-198c5ace6f9a7d1b1f99473168b0b5b1d191f355.tar.gz
samba-198c5ace6f9a7d1b1f99473168b0b5b1d191f355.tar.bz2
samba-198c5ace6f9a7d1b1f99473168b0b5b1d191f355.zip
s4:librpc/rpc: convert dcerpc_alter_context_send/recv to tevent_req
Many thanks to Andrew Bartlett <abartlet@samba.org> for the debugging, which lead to the following line: talloc_steal(state, raw_packet->data); metze
Diffstat (limited to 'source4/librpc/rpc/dcerpc_auth.c')
-rw-r--r--source4/librpc/rpc/dcerpc_auth.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/source4/librpc/rpc/dcerpc_auth.c b/source4/librpc/rpc/dcerpc_auth.c
index 7af85aaab1..f119b426d9 100644
--- a/source4/librpc/rpc/dcerpc_auth.c
+++ b/source4/librpc/rpc/dcerpc_auth.c
@@ -129,13 +129,13 @@ struct bind_auth_state {
* first bind itself received? */
};
-static void bind_auth_recv_alter(struct composite_context *creq);
+static void bind_auth_recv_alter(struct tevent_req *subreq);
static void bind_auth_next_step(struct composite_context *c)
{
struct bind_auth_state *state;
struct dcecli_security *sec;
- struct composite_context *creq;
+ struct tevent_req *subreq;
bool more_processing = false;
state = talloc_get_type(c->private_data, struct bind_auth_state);
@@ -188,23 +188,25 @@ static void bind_auth_next_step(struct composite_context *c)
/* We are demanding a reply, so use a request that will get us one */
- creq = dcerpc_alter_context_send(state->pipe, state,
- &state->pipe->syntax,
- &state->pipe->transfer_syntax);
+ subreq = dcerpc_alter_context_send(state, state->pipe->conn->event_ctx,
+ state->pipe,
+ &state->pipe->syntax,
+ &state->pipe->transfer_syntax);
data_blob_free(&state->credentials);
sec->auth_info->credentials = data_blob(NULL, 0);
- if (composite_nomem(creq, c)) return;
-
- composite_continue(c, creq, bind_auth_recv_alter, c);
+ if (composite_nomem(subreq, c)) return;
+ tevent_req_set_callback(subreq, bind_auth_recv_alter, c);
}
-static void bind_auth_recv_alter(struct composite_context *creq)
+static void bind_auth_recv_alter(struct tevent_req *subreq)
{
- struct composite_context *c = talloc_get_type(creq->async.private_data,
- struct composite_context);
+ struct composite_context *c =
+ tevent_req_callback_data(subreq,
+ struct composite_context);
- c->status = dcerpc_alter_context_recv(creq);
+ c->status = dcerpc_alter_context_recv(subreq);
+ TALLOC_FREE(subreq);
if (!composite_is_ok(c)) return;
bind_auth_next_step(c);