summaryrefslogtreecommitdiff
path: root/source4/libnet
diff options
context:
space:
mode:
Diffstat (limited to 'source4/libnet')
-rw-r--r--source4/libnet/libnet_become_dc.c105
-rw-r--r--source4/libnet/libnet_samsync_ldb.c8
-rw-r--r--source4/libnet/libnet_vampire.c8
3 files changed, 79 insertions, 42 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];
diff --git a/source4/libnet/libnet_samsync_ldb.c b/source4/libnet/libnet_samsync_ldb.c
index bdc3341aa6..72b6a39239 100644
--- a/source4/libnet/libnet_samsync_ldb.c
+++ b/source4/libnet/libnet_samsync_ldb.c
@@ -165,13 +165,13 @@ static NTSTATUS samsync_ldb_handle_domain(TALLOC_CTX *mem_ctx,
}
if (state->samsync_state->domain_guid) {
- NTSTATUS nt_status;
+ enum ndr_err_code ndr_err;
struct ldb_val v;
- nt_status = ndr_push_struct_blob(&v, msg, state->samsync_state->domain_guid,
+ ndr_err = ndr_push_struct_blob(&v, msg, state->samsync_state->domain_guid,
(ndr_push_flags_fn_t)ndr_push_GUID);
- if (!NT_STATUS_IS_OK(nt_status)) {
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
*error_string = talloc_asprintf(mem_ctx, "ndr_push of domain GUID failed!");
- return nt_status;
+ return ndr_map_error2ntstatus(ndr_err);
}
ldb_msg_add_value(msg, "objectGUID", &v, NULL);
diff --git a/source4/libnet/libnet_vampire.c b/source4/libnet/libnet_vampire.c
index 09163f6507..40693e6362 100644
--- a/source4/libnet/libnet_vampire.c
+++ b/source4/libnet/libnet_vampire.c
@@ -49,7 +49,6 @@ static NTSTATUS fix_user(TALLOC_CTX *mem_ctx,
struct samr_Password lm_hash;
struct samr_Password nt_hash;
const char *username = user->account_name.string;
- NTSTATUS nt_status;
if (rid_crypt) {
if (user->lm_password_present) {
@@ -66,17 +65,18 @@ static NTSTATUS fix_user(TALLOC_CTX *mem_ctx,
if (user->user_private_info.SensitiveData) {
DATA_BLOB data;
struct netr_USER_KEYS keys;
+ enum ndr_err_code ndr_err;
data.data = user->user_private_info.SensitiveData;
data.length = user->user_private_info.DataLength;
creds_arcfour_crypt(creds, data.data, data.length);
user->user_private_info.SensitiveData = data.data;
user->user_private_info.DataLength = data.length;
- nt_status = ndr_pull_struct_blob(&data, mem_ctx, &keys, (ndr_pull_flags_fn_t)ndr_pull_netr_USER_KEYS);
- if (!NT_STATUS_IS_OK(nt_status)) {
+ ndr_err = ndr_pull_struct_blob(&data, mem_ctx, &keys, (ndr_pull_flags_fn_t)ndr_pull_netr_USER_KEYS);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
*error_string = talloc_asprintf(mem_ctx, "Failed to parse Sensitive Data for %s:", username);
dump_data(10, data.data, data.length);
- return nt_status;
+ return ndr_map_error2ntstatus(ndr_err);
}
if (keys.keys.keys2.lmpassword.length == 16) {