diff options
Diffstat (limited to 'source4')
-rw-r--r-- | source4/libnet/libnet_become_dc.c | 42 | ||||
-rw-r--r-- | source4/librpc/idl/drsuapi.idl | 7 |
2 files changed, 27 insertions, 22 deletions
diff --git a/source4/libnet/libnet_become_dc.c b/source4/libnet/libnet_become_dc.c index 4cbebbf6d0..c79f731cd9 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; diff --git a/source4/librpc/idl/drsuapi.idl b/source4/librpc/idl/drsuapi.idl index f89d9e1f39..2c5c7ae5ef 100644 --- a/source4/librpc/idl/drsuapi.idl +++ b/source4/librpc/idl/drsuapi.idl @@ -1232,9 +1232,10 @@ interface drsuapi [public] WERROR drsuapi_DsAddEntry( [in] policy_handle *bind_handle, - [in,out] int32 level, - [in,switch_is(level)] drsuapi_DsAddEntryRequest req, - [out,switch_is(level)] drsuapi_DsAddEntryCtr ctr + [in] int32 level, + [in,ref,switch_is(level)] drsuapi_DsAddEntryRequest *req, + [out,ref] int32 *level_out, + [out,ref,switch_is(*level_out)] drsuapi_DsAddEntryCtr *ctr ); /*****************/ |