diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2010-05-09 17:20:01 +0200 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2010-05-18 11:45:30 +0200 |
commit | f9ca9e46ad24036bf00cb361a6cef4b2e7e98d7d (patch) | |
tree | 9a0a6cb6617d855c28eb891396898096c4214e88 /source4/dsdb | |
parent | e9f5bdf6b5a1aeb7e2e556cf41f7cbc2abed7856 (diff) | |
download | samba-f9ca9e46ad24036bf00cb361a6cef4b2e7e98d7d.tar.gz samba-f9ca9e46ad24036bf00cb361a6cef4b2e7e98d7d.tar.bz2 samba-f9ca9e46ad24036bf00cb361a6cef4b2e7e98d7d.zip |
Finish removal of iconv_convenience in public API's.
Diffstat (limited to 'source4/dsdb')
-rw-r--r-- | source4/dsdb/common/dsdb_access.c | 2 | ||||
-rw-r--r-- | source4/dsdb/common/util.c | 12 | ||||
-rw-r--r-- | source4/dsdb/kcc/kcc_drs_replica_info.c | 2 | ||||
-rw-r--r-- | source4/dsdb/repl/drepl_partitions.c | 2 | ||||
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/descriptor.c | 11 | ||||
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/extended_dn_out.c | 2 | ||||
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/password_hash.c | 14 | ||||
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/repl_meta_data.c | 29 | ||||
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/ridalloc.c | 1 | ||||
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/samba3sam.c | 5 | ||||
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/samldb.c | 2 | ||||
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/schema_load.c | 1 | ||||
-rw-r--r-- | source4/dsdb/schema/schema_info_attr.c | 4 | ||||
-rw-r--r-- | source4/dsdb/schema/schema_init.c | 21 | ||||
-rw-r--r-- | source4/dsdb/schema/schema_set.c | 2 | ||||
-rw-r--r-- | source4/dsdb/schema/schema_syntax.c | 28 |
16 files changed, 47 insertions, 91 deletions
diff --git a/source4/dsdb/common/dsdb_access.c b/source4/dsdb/common/dsdb_access.c index 7857e1fa25..ac0c73643f 100644 --- a/source4/dsdb/common/dsdb_access.c +++ b/source4/dsdb/common/dsdb_access.c @@ -69,7 +69,7 @@ int dsdb_get_sd_from_ldb_message(TALLOC_CTX *mem_ctx, if(!*sd) { return LDB_ERR_OPERATIONS_ERROR; } - ndr_err = ndr_pull_struct_blob(&sd_element->values[0], *sd, NULL, *sd, + ndr_err = ndr_pull_struct_blob(&sd_element->values[0], *sd, *sd, (ndr_pull_flags_fn_t)ndr_pull_security_descriptor); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c index df4e734252..da4d0b3940 100644 --- a/source4/dsdb/common/util.c +++ b/source4/dsdb/common/util.c @@ -385,7 +385,7 @@ struct dom_sid *samdb_result_dom_sid(TALLOC_CTX *mem_ctx, const struct ldb_messa if (sid == NULL) { return NULL; } - ndr_err = ndr_pull_struct_blob(v, sid, NULL, sid, + ndr_err = ndr_pull_struct_blob(v, sid, sid, (ndr_pull_flags_fn_t)ndr_pull_dom_sid); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(sid); @@ -816,7 +816,6 @@ int samdb_msg_add_dom_sid(struct ldb_context *sam_ldb, TALLOC_CTX *mem_ctx, stru enum ndr_err_code ndr_err; ndr_err = ndr_push_struct_blob(&v, mem_ctx, - lp_iconv_convenience(ldb_get_opaque(sam_ldb, "loadparm")), sid, (ndr_push_flags_fn_t)ndr_push_dom_sid); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -2494,7 +2493,7 @@ WERROR dsdb_loadreps(struct ldb_context *sam_ctx, TALLOC_CTX *mem_ctx, struct ld for (i=0; i<(*count); i++) { enum ndr_err_code ndr_err; ndr_err = ndr_pull_struct_blob(&el->values[i], - mem_ctx, lp_iconv_convenience(ldb_get_opaque(sam_ctx, "loadparm")), + mem_ctx, &(*r)[i], (ndr_pull_flags_fn_t)ndr_pull_repsFromToBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -2535,7 +2534,7 @@ WERROR dsdb_savereps(struct ldb_context *sam_ctx, TALLOC_CTX *mem_ctx, struct ld struct ldb_val v; enum ndr_err_code ndr_err; - ndr_err = ndr_push_struct_blob(&v, tmp_ctx, lp_iconv_convenience(ldb_get_opaque(sam_ctx, "loadparm")), + ndr_err = ndr_push_struct_blob(&v, tmp_ctx, &r[i], (ndr_push_flags_fn_t)ndr_push_repsFromToBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -2981,7 +2980,7 @@ NTSTATUS dsdb_get_extended_dn_sid(struct ldb_dn *dn, struct dom_sid *sid, const tmp_ctx = talloc_new(NULL); - ndr_err = ndr_pull_struct_blob_all(sid_blob, tmp_ctx, NULL, sid, + ndr_err = ndr_pull_struct_blob_all(sid_blob, tmp_ctx, sid, (ndr_pull_flags_fn_t)ndr_pull_dom_sid); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { NTSTATUS status = ndr_map_error2ntstatus(ndr_err); @@ -3243,8 +3242,7 @@ int dsdb_load_udv_v2(struct ldb_context *samdb, struct ldb_dn *dn, TALLOC_CTX *m enum ndr_err_code ndr_err; struct replUpToDateVectorBlob ouv; - ndr_err = ndr_pull_struct_blob(ouv_value, r, - lp_iconv_convenience(ldb_get_opaque(samdb, "loadparm")), &ouv, + ndr_err = ndr_pull_struct_blob(ouv_value, r, &ouv, (ndr_pull_flags_fn_t)ndr_pull_replUpToDateVectorBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(r); diff --git a/source4/dsdb/kcc/kcc_drs_replica_info.c b/source4/dsdb/kcc/kcc_drs_replica_info.c index 322ccc980c..170105642b 100644 --- a/source4/dsdb/kcc/kcc_drs_replica_info.c +++ b/source4/dsdb/kcc/kcc_drs_replica_info.c @@ -122,7 +122,7 @@ static WERROR get_repl_prop_metadata_ctr(TALLOC_CTX *mem_ctx, } ndr_err = ndr_pull_struct_blob(omd_value, mem_ctx, - lp_iconv_convenience(ldb_get_opaque(samdb, "loadparm")), obj_metadata_ctr, + obj_metadata_ctr, (ndr_pull_flags_fn_t)ndr_pull_replPropertyMetaDataBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { DEBUG(0,(__location__ ": Failed to parse replPropertyMetaData for %s\n", diff --git a/source4/dsdb/repl/drepl_partitions.c b/source4/dsdb/repl/drepl_partitions.c index b17a17d5a3..cb45b41248 100644 --- a/source4/dsdb/repl/drepl_partitions.c +++ b/source4/dsdb/repl/drepl_partitions.c @@ -153,7 +153,7 @@ static WERROR dreplsrv_partition_add_source_dsa(struct dreplsrv_service *s, W_ERROR_HAVE_NO_MEMORY(source); ndr_err = ndr_pull_struct_blob(val, source, - lp_iconv_convenience(s->task->lp_ctx), &source->_repsFromBlob, + &source->_repsFromBlob, (ndr_pull_flags_fn_t)ndr_pull_repsFromToBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { NTSTATUS nt_status = ndr_map_error2ntstatus(ndr_err); diff --git a/source4/dsdb/samdb/ldb_modules/descriptor.c b/source4/dsdb/samdb/ldb_modules/descriptor.c index 8fc5e3a47b..6c9baaa13a 100644 --- a/source4/dsdb/samdb/ldb_modules/descriptor.c +++ b/source4/dsdb/samdb/ldb_modules/descriptor.c @@ -230,7 +230,7 @@ static DATA_BLOB *get_new_descriptor(struct ldb_module *module, if (!user_descriptor) { return NULL; } - ndr_err = ndr_pull_struct_blob(object, user_descriptor, NULL, + ndr_err = ndr_pull_struct_blob(object, user_descriptor, user_descriptor, (ndr_pull_flags_fn_t)ndr_pull_security_descriptor); @@ -247,7 +247,7 @@ static DATA_BLOB *get_new_descriptor(struct ldb_module *module, if (!old_descriptor) { return NULL; } - ndr_err = ndr_pull_struct_blob(old_sd, old_descriptor, NULL, + ndr_err = ndr_pull_struct_blob(old_sd, old_descriptor, old_descriptor, (ndr_pull_flags_fn_t)ndr_pull_security_descriptor); @@ -262,7 +262,7 @@ static DATA_BLOB *get_new_descriptor(struct ldb_module *module, if (!parent_descriptor) { return NULL; } - ndr_err = ndr_pull_struct_blob(parent, parent_descriptor, NULL, + ndr_err = ndr_pull_struct_blob(parent, parent_descriptor, parent_descriptor, (ndr_pull_flags_fn_t)ndr_pull_security_descriptor); @@ -305,7 +305,6 @@ static DATA_BLOB *get_new_descriptor(struct ldb_module *module, } ndr_err = ndr_push_struct_blob(linear_sd, mem_ctx, - lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), final_sd, (ndr_push_flags_fn_t)ndr_push_security_descriptor); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -323,13 +322,12 @@ static DATA_BLOB *descr_get_descriptor_to_show(struct ldb_module *module, struct security_descriptor *old_sd, *final_sd; DATA_BLOB *linear_sd; enum ndr_err_code ndr_err; - struct ldb_context *ldb = ldb_module_get_ctx(module); old_sd = talloc(mem_ctx, struct security_descriptor); if (!old_sd) { return NULL; } - ndr_err = ndr_pull_struct_blob(sd, old_sd, NULL, + ndr_err = ndr_pull_struct_blob(sd, old_sd, old_sd, (ndr_pull_flags_fn_t)ndr_pull_security_descriptor); @@ -350,7 +348,6 @@ static DATA_BLOB *descr_get_descriptor_to_show(struct ldb_module *module, } ndr_err = ndr_push_struct_blob(linear_sd, mem_ctx, - lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), final_sd, (ndr_push_flags_fn_t)ndr_push_security_descriptor); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { diff --git a/source4/dsdb/samdb/ldb_modules/extended_dn_out.c b/source4/dsdb/samdb/ldb_modules/extended_dn_out.c index 39af87091c..12adf16181 100644 --- a/source4/dsdb/samdb/ldb_modules/extended_dn_out.c +++ b/source4/dsdb/samdb/ldb_modules/extended_dn_out.c @@ -276,7 +276,7 @@ static int handle_dereference_fds(struct ldb_dn *dn, return LDB_ERR_INVALID_DN_SYNTAX; } - ndr_err = ndr_push_struct_blob(&sid_blob, NULL, NULL, sid, + ndr_err = ndr_push_struct_blob(&sid_blob, NULL, sid, (ndr_push_flags_fn_t)ndr_push_dom_sid); talloc_free(sid); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { diff --git a/source4/dsdb/samdb/ldb_modules/password_hash.c b/source4/dsdb/samdb/ldb_modules/password_hash.c index f9e7f52cd9..de2c6da94c 100644 --- a/source4/dsdb/samdb/ldb_modules/password_hash.c +++ b/source4/dsdb/samdb/ldb_modules/password_hash.c @@ -519,7 +519,7 @@ static int setup_primary_kerberos(struct setup_password_fields_io *io, } /* TODO: use ndr_pull_struct_blob_all(), when the ndr layer handles it correct with relative pointers */ - ndr_err = ndr_pull_struct_blob(&blob, io->ac, lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), &_old_pkb, + ndr_err = ndr_pull_struct_blob(&blob, io->ac, &_old_pkb, (ndr_pull_flags_fn_t)ndr_pull_package_PrimaryKerberosBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { NTSTATUS status = ndr_map_error2ntstatus(ndr_err); @@ -636,7 +636,6 @@ static int setup_primary_kerberos_newer(struct setup_password_fields_io *io, /* TODO: use ndr_pull_struct_blob_all(), when the ndr layer handles it correct with relative pointers */ ndr_err = ndr_pull_struct_blob(&blob, io->ac, - lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), &_old_pkb, (ndr_pull_flags_fn_t)ndr_pull_package_PrimaryKerberosBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -1068,7 +1067,6 @@ static int setup_supplemental_field(struct setup_password_fields_io *io) /* if there's an old supplementaCredentials blob then parse it */ if (io->o.supplemental) { ndr_err = ndr_pull_struct_blob_all(io->o.supplemental, io->ac, - lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), &_old_scb, (ndr_pull_flags_fn_t)ndr_pull_supplementalCredentialsBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -1148,7 +1146,6 @@ static int setup_supplemental_field(struct setup_password_fields_io *io) } ndr_err = ndr_push_struct_blob(&pknb_blob, io->ac, - lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), &pknb, (ndr_push_flags_fn_t)ndr_push_package_PrimaryKerberosBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -1180,7 +1177,6 @@ static int setup_supplemental_field(struct setup_password_fields_io *io) } ndr_err = ndr_push_struct_blob(&pkb_blob, io->ac, - lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), &pkb, (ndr_push_flags_fn_t)ndr_push_package_PrimaryKerberosBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -1211,7 +1207,6 @@ static int setup_supplemental_field(struct setup_password_fields_io *io) } ndr_err = ndr_push_struct_blob(&pdb_blob, io->ac, - lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), &pdb, (ndr_push_flags_fn_t)ndr_push_package_PrimaryWDigestBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -1240,7 +1235,6 @@ static int setup_supplemental_field(struct setup_password_fields_io *io) pcb.cleartext = *io->n.cleartext_utf16; ndr_err = ndr_push_struct_blob(&pcb_blob, io->ac, - lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), &pcb, (ndr_push_flags_fn_t)ndr_push_package_PrimaryCLEARTEXTBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -1266,7 +1260,6 @@ static int setup_supplemental_field(struct setup_password_fields_io *io) */ pb.names = names; ndr_err = ndr_push_struct_blob(&pb_blob, io->ac, - lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), &pb, (ndr_push_flags_fn_t)ndr_push_package_PackagesBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -1294,7 +1287,6 @@ static int setup_supplemental_field(struct setup_password_fields_io *io) scb.sub.packages = packages; ndr_err = ndr_push_struct_blob(&io->g.supplemental, io->ac, - lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), &scb, (ndr_push_flags_fn_t)ndr_push_supplementalCredentialsBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -1335,8 +1327,7 @@ static int setup_given_passwords(struct setup_password_fields_io *io, ldb_oom(ldb); return LDB_ERR_OPERATIONS_ERROR; } - if (!convert_string_talloc_convenience(io->ac, - lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), + if (!convert_string_talloc(io->ac, CH_UTF8, CH_UTF16, g->cleartext_utf8->data, g->cleartext_utf8->length, @@ -1361,7 +1352,6 @@ static int setup_given_passwords(struct setup_password_fields_io *io, return LDB_ERR_OPERATIONS_ERROR; } if (!convert_string_talloc_convenience(io->ac, - lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), CH_UTF16MUNGED, CH_UTF8, g->cleartext_utf16->data, g->cleartext_utf16->length, diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c index a6aeb5e58f..72ffd0e21c 100644 --- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c +++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c @@ -911,7 +911,6 @@ static int replmd_add(struct ldb_module *module, struct ldb_request *req) /* generated NDR encoded values */ ndr_err = ndr_push_struct_blob(&nmd_value, msg, - lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), &nmd, (ndr_push_flags_fn_t)ndr_push_replPropertyMetaDataBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -1144,8 +1143,7 @@ static int replmd_update_rpmd(struct ldb_module *module, return LDB_ERR_OPERATIONS_ERROR; } - ndr_err = ndr_pull_struct_blob(omd_value, msg, - lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), &omd, + ndr_err = ndr_pull_struct_blob(omd_value, msg, &omd, (ndr_pull_flags_fn_t)ndr_pull_replPropertyMetaDataBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { DEBUG(0,(__location__ ": Failed to parse replPropertyMetaData for %s\n", @@ -1207,9 +1205,7 @@ static int replmd_update_rpmd(struct ldb_module *module, return ret; } - ndr_err = ndr_push_struct_blob(md_value, msg, - lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), - &omd, + ndr_err = ndr_push_struct_blob(md_value, msg, &omd, (ndr_push_flags_fn_t)ndr_push_replPropertyMetaDataBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { DEBUG(0,(__location__ ": Failed to marshall replPropertyMetaData for %s\n", @@ -2749,9 +2745,7 @@ static int replmd_replicated_apply_add(struct replmd_replicated_request *ar) for (i=0; i < md->ctr.ctr1.count; i++) { md->ctr.ctr1.array[i].local_usn = ar->seq_num; } - ndr_err = ndr_push_struct_blob(&md_value, msg, - lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), - md, + ndr_err = ndr_push_struct_blob(&md_value, msg, md, (ndr_push_flags_fn_t)ndr_push_replPropertyMetaDataBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { NTSTATUS nt_status = ndr_map_error2ntstatus(ndr_err); @@ -2860,8 +2854,7 @@ static int replmd_replicated_apply_merge(struct replmd_replicated_request *ar) /* find existing meta data */ omd_value = ldb_msg_find_ldb_val(ar->search_msg, "replPropertyMetaData"); if (omd_value) { - ndr_err = ndr_pull_struct_blob(omd_value, ar, - lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), &omd, + ndr_err = ndr_pull_struct_blob(omd_value, ar, &omd, (ndr_pull_flags_fn_t)ndr_pull_replPropertyMetaDataBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { NTSTATUS nt_status = ndr_map_error2ntstatus(ndr_err); @@ -2969,9 +2962,7 @@ static int replmd_replicated_apply_merge(struct replmd_replicated_request *ar) } /* create the meta data value */ - ndr_err = ndr_push_struct_blob(&nmd_value, msg, - lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), - &nmd, + ndr_err = ndr_push_struct_blob(&nmd_value, msg, &nmd, (ndr_push_flags_fn_t)ndr_push_replPropertyMetaDataBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { NTSTATUS nt_status = ndr_map_error2ntstatus(ndr_err); @@ -3192,8 +3183,7 @@ static int replmd_replicated_uptodate_modify(struct replmd_replicated_request *a */ ouv_value = ldb_msg_find_ldb_val(ar->search_msg, "replUpToDateVector"); if (ouv_value) { - ndr_err = ndr_pull_struct_blob(ouv_value, ar, - lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), &ouv, + ndr_err = ndr_pull_struct_blob(ouv_value, ar, &ouv, (ndr_pull_flags_fn_t)ndr_pull_replUpToDateVectorBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { NTSTATUS nt_status = ndr_map_error2ntstatus(ndr_err); @@ -3316,9 +3306,7 @@ static int replmd_replicated_uptodate_modify(struct replmd_replicated_request *a if (!msg) return replmd_replicated_request_werror(ar, WERR_NOMEM); msg->dn = ar->search_msg->dn; - ndr_err = ndr_push_struct_blob(&nuv_value, msg, - lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), - &nuv, + ndr_err = ndr_push_struct_blob(&nuv_value, msg, &nuv, (ndr_push_flags_fn_t)ndr_push_replUpToDateVectorBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { NTSTATUS nt_status = ndr_map_error2ntstatus(ndr_err); @@ -3355,7 +3343,7 @@ static int replmd_replicated_uptodate_modify(struct replmd_replicated_request *a trf = talloc(ar, struct repsFromToBlob); if (!trf) return replmd_replicated_request_werror(ar, WERR_NOMEM); - ndr_err = ndr_pull_struct_blob(&orf_el->values[i], trf, lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), trf, + ndr_err = ndr_pull_struct_blob(&orf_el->values[i], trf, trf, (ndr_pull_flags_fn_t)ndr_pull_repsFromToBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { NTSTATUS nt_status = ndr_map_error2ntstatus(ndr_err); @@ -3406,7 +3394,6 @@ static int replmd_replicated_uptodate_modify(struct replmd_replicated_request *a /* we now fill the value which is already attached to ldb_message */ ndr_err = ndr_push_struct_blob(nrf_value, msg, - lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), &nrf, (ndr_push_flags_fn_t)ndr_push_repsFromToBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { diff --git a/source4/dsdb/samdb/ldb_modules/ridalloc.c b/source4/dsdb/samdb/ldb_modules/ridalloc.c index a64062fcdc..05aee77638 100644 --- a/source4/dsdb/samdb/ldb_modules/ridalloc.c +++ b/source4/dsdb/samdb/ldb_modules/ridalloc.c @@ -72,7 +72,6 @@ static void ridalloc_poke_rid_manager(struct ldb_module *module) TALLOC_CTX *tmp_ctx = talloc_new(module); msg = messaging_client_init(tmp_ctx, lp_messaging_path(tmp_ctx, lp_ctx), - lp_iconv_convenience(lp_ctx), ldb_get_event_context(ldb)); if (!msg) { DEBUG(3,(__location__ ": Failed to create messaging context\n")); diff --git a/source4/dsdb/samdb/ldb_modules/samba3sam.c b/source4/dsdb/samdb/ldb_modules/samba3sam.c index 61013d133e..42245ce491 100644 --- a/source4/dsdb/samdb/ldb_modules/samba3sam.c +++ b/source4/dsdb/samdb/ldb_modules/samba3sam.c @@ -94,7 +94,7 @@ static void generate_sambaPrimaryGroupSID(struct ldb_module *module, const char return; } - ndr_err = ndr_pull_struct_blob(sidval, sid, NULL, sid, (ndr_pull_flags_fn_t)ndr_pull_dom_sid); + ndr_err = ndr_pull_struct_blob(sidval, sid, sid, (ndr_pull_flags_fn_t)ndr_pull_dom_sid); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(sid); return; @@ -188,7 +188,6 @@ static struct ldb_val encode_sid(struct ldb_module *module, TALLOC_CTX *ctx, con } ndr_err = ndr_push_struct_blob(&out, ctx, - NULL, sid, (ndr_push_flags_fn_t)ndr_push_dom_sid); talloc_free(sid); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -210,7 +209,7 @@ static struct ldb_val decode_sid(struct ldb_module *module, TALLOC_CTX *ctx, con return out; } - ndr_err = ndr_pull_struct_blob(val, sid, NULL, sid, + ndr_err = ndr_pull_struct_blob(val, sid, sid, (ndr_pull_flags_fn_t)ndr_pull_dom_sid); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { goto done; diff --git a/source4/dsdb/samdb/ldb_modules/samldb.c b/source4/dsdb/samdb/ldb_modules/samldb.c index 4a50a3fa47..4d1659df0b 100644 --- a/source4/dsdb/samdb/ldb_modules/samldb.c +++ b/source4/dsdb/samdb/ldb_modules/samldb.c @@ -327,7 +327,7 @@ static bool samldb_msg_add_sid(struct ldb_message *msg, struct ldb_val v; enum ndr_err_code ndr_err; - ndr_err = ndr_push_struct_blob(&v, msg, NULL, sid, + ndr_err = ndr_push_struct_blob(&v, msg, sid, (ndr_push_flags_fn_t)ndr_push_dom_sid); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { return false; diff --git a/source4/dsdb/samdb/ldb_modules/schema_load.c b/source4/dsdb/samdb/ldb_modules/schema_load.c index b4a68769e6..4df6f1e38a 100644 --- a/source4/dsdb/samdb/ldb_modules/schema_load.c +++ b/source4/dsdb/samdb/ldb_modules/schema_load.c @@ -215,7 +215,6 @@ static int dsdb_schema_from_db(struct ldb_module *module, struct ldb_dn *schema_ } ret = dsdb_schema_from_ldb_results(tmp_ctx, ldb, - lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), schema_res, a_res, c_res, schema, &error_string); if (ret != LDB_SUCCESS) { ldb_asprintf_errstring(ldb, diff --git a/source4/dsdb/schema/schema_info_attr.c b/source4/dsdb/schema/schema_info_attr.c index ac22eb9b3f..a9c5e932a1 100644 --- a/source4/dsdb/schema/schema_info_attr.c +++ b/source4/dsdb/schema/schema_info_attr.c @@ -100,7 +100,7 @@ WERROR dsdb_schema_info_from_blob(const DATA_BLOB *blob, W_ERROR_HAVE_NO_MEMORY(temp_ctx); ndr_err = ndr_pull_struct_blob_all(blob, temp_ctx, - lp_iconv_convenience(NULL), &schema_info_blob, + &schema_info_blob, (ndr_pull_flags_fn_t)ndr_pull_schemaInfoBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { NTSTATUS nt_status = ndr_map_error2ntstatus(ndr_err); @@ -140,7 +140,7 @@ WERROR dsdb_blob_from_schema_info(const struct dsdb_schema_info *schema_info, schema_info_blob.invocation_id = schema_info->invocation_id; ndr_err = ndr_push_struct_blob(blob, mem_ctx, - lp_iconv_convenience(NULL), &schema_info_blob, + &schema_info_blob, (ndr_push_flags_fn_t)ndr_push_schemaInfoBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { NTSTATUS nt_status = ndr_map_error2ntstatus(ndr_err); diff --git a/source4/dsdb/schema/schema_init.c b/source4/dsdb/schema/schema_init.c index cdd37f094b..55e78ebf3a 100644 --- a/source4/dsdb/schema/schema_init.c +++ b/source4/dsdb/schema/schema_init.c @@ -33,14 +33,13 @@ #include "../lib/util/asn1.h" -struct dsdb_schema *dsdb_new_schema(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience) +struct dsdb_schema *dsdb_new_schema(TALLOC_CTX *mem_ctx) { struct dsdb_schema *schema = talloc_zero(mem_ctx, struct dsdb_schema); if (!schema) { return NULL; } - schema->iconv_convenience = iconv_convenience; return schema; } @@ -66,7 +65,6 @@ WERROR dsdb_load_prefixmap_from_drsuapi(struct dsdb_schema *schema, } static WERROR _dsdb_prefixmap_from_ldb_val(const struct ldb_val *pfm_ldb_val, - struct smb_iconv_convenience *iconv_convenience, TALLOC_CTX *mem_ctx, struct dsdb_schema_prefixmap **_pfm) { @@ -78,7 +76,7 @@ static WERROR _dsdb_prefixmap_from_ldb_val(const struct ldb_val *pfm_ldb_val, W_ERROR_HAVE_NO_MEMORY(temp_ctx); ndr_err = ndr_pull_struct_blob(pfm_ldb_val, temp_ctx, - iconv_convenience, &pfm_blob, + &pfm_blob, (ndr_pull_flags_fn_t)ndr_pull_prefixMapBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { NTSTATUS nt_status = ndr_map_error2ntstatus(ndr_err); @@ -119,7 +117,6 @@ WERROR dsdb_load_oid_mappings_ldb(struct dsdb_schema *schema, /* fetch prefixMap */ werr = _dsdb_prefixmap_from_ldb_val(prefixMap, - schema->iconv_convenience, mem_ctx, &pfm); W_ERROR_NOT_OK_GOTO(werr, DONE); @@ -173,7 +170,7 @@ WERROR dsdb_get_oid_mappings_ldb(const struct dsdb_schema *schema, pfm.reserved = 0; pfm.ctr.dsdb = *ctr; - ndr_err = ndr_push_struct_blob(prefixMap, mem_ctx, schema->iconv_convenience, &pfm, + ndr_err = ndr_push_struct_blob(prefixMap, mem_ctx, &pfm, (ndr_push_flags_fn_t)ndr_push_prefixMapBlob); talloc_free(ctr); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -286,7 +283,6 @@ WERROR dsdb_write_prefixes_from_schema_to_ldb(TALLOC_CTX *mem_ctx, struct ldb_co pfm_blob.ctr.dsdb = *ctr; ndr_err = ndr_push_struct_blob(&ndr_blob, temp_ctx, - lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), &pfm_blob, (ndr_push_flags_fn_t)ndr_push_prefixMapBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -326,7 +322,6 @@ WERROR dsdb_read_prefixes_from_ldb(struct ldb_context *ldb, TALLOC_CTX *mem_ctx, WERROR werr; int ldb_ret; const struct ldb_val *prefix_val; - struct smb_iconv_convenience *iconv_convenience; struct ldb_dn *schema_dn; struct ldb_result *schema_res = NULL; static const char *schema_attrs[] = { @@ -358,10 +353,7 @@ WERROR dsdb_read_prefixes_from_ldb(struct ldb_context *ldb, TALLOC_CTX *mem_ctx, return WERR_FOOBAR; } - iconv_convenience = lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")); - werr = _dsdb_prefixmap_from_ldb_val(prefix_val, - iconv_convenience, mem_ctx, _pfm); talloc_free(schema_res); @@ -704,7 +696,6 @@ WERROR dsdb_class_from_ldb(struct dsdb_schema *schema, */ int dsdb_schema_from_ldb_results(TALLOC_CTX *mem_ctx, struct ldb_context *ldb, - struct smb_iconv_convenience *iconv_convenience, struct ldb_result *schema_res, struct ldb_result *attrs_res, struct ldb_result *objectclass_res, struct dsdb_schema **schema_out, @@ -717,7 +708,7 @@ int dsdb_schema_from_ldb_results(TALLOC_CTX *mem_ctx, struct ldb_context *ldb, struct ldb_val info_val_default; struct dsdb_schema *schema; - schema = dsdb_new_schema(mem_ctx, iconv_convenience); + schema = dsdb_new_schema(mem_ctx); if (!schema) { dsdb_oom(error_string, mem_ctx); return LDB_ERR_OPERATIONS_ERROR; @@ -892,7 +883,7 @@ static struct drsuapi_DsReplicaAttribute *dsdb_find_object_attr_name(struct dsdb } \ if (_a && _a->value_ctr.num_values >= 1) { \ size_t _ret; \ - if (!convert_string_talloc_convenience(mem_ctx, s->iconv_convenience, CH_UTF16, CH_UNIX, \ + if (!convert_string_talloc(mem_ctx, CH_UTF16, CH_UNIX, \ _a->value_ctr.values[0].blob->data, \ _a->value_ctr.values[0].blob->length, \ (void **)discard_const(&(p)->elem), &_ret, false)) { \ @@ -1123,7 +1114,7 @@ WERROR dsdb_class_from_drsuapi(struct ldb_context *ldb, } status = dsdb_syntax_one_DN_drsuapi_to_ldb(mem_ctx, ldb, find_syntax_map_by_standard_oid(LDB_SYNTAX_DN), - schema->iconv_convenience, attr->value_ctr.values[0].blob, &blob); + attr->value_ctr.values[0].blob, &blob); if (!W_ERROR_IS_OK(status)) { return status; } diff --git a/source4/dsdb/schema/schema_set.c b/source4/dsdb/schema/schema_set.c index fe6ef42e8c..07d75c44a8 100644 --- a/source4/dsdb/schema/schema_set.c +++ b/source4/dsdb/schema/schema_set.c @@ -589,7 +589,7 @@ WERROR dsdb_set_schema_from_ldif(struct ldb_context *ldb, const char *pf, const goto nomem; } - schema = dsdb_new_schema(mem_ctx, lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm"))); + schema = dsdb_new_schema(mem_ctx); schema->fsmo.we_are_master = true; schema->fsmo.master_dn = ldb_dn_new_fmt(schema, ldb, "@PROVISION_SCHEMA_MASTER"); diff --git a/source4/dsdb/schema/schema_syntax.c b/source4/dsdb/schema/schema_syntax.c index a0eed3d7c0..2e6f411a7a 100644 --- a/source4/dsdb/schema/schema_syntax.c +++ b/source4/dsdb/schema/schema_syntax.c @@ -1352,8 +1352,7 @@ static WERROR dsdb_syntax_UNICODE_drsuapi_to_ldb(struct ldb_context *ldb, return WERR_FOOBAR; } - if (!convert_string_talloc_convenience(out->values, - schema->iconv_convenience, + if (!convert_string_talloc(out->values, CH_UTF16, CH_UNIX, in->value_ctr.values[i].blob->data, in->value_ctr.values[i].blob->length, @@ -1394,8 +1393,8 @@ static WERROR dsdb_syntax_UNICODE_ldb_to_drsuapi(struct ldb_context *ldb, for (i=0; i < in->num_values; i++) { out->value_ctr.values[i].blob = &blobs[i]; - if (!convert_string_talloc_convenience(blobs, - schema->iconv_convenience, CH_UNIX, CH_UTF16, + if (!convert_string_talloc(blobs, + CH_UNIX, CH_UTF16, in->values[i].data, in->values[i].length, (void **)&blobs[i].data, &blobs[i].length, false)) { return WERR_FOOBAR; @@ -1476,7 +1475,6 @@ static WERROR dsdb_syntax_UNICODE_validate_ldb(struct ldb_context *ldb, WERROR dsdb_syntax_one_DN_drsuapi_to_ldb(TALLOC_CTX *mem_ctx, struct ldb_context *ldb, const struct dsdb_syntax *syntax, - struct smb_iconv_convenience *iconv_convenience, const DATA_BLOB *in, DATA_BLOB *out) { struct drsuapi_DsReplicaObjectIdentifier3 id3; @@ -1504,7 +1502,7 @@ WERROR dsdb_syntax_one_DN_drsuapi_to_ldb(TALLOC_CTX *mem_ctx, struct ldb_context /* windows sometimes sends an extra two pad bytes here */ ndr_err = ndr_pull_struct_blob(in, - tmp_ctx, iconv_convenience, &id3, + tmp_ctx, &id3, (ndr_pull_flags_fn_t)ndr_pull_drsuapi_DsReplicaObjectIdentifier3); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { status = ndr_map_error2ntstatus(ndr_err); @@ -1536,7 +1534,7 @@ WERROR dsdb_syntax_one_DN_drsuapi_to_ldb(TALLOC_CTX *mem_ctx, struct ldb_context if (id3.__ndr_size_sid) { DATA_BLOB sid_blob; - ndr_err = ndr_push_struct_blob(&sid_blob, tmp_ctx, iconv_convenience, &id3.sid, + ndr_err = ndr_push_struct_blob(&sid_blob, tmp_ctx, &id3.sid, (ndr_push_flags_fn_t)ndr_push_dom_sid); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { status = ndr_map_error2ntstatus(ndr_err); @@ -1575,7 +1573,6 @@ static WERROR dsdb_syntax_DN_drsuapi_to_ldb(struct ldb_context *ldb, for (i=0; i < out->num_values; i++) { WERROR status = dsdb_syntax_one_DN_drsuapi_to_ldb(out->values, ldb, attr->syntax, - schema->iconv_convenience, in->value_ctr.values[i].blob, &out->values[i]); if (!W_ERROR_IS_OK(status)) { @@ -1644,7 +1641,7 @@ static WERROR dsdb_syntax_DN_ldb_to_drsuapi(struct ldb_context *ldb, id3.dn = ldb_dn_get_linearized(dn); - ndr_err = ndr_push_struct_blob(&blobs[i], blobs, schema->iconv_convenience, &id3, (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3); + ndr_err = ndr_push_struct_blob(&blobs[i], blobs, &id3, (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { status = ndr_map_error2ntstatus(ndr_err); talloc_free(tmp_ctx); @@ -1712,7 +1709,6 @@ static WERROR dsdb_syntax_DN_validate_one_val(struct ldb_context *ldb, num_components++; ndr_err = ndr_pull_struct_blob_all(sid_blob, tmp_ctx, - schema->iconv_convenience, &sid, (ndr_pull_flags_fn_t)ndr_pull_dom_sid); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -1838,7 +1834,7 @@ static WERROR dsdb_syntax_DN_BINARY_drsuapi_to_ldb(struct ldb_context *ldb, /* windows sometimes sends an extra two pad bytes here */ ndr_err = ndr_pull_struct_blob(in->value_ctr.values[i].blob, - tmp_ctx, schema->iconv_convenience, &id3, + tmp_ctx, &id3, (ndr_pull_flags_fn_t)ndr_pull_drsuapi_DsReplicaObjectIdentifier3Binary); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { status = ndr_map_error2ntstatus(ndr_err); @@ -1869,7 +1865,7 @@ static WERROR dsdb_syntax_DN_BINARY_drsuapi_to_ldb(struct ldb_context *ldb, if (id3.__ndr_size_sid) { DATA_BLOB sid_blob; - ndr_err = ndr_push_struct_blob(&sid_blob, tmp_ctx, schema->iconv_convenience, &id3.sid, + ndr_err = ndr_push_struct_blob(&sid_blob, tmp_ctx, &id3.sid, (ndr_push_flags_fn_t)ndr_push_dom_sid); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { status = ndr_map_error2ntstatus(ndr_err); @@ -1954,7 +1950,7 @@ static WERROR dsdb_syntax_DN_BINARY_ldb_to_drsuapi(struct ldb_context *ldb, if (sid_blob) { ndr_err = ndr_pull_struct_blob_all(sid_blob, - tmp_ctx, schema->iconv_convenience, &id3.sid, + tmp_ctx, &id3.sid, (ndr_pull_flags_fn_t)ndr_pull_dom_sid); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { status = ndr_map_error2ntstatus(ndr_err); @@ -1968,7 +1964,7 @@ static WERROR dsdb_syntax_DN_BINARY_ldb_to_drsuapi(struct ldb_context *ldb, /* get binary stuff */ id3.binary = dsdb_dn->extra_part; - ndr_err = ndr_push_struct_blob(&blobs[i], blobs, schema->iconv_convenience, &id3, (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3Binary); + ndr_err = ndr_push_struct_blob(&blobs[i], blobs, &id3, (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3Binary); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { status = ndr_map_error2ntstatus(ndr_err); talloc_free(tmp_ctx); @@ -2139,7 +2135,7 @@ static WERROR dsdb_syntax_PRESENTATION_ADDRESS_drsuapi_to_ldb(struct ldb_context return WERR_FOOBAR; } - if (!convert_string_talloc_convenience(out->values, schema->iconv_convenience, CH_UTF16, CH_UNIX, + if (!convert_string_talloc(out->values, CH_UTF16, CH_UNIX, in->value_ctr.values[i].blob->data+4, in->value_ctr.values[i].blob->length-4, (void **)&str, NULL, false)) { @@ -2182,7 +2178,7 @@ static WERROR dsdb_syntax_PRESENTATION_ADDRESS_ldb_to_drsuapi(struct ldb_context out->value_ctr.values[i].blob = &blobs[i]; - if (!convert_string_talloc_convenience(blobs, schema->iconv_convenience, CH_UNIX, CH_UTF16, + if (!convert_string_talloc(blobs, CH_UNIX, CH_UTF16, in->values[i].data, in->values[i].length, (void **)&data, &ret, false)) { |