summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-08-31 01:16:50 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:58:26 -0500
commit91e645b6d73a6ad9593b5dcdb78937573d48d0d3 (patch)
treed30a7856a87cd09fb55c8b5defa9004532b75ea5
parent1fc55db7339fc6425d6c8e1abdddcdd56bf33733 (diff)
downloadsamba-91e645b6d73a6ad9593b5dcdb78937573d48d0d3.tar.gz
samba-91e645b6d73a6ad9593b5dcdb78937573d48d0d3.tar.bz2
samba-91e645b6d73a6ad9593b5dcdb78937573d48d0d3.zip
r2118: fixed the receipt of bigendian rpc packets with the new async code.
The fix uses the new talloc_increase_ref_count() function in an interesting way. I suspect this sort of technique will become quite common. (This used to be commit a86e629a39baf0ba2a6bb347eb9b72551c1477ff)
-rw-r--r--source4/librpc/rpc/dcerpc.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/source4/librpc/rpc/dcerpc.c b/source4/librpc/rpc/dcerpc.c
index 61e5c1c8b2..ae56213919 100644
--- a/source4/librpc/rpc/dcerpc.c
+++ b/source4/librpc/rpc/dcerpc.c
@@ -694,7 +694,7 @@ static void dcerpc_request_recv_data(struct dcerpc_pipe *p,
/*
- perform a full request/response pair on a dcerpc pipe
+ perform the send size of a async dcerpc request
*/
struct rpc_request *dcerpc_request_send(struct dcerpc_pipe *p,
uint16_t opnum,
@@ -805,7 +805,7 @@ struct event_context *dcerpc_event_context(struct dcerpc_pipe *p)
/*
- perform a full request/response pair on a dcerpc pipe
+ perform the receive side of a async dcerpc request
*/
NTSTATUS dcerpc_request_recv(struct rpc_request *req,
TALLOC_CTX *mem_ctx,
@@ -1071,13 +1071,20 @@ NTSTATUS dcerpc_ndr_request_recv(struct rpc_request *req)
DATA_BLOB response;
struct ndr_pull *pull;
struct rpc_request_ndr ndr = req->ndr;
- uint_t flags = req->flags;
+ uint_t flags;
+
+ /* make sure the recv code doesn't free the request, as we
+ need to grab the flags element before it is freed */
+ talloc_increase_ref_count(req);
status = dcerpc_request_recv(req, ndr.mem_ctx, &response);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
+ flags = req->flags;
+ talloc_free(req);
+
/* prepare for ndr_pull_* */
pull = ndr_pull_init_blob(&response, ndr.mem_ctx);
if (!pull) {