summaryrefslogtreecommitdiff
path: root/source4/libnet/libnet_become_dc.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-10-19 14:27:08 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-10-19 14:27:08 +0200
commite09c0c1185b4a4ad1d28023549074875028f3e55 (patch)
tree158cd066a2dd19169748a6d94fc990953d49b6c9 /source4/libnet/libnet_become_dc.c
parent33032d591f8e39edae0ce4b35ca1b6e25f04a04b (diff)
parent085e7b0b6cc882b31c11b6d6ea7834235588e1ed (diff)
downloadsamba-e09c0c1185b4a4ad1d28023549074875028f3e55.tar.gz
samba-e09c0c1185b4a4ad1d28023549074875028f3e55.tar.bz2
samba-e09c0c1185b4a4ad1d28023549074875028f3e55.zip
Merge branch 'master' of ssh://git.samba.org/data/git/samba into crypt
Diffstat (limited to 'source4/libnet/libnet_become_dc.c')
-rw-r--r--source4/libnet/libnet_become_dc.c138
1 files changed, 72 insertions, 66 deletions
diff --git a/source4/libnet/libnet_become_dc.c b/source4/libnet/libnet_become_dc.c
index 4cbebbf6d0..6e7924248c 100644
--- a/source4/libnet/libnet_become_dc.c
+++ b/source4/libnet/libnet_become_dc.c
@@ -2173,11 +2173,15 @@ static void becomeDC_drsuapi1_add_entry_send(struct libnet_BecomeDC_state *s)
/* setup request structure */
r->in.bind_handle = &s->drsuapi1.bind_handle;
r->in.level = 2;
- r->in.req.req2.first_object.next_object = NULL;
- r->in.req.req2.first_object.object.identifier = identifier;
- r->in.req.req2.first_object.object.flags = 0x00000000;
- r->in.req.req2.first_object.object.attribute_ctr.num_attributes = num_attrs;
- r->in.req.req2.first_object.object.attribute_ctr.attributes = attrs;
+ r->in.req = talloc(s, union drsuapi_DsAddEntryRequest);
+ r->in.req->req2.first_object.next_object = NULL;
+ r->in.req->req2.first_object.object.identifier = identifier;
+ r->in.req->req2.first_object.object.flags = 0x00000000;
+ r->in.req->req2.first_object.object.attribute_ctr.num_attributes= num_attrs;
+ r->in.req->req2.first_object.object.attribute_ctr.attributes = attrs;
+
+ r->out.level_out = talloc(s, int32_t);
+ r->out.ctr = talloc(s, union drsuapi_DsAddEntryCtr);
req = dcerpc_drsuapi_DsAddEntry_send(s->drsuapi1.pipe, r, r);
composite_continue_rpc(c, req, becomeDC_drsuapi1_add_entry_recv, s);
@@ -2212,37 +2216,37 @@ static void becomeDC_drsuapi1_add_entry_recv(struct rpc_request *req)
return;
}
- if (r->out.level == 3) {
- if (r->out.ctr.ctr3.count != 1) {
+ if (*r->out.level_out == 3) {
+ if (r->out.ctr->ctr3.count != 1) {
WERROR status;
- if (r->out.ctr.ctr3.level != 1) {
+ if (r->out.ctr->ctr3.level != 1) {
composite_error(c, NT_STATUS_INVALID_NETWORK_RESPONSE);
return;
}
- if (!r->out.ctr.ctr3.error) {
+ if (!r->out.ctr->ctr3.error) {
composite_error(c, NT_STATUS_INVALID_NETWORK_RESPONSE);
return;
}
- status = r->out.ctr.ctr3.error->info1.status;
+ status = r->out.ctr->ctr3.error->info1.status;
- if (!r->out.ctr.ctr3.error->info1.info) {
+ if (!r->out.ctr->ctr3.error->info1.info) {
composite_error(c, werror_to_ntstatus(status));
return;
}
/* see if we can get a more detailed error */
- switch (r->out.ctr.ctr3.error->info1.level) {
+ switch (r->out.ctr->ctr3.error->info1.level) {
case 1:
- status = r->out.ctr.ctr3.error->info1.info->error1.status;
+ status = r->out.ctr->ctr3.error->info1.info->error1.status;
break;
case 4:
case 5:
case 6:
case 7:
- status = r->out.ctr.ctr3.error->info1.info->errorX.status;
+ status = r->out.ctr->ctr3.error->info1.info->errorX.status;
break;
}
@@ -2250,14 +2254,14 @@ static void becomeDC_drsuapi1_add_entry_recv(struct rpc_request *req)
return;
}
- s->dest_dsa.ntds_guid = r->out.ctr.ctr3.objects[0].guid;
- } else if (r->out.level == 2) {
- if (r->out.ctr.ctr2.count != 1) {
- composite_error(c, werror_to_ntstatus(r->out.ctr.ctr2.error.status));
+ s->dest_dsa.ntds_guid = r->out.ctr->ctr3.objects[0].guid;
+ } else if (*r->out.level_out == 2) {
+ if (r->out.ctr->ctr2.count != 1) {
+ composite_error(c, werror_to_ntstatus(r->out.ctr->ctr2.error.status));
return;
}
- s->dest_dsa.ntds_guid = r->out.ctr.ctr2.objects[0].guid;
+ s->dest_dsa.ntds_guid = r->out.ctr->ctr2.objects[0].guid;
} else {
composite_error(c, NT_STATUS_INVALID_NETWORK_RESPONSE);
return;
@@ -2392,40 +2396,42 @@ static void becomeDC_drsuapi_pull_partition_send(struct libnet_BecomeDC_state *s
r = talloc(s, struct drsuapi_DsGetNCChanges);
if (composite_nomem(r, c)) return;
- r->in.level = talloc(r, int32_t);
- if (composite_nomem(r->in.level, c)) return;
- r->out.level = talloc(r, int32_t);
- if (composite_nomem(r->out.level, c)) return;
+ r->out.level_out = talloc(r, int32_t);
+ if (composite_nomem(r->out.level_out, c)) return;
+ r->in.req = talloc(r, union drsuapi_DsGetNCChangesRequest);
+ if (composite_nomem(r->in.req, c)) return;
+ r->out.ctr = talloc(r, union drsuapi_DsGetNCChangesCtr);
+ if (composite_nomem(r->out.ctr, c)) return;
r->in.bind_handle = &drsuapi_h->bind_handle;
if (drsuapi_h->remote_info28.supported_extensions & DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V8) {
- *r->in.level = 8;
- r->in.req.req8.destination_dsa_guid = partition->destination_dsa_guid;
- r->in.req.req8.source_dsa_invocation_id = partition->source_dsa_invocation_id;
- r->in.req.req8.naming_context = &partition->nc;
- r->in.req.req8.highwatermark = partition->highwatermark;
- r->in.req.req8.uptodateness_vector = NULL;
- r->in.req.req8.replica_flags = partition->replica_flags;
- r->in.req.req8.max_object_count = 133;
- r->in.req.req8.max_ndr_size = 1336811;
- r->in.req.req8.extended_op = DRSUAPI_EXOP_NONE;
- r->in.req.req8.fsmo_info = 0;
- r->in.req.req8.partial_attribute_set = NULL;
- r->in.req.req8.partial_attribute_set_ex = NULL;
- r->in.req.req8.mapping_ctr.num_mappings = 0;
- r->in.req.req8.mapping_ctr.mappings = NULL;
+ r->in.level = 8;
+ r->in.req->req8.destination_dsa_guid = partition->destination_dsa_guid;
+ r->in.req->req8.source_dsa_invocation_id= partition->source_dsa_invocation_id;
+ r->in.req->req8.naming_context = &partition->nc;
+ r->in.req->req8.highwatermark = partition->highwatermark;
+ r->in.req->req8.uptodateness_vector = NULL;
+ r->in.req->req8.replica_flags = partition->replica_flags;
+ r->in.req->req8.max_object_count = 133;
+ r->in.req->req8.max_ndr_size = 1336811;
+ r->in.req->req8.extended_op = DRSUAPI_EXOP_NONE;
+ r->in.req->req8.fsmo_info = 0;
+ r->in.req->req8.partial_attribute_set = NULL;
+ r->in.req->req8.partial_attribute_set_ex= NULL;
+ r->in.req->req8.mapping_ctr.num_mappings= 0;
+ r->in.req->req8.mapping_ctr.mappings = NULL;
} else {
- *r->in.level = 5;
- r->in.req.req5.destination_dsa_guid = partition->destination_dsa_guid;
- r->in.req.req5.source_dsa_invocation_id = partition->source_dsa_invocation_id;
- r->in.req.req5.naming_context = &partition->nc;
- r->in.req.req5.highwatermark = partition->highwatermark;
- r->in.req.req5.uptodateness_vector = NULL;
- r->in.req.req5.replica_flags = partition->replica_flags;
- r->in.req.req5.max_object_count = 133;
- r->in.req.req5.max_ndr_size = 1336770;
- r->in.req.req5.extended_op = DRSUAPI_EXOP_NONE;
- r->in.req.req5.fsmo_info = 0;
+ r->in.level = 5;
+ r->in.req->req5.destination_dsa_guid = partition->destination_dsa_guid;
+ r->in.req->req5.source_dsa_invocation_id= partition->source_dsa_invocation_id;
+ r->in.req->req5.naming_context = &partition->nc;
+ r->in.req->req5.highwatermark = partition->highwatermark;
+ r->in.req->req5.uptodateness_vector = NULL;
+ r->in.req->req5.replica_flags = partition->replica_flags;
+ r->in.req->req5.max_object_count = 133;
+ r->in.req->req5.max_ndr_size = 1336770;
+ r->in.req->req5.extended_op = DRSUAPI_EXOP_NONE;
+ r->in.req->req5.fsmo_info = 0;
}
/*
@@ -2457,28 +2463,28 @@ static WERROR becomeDC_drsuapi_pull_partition_recv(struct libnet_BecomeDC_state
return r->out.result;
}
- if (*r->out.level == 1) {
+ if (*r->out.level_out == 1) {
ctr_level = 1;
- ctr1 = &r->out.ctr.ctr1;
- } else if (*r->out.level == 2 &&
- r->out.ctr.ctr2.mszip1.ts) {
+ ctr1 = &r->out.ctr->ctr1;
+ } else if (*r->out.level_out == 2 &&
+ r->out.ctr->ctr2.mszip1.ts) {
ctr_level = 1;
- ctr1 = &r->out.ctr.ctr2.mszip1.ts->ctr1;
- } else if (*r->out.level == 6) {
+ ctr1 = &r->out.ctr->ctr2.mszip1.ts->ctr1;
+ } else if (*r->out.level_out == 6) {
ctr_level = 6;
- ctr6 = &r->out.ctr.ctr6;
- } else if (*r->out.level == 7 &&
- r->out.ctr.ctr7.level == 6 &&
- r->out.ctr.ctr7.type == DRSUAPI_COMPRESSION_TYPE_MSZIP &&
- r->out.ctr.ctr7.ctr.mszip6.ts) {
+ ctr6 = &r->out.ctr->ctr6;
+ } else if (*r->out.level_out == 7 &&
+ r->out.ctr->ctr7.level == 6 &&
+ r->out.ctr->ctr7.type == DRSUAPI_COMPRESSION_TYPE_MSZIP &&
+ r->out.ctr->ctr7.ctr.mszip6.ts) {
ctr_level = 6;
- ctr6 = &r->out.ctr.ctr7.ctr.mszip6.ts->ctr6;
- } else if (*r->out.level == 7 &&
- r->out.ctr.ctr7.level == 6 &&
- r->out.ctr.ctr7.type == DRSUAPI_COMPRESSION_TYPE_XPRESS &&
- r->out.ctr.ctr7.ctr.xpress6.ts) {
+ ctr6 = &r->out.ctr->ctr7.ctr.mszip6.ts->ctr6;
+ } else if (*r->out.level_out == 7 &&
+ r->out.ctr->ctr7.level == 6 &&
+ r->out.ctr->ctr7.type == DRSUAPI_COMPRESSION_TYPE_XPRESS &&
+ r->out.ctr->ctr7.ctr.xpress6.ts) {
ctr_level = 6;
- ctr6 = &r->out.ctr.ctr7.ctr.xpress6.ts->ctr6;
+ ctr6 = &r->out.ctr->ctr7.ctr.xpress6.ts->ctr6;
} else {
return WERR_BAD_NET_RESP;
}