summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2010-02-27 10:00:42 +0100
committerStefan Metzmacher <metze@samba.org>2010-03-01 16:11:57 +0100
commit56b97000bd7842d3b861656880b68ad333594d71 (patch)
tree2fd82b9b98ecbd5689a887261e04add2c1469161
parent0547af244a46e5647eb7dfc9b4a92924d15ab15d (diff)
downloadsamba-56b97000bd7842d3b861656880b68ad333594d71.tar.gz
samba-56b97000bd7842d3b861656880b68ad333594d71.tar.bz2
samba-56b97000bd7842d3b861656880b68ad333594d71.zip
s4:libnet_become_dc: don't look at the internals of 'struct rpc_request'
metze
-rw-r--r--source4/libnet/libnet_become_dc.c28
1 files changed, 21 insertions, 7 deletions
diff --git a/source4/libnet/libnet_become_dc.c b/source4/libnet/libnet_become_dc.c
index 51246881e9..45a3d04ab1 100644
--- a/source4/libnet/libnet_become_dc.c
+++ b/source4/libnet/libnet_become_dc.c
@@ -710,6 +710,8 @@ struct libnet_BecomeDC_state {
struct policy_handle bind_handle;
} drsuapi1, drsuapi2, drsuapi3;
+ void *ndr_struct_ptr;
+
struct libnet_BecomeDC_Domain domain;
struct libnet_BecomeDC_Forest forest;
struct libnet_BecomeDC_SourceDSA source_dsa;
@@ -2245,6 +2247,7 @@ static void becomeDC_drsuapi1_add_entry_send(struct libnet_BecomeDC_state *s)
r->out.level_out = talloc(s, int32_t);
r->out.ctr = talloc(s, union drsuapi_DsAddEntryCtr);
+ s->ndr_struct_ptr = r;
req = dcerpc_drsuapi_DsAddEntry_send(s->drsuapi1.pipe, r, r);
composite_continue_rpc(c, req, becomeDC_drsuapi1_add_entry_recv, s);
}
@@ -2257,10 +2260,11 @@ static void becomeDC_drsuapi1_add_entry_recv(struct rpc_request *req)
struct libnet_BecomeDC_state *s = talloc_get_type(req->async.private_data,
struct libnet_BecomeDC_state);
struct composite_context *c = s->creq;
- struct drsuapi_DsAddEntry *r = talloc_get_type(req->ndr.struct_ptr,
+ struct drsuapi_DsAddEntry *r = talloc_get_type_abort(s->ndr_struct_ptr,
struct drsuapi_DsAddEntry);
char *binding_str;
+ s->ndr_struct_ptr = NULL;
c->status = dcerpc_drsuapi_DsAddEntry_recv(req);
if (!composite_is_ok(c)) return;
@@ -2484,6 +2488,7 @@ static void becomeDC_drsuapi_pull_partition_send(struct libnet_BecomeDC_state *s
* are needed for it. Or the same KRB5 TGS is needed on both
* connections.
*/
+ s->ndr_struct_ptr = r;
req = dcerpc_drsuapi_DsGetNCChanges_send(drsuapi_p->pipe, r, r);
composite_continue_rpc(c, req, recv_fn, s);
}
@@ -2620,10 +2625,11 @@ static void becomeDC_drsuapi3_pull_schema_recv(struct rpc_request *req)
struct libnet_BecomeDC_state *s = talloc_get_type(req->async.private_data,
struct libnet_BecomeDC_state);
struct composite_context *c = s->creq;
- struct drsuapi_DsGetNCChanges *r = talloc_get_type(req->ndr.struct_ptr,
+ struct drsuapi_DsGetNCChanges *r = talloc_get_type_abort(s->ndr_struct_ptr,
struct drsuapi_DsGetNCChanges);
WERROR status;
+ s->ndr_struct_ptr = NULL;
c->status = dcerpc_drsuapi_DsGetNCChanges_recv(req);
if (!composite_is_ok(c)) return;
@@ -2676,10 +2682,11 @@ static void becomeDC_drsuapi3_pull_config_recv(struct rpc_request *req)
struct libnet_BecomeDC_state *s = talloc_get_type(req->async.private_data,
struct libnet_BecomeDC_state);
struct composite_context *c = s->creq;
- struct drsuapi_DsGetNCChanges *r = talloc_get_type(req->ndr.struct_ptr,
+ struct drsuapi_DsGetNCChanges *r = talloc_get_type_abort(s->ndr_struct_ptr,
struct drsuapi_DsGetNCChanges);
WERROR status;
+ s->ndr_struct_ptr = NULL;
c->status = dcerpc_drsuapi_DsGetNCChanges_recv(req);
if (!composite_is_ok(c)) return;
@@ -2738,10 +2745,11 @@ static void becomeDC_drsuapi3_pull_domain_recv(struct rpc_request *req)
struct libnet_BecomeDC_state *s = talloc_get_type(req->async.private_data,
struct libnet_BecomeDC_state);
struct composite_context *c = s->creq;
- struct drsuapi_DsGetNCChanges *r = talloc_get_type(req->ndr.struct_ptr,
+ struct drsuapi_DsGetNCChanges *r = talloc_get_type_abort(s->ndr_struct_ptr,
struct drsuapi_DsGetNCChanges);
WERROR status;
+ s->ndr_struct_ptr = NULL;
c->status = dcerpc_drsuapi_DsGetNCChanges_recv(req);
if (!composite_is_ok(c)) return;
@@ -2798,6 +2806,7 @@ static void becomeDC_drsuapi_update_refs_send(struct libnet_BecomeDC_state *s,
r->in.req.req1.options |= DRSUAPI_DRS_WRIT_REP;
}
+ s->ndr_struct_ptr = r;
req = dcerpc_drsuapi_DsReplicaUpdateRefs_send(drsuapi->pipe, r, r);
composite_continue_rpc(c, req, recv_fn, s);
}
@@ -2809,9 +2818,10 @@ static void becomeDC_drsuapi2_update_refs_schema_recv(struct rpc_request *req)
struct libnet_BecomeDC_state *s = talloc_get_type(req->async.private_data,
struct libnet_BecomeDC_state);
struct composite_context *c = s->creq;
- struct drsuapi_DsReplicaUpdateRefs *r = talloc_get_type(req->ndr.struct_ptr,
+ struct drsuapi_DsReplicaUpdateRefs *r = talloc_get_type_abort(s->ndr_struct_ptr,
struct drsuapi_DsReplicaUpdateRefs);
+ s->ndr_struct_ptr = NULL;
c->status = dcerpc_drsuapi_DsReplicaUpdateRefs_recv(req);
if (!composite_is_ok(c)) return;
@@ -2834,9 +2844,11 @@ static void becomeDC_drsuapi2_update_refs_config_recv(struct rpc_request *req)
struct libnet_BecomeDC_state *s = talloc_get_type(req->async.private_data,
struct libnet_BecomeDC_state);
struct composite_context *c = s->creq;
- struct drsuapi_DsReplicaUpdateRefs *r = talloc_get_type(req->ndr.struct_ptr,
+ struct drsuapi_DsReplicaUpdateRefs *r = talloc_get_type(s->ndr_struct_ptr,
struct drsuapi_DsReplicaUpdateRefs);
+ s->ndr_struct_ptr = NULL;
+
c->status = dcerpc_drsuapi_DsReplicaUpdateRefs_recv(req);
if (!composite_is_ok(c)) return;
@@ -2856,9 +2868,11 @@ static void becomeDC_drsuapi2_update_refs_domain_recv(struct rpc_request *req)
struct libnet_BecomeDC_state *s = talloc_get_type(req->async.private_data,
struct libnet_BecomeDC_state);
struct composite_context *c = s->creq;
- struct drsuapi_DsReplicaUpdateRefs *r = talloc_get_type(req->ndr.struct_ptr,
+ struct drsuapi_DsReplicaUpdateRefs *r = talloc_get_type(s->ndr_struct_ptr,
struct drsuapi_DsReplicaUpdateRefs);
+ s->ndr_struct_ptr = NULL;
+
c->status = dcerpc_drsuapi_DsReplicaUpdateRefs_recv(req);
if (!composite_is_ok(c)) return;