diff options
Diffstat (limited to 'source4/libnet/libnet_become_dc.c')
-rw-r--r-- | source4/libnet/libnet_become_dc.c | 105 |
1 files changed, 71 insertions, 34 deletions
diff --git a/source4/libnet/libnet_become_dc.c b/source4/libnet/libnet_become_dc.c index ade2d340b8..7cf2eca1db 100644 --- a/source4/libnet/libnet_become_dc.c +++ b/source4/libnet/libnet_become_dc.c @@ -1684,6 +1684,7 @@ static void becomeDC_drsuapi1_add_entry_send(struct libnet_BecomeDC_state *s) struct drsuapi_DsReplicaObjectIdentifier *identifier; uint32_t num_attrs, i = 0; struct drsuapi_DsReplicaAttribute *attrs; + enum ndr_err_code ndr_err; bool w2k3; /* choose a random invocationId */ @@ -1781,8 +1782,11 @@ static void becomeDC_drsuapi1_add_entry_send(struct libnet_BecomeDC_state *s) NULL); if (composite_nomem(v, c)) return; - c->status = ndr_push_struct_blob(&vd[0], vd, v,(ndr_push_flags_fn_t)ndr_push_security_descriptor); - if (!composite_is_ok(c)) return; + ndr_err = ndr_push_struct_blob(&vd[0], vd, v,(ndr_push_flags_fn_t)ndr_push_security_descriptor); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + c->status = ndr_map_error2ntstatus(ndr_err); + if (!composite_is_ok(c)) return; + } vs[0].blob = &vd[0]; @@ -1837,9 +1841,12 @@ static void becomeDC_drsuapi1_add_entry_send(struct libnet_BecomeDC_state *s) s->forest.schema_dn_str); if (composite_nomem(v[0].dn, c)) return; - c->status = ndr_push_struct_blob(&vd[0], vd, &v[0], - (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3); - if (!composite_is_ok(c)) return; + ndr_err = ndr_push_struct_blob(&vd[0], vd, &v[0], + (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + c->status = ndr_map_error2ntstatus(ndr_err); + if (!composite_is_ok(c)) return; + } vs[0].blob = &vd[0]; @@ -1864,8 +1871,11 @@ static void becomeDC_drsuapi1_add_entry_send(struct libnet_BecomeDC_state *s) v = &s->dest_dsa.invocation_id; - c->status = ndr_push_struct_blob(&vd[0], vd, v, (ndr_push_flags_fn_t)ndr_push_GUID); - if (!composite_is_ok(c)) return; + ndr_err = ndr_push_struct_blob(&vd[0], vd, v, (ndr_push_flags_fn_t)ndr_push_GUID); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + c->status = ndr_map_error2ntstatus(ndr_err); + if (!composite_is_ok(c)) return; + } vs[0].blob = &vd[0]; @@ -1900,17 +1910,26 @@ static void becomeDC_drsuapi1_add_entry_send(struct libnet_BecomeDC_state *s) v[2].sid = s->zero_sid; v[2].dn = s->forest.schema_dn_str; - c->status = ndr_push_struct_blob(&vd[0], vd, &v[0], - (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3); - if (!composite_is_ok(c)) return; + ndr_err = ndr_push_struct_blob(&vd[0], vd, &v[0], + (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + c->status = ndr_map_error2ntstatus(ndr_err); + if (!composite_is_ok(c)) return; + } - c->status = ndr_push_struct_blob(&vd[1], vd, &v[1], - (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3); - if (!composite_is_ok(c)) return; + ndr_err = ndr_push_struct_blob(&vd[1], vd, &v[1], + (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + c->status = ndr_map_error2ntstatus(ndr_err); + if (!composite_is_ok(c)) return; + } - c->status = ndr_push_struct_blob(&vd[2], vd, &v[2], - (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3); - if (!composite_is_ok(c)) return; + ndr_err = ndr_push_struct_blob(&vd[2], vd, &v[2], + (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + c->status = ndr_map_error2ntstatus(ndr_err); + if (!composite_is_ok(c)) return; + } vs[0].blob = &vd[0]; vs[1].blob = &vd[1]; @@ -1947,17 +1966,26 @@ static void becomeDC_drsuapi1_add_entry_send(struct libnet_BecomeDC_state *s) v[2].sid = s->zero_sid; v[2].dn = s->forest.schema_dn_str; - c->status = ndr_push_struct_blob(&vd[0], vd, &v[0], - (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3); - if (!composite_is_ok(c)) return; + ndr_err = ndr_push_struct_blob(&vd[0], vd, &v[0], + (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + c->status = ndr_map_error2ntstatus(ndr_err); + if (!composite_is_ok(c)) return; + } - c->status = ndr_push_struct_blob(&vd[1], vd, &v[1], - (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3); - if (!composite_is_ok(c)) return; + ndr_err = ndr_push_struct_blob(&vd[1], vd, &v[1], + (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + c->status = ndr_map_error2ntstatus(ndr_err); + if (!composite_is_ok(c)) return; + } - c->status = ndr_push_struct_blob(&vd[2], vd, &v[2], - (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3); - if (!composite_is_ok(c)) return; + ndr_err = ndr_push_struct_blob(&vd[2], vd, &v[2], + (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + c->status = ndr_map_error2ntstatus(ndr_err); + if (!composite_is_ok(c)) return; + } vs[0].blob = &vd[0]; vs[1].blob = &vd[1]; @@ -1986,9 +2014,12 @@ static void becomeDC_drsuapi1_add_entry_send(struct libnet_BecomeDC_state *s) v[0].sid = s->zero_sid; v[0].dn = s->forest.schema_dn_str; - c->status = ndr_push_struct_blob(&vd[0], vd, &v[0], - (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3); - if (!composite_is_ok(c)) return; + ndr_err = ndr_push_struct_blob(&vd[0], vd, &v[0], + (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + c->status = ndr_map_error2ntstatus(ndr_err); + if (!composite_is_ok(c)) return; + } vs[0].blob = &vd[0]; @@ -2015,9 +2046,12 @@ static void becomeDC_drsuapi1_add_entry_send(struct libnet_BecomeDC_state *s) v[0].sid = s->zero_sid; v[0].dn = s->domain.dn_str; - c->status = ndr_push_struct_blob(&vd[0], vd, &v[0], - (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3); - if (!composite_is_ok(c)) return; + ndr_err = ndr_push_struct_blob(&vd[0], vd, &v[0], + (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + c->status = ndr_map_error2ntstatus(ndr_err); + if (!composite_is_ok(c)) return; + } vs[0].blob = &vd[0]; @@ -2094,9 +2128,12 @@ static void becomeDC_drsuapi1_add_entry_send(struct libnet_BecomeDC_state *s) v[0].sid = s->zero_sid; v[0].dn = s->dest_dsa.computer_dn_str; - c->status = ndr_push_struct_blob(&vd[0], vd, &v[0], - (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3); - if (!composite_is_ok(c)) return; + ndr_err = ndr_push_struct_blob(&vd[0], vd, &v[0], + (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + c->status = ndr_map_error2ntstatus(ndr_err); + if (!composite_is_ok(c)) return; + } vs[0].blob = &vd[0]; |