diff options
author | Andrew Bartlett <abartlet@samba.org> | 2008-01-23 15:34:44 +1100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2008-01-23 15:34:44 +1100 |
commit | 8bceed449d7332a5f860000b8c1b53ed8ccf72fa (patch) | |
tree | 5837576f69a581c0cdf06429541dabb7c27a7cce | |
parent | 56a611b12618ef0224a7a8a12883e0ab8340962d (diff) | |
download | samba-8bceed449d7332a5f860000b8c1b53ed8ccf72fa.tar.gz samba-8bceed449d7332a5f860000b8c1b53ed8ccf72fa.tar.bz2 samba-8bceed449d7332a5f860000b8c1b53ed8ccf72fa.zip |
Fix segfaults in codepaths only tested by the NET-API-BECOME-DC test.
(I presume this has resulted from the global variable elimination)
Perhaps the iconv handle argument to ndr_push_struct needs to be
marked as 'not NULL' or similar?
Andrew Bartlett
(This used to be commit e8081333b8d43d96974c9e06a26aaa25dd34da56)
-rw-r--r-- | source4/dsdb/schema/schema_syntax.c | 4 | ||||
-rw-r--r-- | source4/libnet/libnet_become_dc.c | 25 |
2 files changed, 15 insertions, 14 deletions
diff --git a/source4/dsdb/schema/schema_syntax.c b/source4/dsdb/schema/schema_syntax.c index 9bc51c676e..2c133b6424 100644 --- a/source4/dsdb/schema/schema_syntax.c +++ b/source4/dsdb/schema/schema_syntax.c @@ -939,7 +939,7 @@ static WERROR dsdb_syntax_DN_BINARY_drsuapi_to_ldb(const struct dsdb_schema *sch } ndr_err = ndr_pull_struct_blob_all(in->value_ctr.values[i].blob, - out->values, NULL, &id3b, + out->values, lp_iconv_convenience(global_loadparm), &id3b, (ndr_pull_flags_fn_t)ndr_pull_drsuapi_DsReplicaObjectIdentifier3Binary); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { NTSTATUS status = ndr_map_error2ntstatus(ndr_err); @@ -997,7 +997,7 @@ static WERROR dsdb_syntax_DN_BINARY_ldb_to_drsuapi(const struct dsdb_schema *sch id3b.dn = (const char *)in->values[i].data; id3b.binary = data_blob(NULL, 0); - ndr_err = ndr_push_struct_blob(&blobs[i], blobs, NULL, &id3b, + ndr_err = ndr_push_struct_blob(&blobs[i], blobs, lp_iconv_convenience(global_loadparm), &id3b, (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3Binary); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { NTSTATUS status = ndr_map_error2ntstatus(ndr_err); diff --git a/source4/libnet/libnet_become_dc.c b/source4/libnet/libnet_become_dc.c index 862631ffa9..f2c1f70bfc 100644 --- a/source4/libnet/libnet_become_dc.c +++ b/source4/libnet/libnet_become_dc.c @@ -1687,6 +1687,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; + struct smb_iconv_convenience *iconv_convenience = lp_iconv_convenience(s->libnet->lp_ctx); enum ndr_err_code ndr_err; bool w2k3; @@ -1785,7 +1786,7 @@ static void becomeDC_drsuapi1_add_entry_send(struct libnet_BecomeDC_state *s) NULL); if (composite_nomem(v, c)) return; - ndr_err = ndr_push_struct_blob(&vd[0], vd, NULL, v,(ndr_push_flags_fn_t)ndr_push_security_descriptor); + ndr_err = ndr_push_struct_blob(&vd[0], vd, iconv_convenience, 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; @@ -1844,7 +1845,7 @@ 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; - ndr_err = ndr_push_struct_blob(&vd[0], vd, NULL, &v[0], + ndr_err = ndr_push_struct_blob(&vd[0], vd, iconv_convenience, &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); @@ -1874,7 +1875,7 @@ static void becomeDC_drsuapi1_add_entry_send(struct libnet_BecomeDC_state *s) v = &s->dest_dsa.invocation_id; - ndr_err = ndr_push_struct_blob(&vd[0], vd, NULL, v, (ndr_push_flags_fn_t)ndr_push_GUID); + ndr_err = ndr_push_struct_blob(&vd[0], vd, iconv_convenience, 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; @@ -1913,21 +1914,21 @@ 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; - ndr_err = ndr_push_struct_blob(&vd[0], vd, NULL, &v[0], + ndr_err = ndr_push_struct_blob(&vd[0], vd, iconv_convenience, &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; } - ndr_err = ndr_push_struct_blob(&vd[1], vd, NULL, &v[1], + ndr_err = ndr_push_struct_blob(&vd[1], vd, iconv_convenience, &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; } - ndr_err = ndr_push_struct_blob(&vd[2], vd, NULL, &v[2], + ndr_err = ndr_push_struct_blob(&vd[2], vd, iconv_convenience, &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); @@ -1969,21 +1970,21 @@ 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; - ndr_err = ndr_push_struct_blob(&vd[0], vd, NULL, &v[0], + ndr_err = ndr_push_struct_blob(&vd[0], vd, iconv_convenience, &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; } - ndr_err = ndr_push_struct_blob(&vd[1], vd, NULL, &v[1], + ndr_err = ndr_push_struct_blob(&vd[1], vd, iconv_convenience, &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; } - ndr_err = ndr_push_struct_blob(&vd[2], vd, NULL, &v[2], + ndr_err = ndr_push_struct_blob(&vd[2], vd, iconv_convenience, &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); @@ -2017,7 +2018,7 @@ 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; - ndr_err = ndr_push_struct_blob(&vd[0], vd, NULL, &v[0], + ndr_err = ndr_push_struct_blob(&vd[0], vd, iconv_convenience, &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); @@ -2049,7 +2050,7 @@ 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; - ndr_err = ndr_push_struct_blob(&vd[0], vd, NULL, &v[0], + ndr_err = ndr_push_struct_blob(&vd[0], vd, iconv_convenience, &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); @@ -2131,7 +2132,7 @@ 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; - ndr_err = ndr_push_struct_blob(&vd[0], vd, NULL, &v[0], + ndr_err = ndr_push_struct_blob(&vd[0], vd, iconv_convenience, &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); |