diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-01-01 22:05:05 -0600 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2008-01-01 16:12:11 -0600 |
commit | 86dc05e99f124db47f2743d1fc23117a7f5145ab (patch) | |
tree | de35ed7a8a34c9efb04cfe7f94d72551ae78e176 /source4/dsdb | |
parent | cf80a01591d57d346e42a0a0f9d662cc24ddff51 (diff) | |
download | samba-86dc05e99f124db47f2743d1fc23117a7f5145ab.tar.gz samba-86dc05e99f124db47f2743d1fc23117a7f5145ab.tar.bz2 samba-86dc05e99f124db47f2743d1fc23117a7f5145ab.zip |
r26638: libndr: Require explicitly specifying iconv_convenience for ndr_struct_push_blob().
(This used to be commit 61ad78ac98937ef7a9aa32075a91a1c95b7606b3)
Diffstat (limited to 'source4/dsdb')
-rw-r--r-- | source4/dsdb/common/util.c | 5 | ||||
-rw-r--r-- | source4/dsdb/repl/replicated_objects.c | 5 | ||||
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/objectclass.c | 5 | ||||
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/objectguid.c | 5 | ||||
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/password_hash.c | 20 | ||||
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/repl_meta_data.c | 25 | ||||
-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/simple_ldap_map.c | 4 | ||||
-rw-r--r-- | source4/dsdb/schema/schema_init.c | 2 | ||||
-rw-r--r-- | source4/dsdb/schema/schema_syntax.c | 5 |
11 files changed, 59 insertions, 24 deletions
diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c index efc1b20ae0..ea623a3d4a 100644 --- a/source4/dsdb/common/util.c +++ b/source4/dsdb/common/util.c @@ -31,6 +31,7 @@ #include "dsdb/common/flags.h" #include "dsdb/common/proto.h" #include "libcli/ldap/ldap_ndr.h" +#include "param/param.h" #include "libcli/auth/libcli_auth.h" /* @@ -674,7 +675,9 @@ int samdb_msg_add_dom_sid(struct ldb_context *sam_ldb, TALLOC_CTX *mem_ctx, stru struct ldb_val v; enum ndr_err_code ndr_err; - ndr_err = ndr_push_struct_blob(&v, mem_ctx, sid, + 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)) { return -1; diff --git a/source4/dsdb/repl/replicated_objects.c b/source4/dsdb/repl/replicated_objects.c index c47108559d..8aff1340a5 100644 --- a/source4/dsdb/repl/replicated_objects.c +++ b/source4/dsdb/repl/replicated_objects.c @@ -28,6 +28,7 @@ #include "librpc/gen_ndr/ndr_drsblobs.h" #include "lib/crypto/crypto.h" #include "libcli/auth/libcli_auth.h" +#include "param/param.h" static WERROR dsdb_decrypt_attribute_value(TALLOC_CTX *mem_ctx, const DATA_BLOB *gensec_skey, @@ -322,7 +323,9 @@ static WERROR dsdb_convert_object(struct ldb_context *ldb, whenChanged_s = ldb_timestring(msg, whenChanged_t); W_ERROR_HAVE_NO_MEMORY(whenChanged_s); - ndr_err = ndr_push_struct_blob(&guid_value, msg, &in->object.identifier->guid, + ndr_err = ndr_push_struct_blob(&guid_value, msg, + lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), + &in->object.identifier->guid, (ndr_push_flags_fn_t)ndr_push_GUID); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { nt_status = ndr_map_error2ntstatus(ndr_err); diff --git a/source4/dsdb/samdb/ldb_modules/objectclass.c b/source4/dsdb/samdb/ldb_modules/objectclass.c index da5cae1c65..d3beedc689 100644 --- a/source4/dsdb/samdb/ldb_modules/objectclass.c +++ b/source4/dsdb/samdb/ldb_modules/objectclass.c @@ -43,6 +43,7 @@ #include "librpc/gen_ndr/ndr_security.h" #include "libcli/security/security.h" #include "auth/auth.h" +#include "param/param.h" struct oc_context { @@ -273,7 +274,9 @@ static DATA_BLOB *get_sd(struct ldb_module *module, TALLOC_CTX *mem_ctx, return NULL; } - ndr_err = ndr_push_struct_blob(linear_sd, mem_ctx, sd, + ndr_err = ndr_push_struct_blob(linear_sd, mem_ctx, + lp_iconv_convenience(ldb_get_opaque(module->ldb, "loadparm")), + sd, (ndr_push_flags_fn_t)ndr_push_security_descriptor); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { return NULL; diff --git a/source4/dsdb/samdb/ldb_modules/objectguid.c b/source4/dsdb/samdb/ldb_modules/objectguid.c index e9d699d59c..bf57f5c21b 100644 --- a/source4/dsdb/samdb/ldb_modules/objectguid.c +++ b/source4/dsdb/samdb/ldb_modules/objectguid.c @@ -36,6 +36,7 @@ #include "includes.h" #include "ldb/include/ldb_includes.h" #include "librpc/gen_ndr/ndr_misc.h" +#include "param/param.h" static struct ldb_message_element *objectguid_find_attribute(const struct ldb_message *msg, const char *name) { @@ -143,7 +144,9 @@ static int objectguid_add(struct ldb_module *module, struct ldb_request *req) /* a new GUID */ guid = GUID_random(); - ndr_err = ndr_push_struct_blob(&v, msg, &guid, + ndr_err = ndr_push_struct_blob(&v, msg, + lp_iconv_convenience(ldb_get_opaque(module->ldb, "loadparm")), + &guid, (ndr_push_flags_fn_t)ndr_push_GUID); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(down_req); diff --git a/source4/dsdb/samdb/ldb_modules/password_hash.c b/source4/dsdb/samdb/ldb_modules/password_hash.c index d139cc23a4..a69459cfef 100644 --- a/source4/dsdb/samdb/ldb_modules/password_hash.c +++ b/source4/dsdb/samdb/ldb_modules/password_hash.c @@ -913,7 +913,9 @@ static int setup_supplemental_field(struct setup_password_fields_io *io) return ret; } - ndr_err = ndr_push_struct_blob(&pkb_blob, io->ac, &pkb, + ndr_err = ndr_push_struct_blob(&pkb_blob, io->ac, + lp_iconv_convenience(ldb_get_opaque(io->ac->module->ldb, "loadparm")), + &pkb, (ndr_push_flags_fn_t)ndr_push_package_PrimaryKerberosBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { NTSTATUS status = ndr_map_error2ntstatus(ndr_err); @@ -952,7 +954,9 @@ static int setup_supplemental_field(struct setup_password_fields_io *io) return ret; } - ndr_err = ndr_push_struct_blob(&pdb_blob, io->ac, &pdb, + ndr_err = ndr_push_struct_blob(&pdb_blob, io->ac, + lp_iconv_convenience(ldb_get_opaque(io->ac->module->ldb, "loadparm")), + &pdb, (ndr_push_flags_fn_t)ndr_push_package_PrimaryWDigestBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { NTSTATUS status = ndr_map_error2ntstatus(ndr_err); @@ -979,7 +983,9 @@ static int setup_supplemental_field(struct setup_password_fields_io *io) pcb.cleartext = io->n.cleartext; - ndr_err = ndr_push_struct_blob(&pcb_blob, io->ac, &pcb, + ndr_err = ndr_push_struct_blob(&pcb_blob, io->ac, + lp_iconv_convenience(ldb_get_opaque(io->ac->module->ldb, "loadparm")), + &pcb, (ndr_push_flags_fn_t)ndr_push_package_PrimaryCLEARTEXTBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { NTSTATUS status = ndr_map_error2ntstatus(ndr_err); @@ -1002,7 +1008,9 @@ static int setup_supplemental_field(struct setup_password_fields_io *io) /* * setup 'Packages' element */ - ndr_err = ndr_push_struct_blob(&pb_blob, io->ac, &pb, + ndr_err = ndr_push_struct_blob(&pb_blob, io->ac, + lp_iconv_convenience(ldb_get_opaque(io->ac->module->ldb, "loadparm")), + &pb, (ndr_push_flags_fn_t)ndr_push_package_PackagesBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { NTSTATUS status = ndr_map_error2ntstatus(ndr_err); @@ -1027,7 +1035,9 @@ static int setup_supplemental_field(struct setup_password_fields_io *io) scb.sub.num_packages = num_packages; scb.sub.packages = packages; - ndr_err = ndr_push_struct_blob(&io->g.supplemental, io->ac, &scb, + ndr_err = ndr_push_struct_blob(&io->g.supplemental, io->ac, + lp_iconv_convenience(ldb_get_opaque(io->ac->module->ldb, "loadparm")), + &scb, (ndr_push_flags_fn_t)ndr_push_supplementalCredentialsBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { NTSTATUS status = ndr_map_error2ntstatus(ndr_err); diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c index 497ee373de..87b9302139 100644 --- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c +++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c @@ -47,6 +47,7 @@ #include "librpc/gen_ndr/ndr_misc.h" #include "librpc/gen_ndr/ndr_drsuapi.h" #include "librpc/gen_ndr/ndr_drsblobs.h" +#include "param/param.h" struct replmd_replicated_request { struct ldb_module *module; @@ -518,13 +519,17 @@ static int replmd_add_originating(struct ldb_module *module, replmd_replPropertyMetaDataCtr1_sort(&nmd.ctr.ctr1, &rdn_attr->attributeID_id); /* generated NDR encoded values */ - ndr_err = ndr_push_struct_blob(&guid_value, msg, &guid, + ndr_err = ndr_push_struct_blob(&guid_value, msg, + NULL, + &guid, (ndr_push_flags_fn_t)ndr_push_GUID); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { ldb_oom(module->ldb); return LDB_ERR_OPERATIONS_ERROR; } - ndr_err = ndr_push_struct_blob(&nmd_value, msg, &nmd, + ndr_err = ndr_push_struct_blob(&nmd_value, msg, + lp_iconv_convenience(ldb_get_opaque(module->ldb, "loadparm")), + &nmd, (ndr_push_flags_fn_t)ndr_push_replPropertyMetaDataBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(down_req); @@ -773,7 +778,9 @@ 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 = seq_num; } - ndr_err = ndr_push_struct_blob(&md_value, msg, md, + ndr_err = ndr_push_struct_blob(&md_value, msg, + lp_iconv_convenience(global_loadparm), + 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); @@ -985,7 +992,9 @@ 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, &nmd, + ndr_err = ndr_push_struct_blob(&nmd_value, msg, + lp_iconv_convenience(global_loadparm), + &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); @@ -1350,7 +1359,9 @@ static int replmd_replicated_uptodate_modify(struct replmd_replicated_request *a if (!msg) return replmd_replicated_request_werror(ar, WERR_NOMEM); msg->dn = ar->sub.search_msg->dn; - ndr_err = ndr_push_struct_blob(&nuv_value, msg, &nuv, + ndr_err = ndr_push_struct_blob(&nuv_value, msg, + lp_iconv_convenience(global_loadparm), + &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); @@ -1437,7 +1448,9 @@ 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, &nrf, + ndr_err = ndr_push_struct_blob(nrf_value, msg, + lp_iconv_convenience(global_loadparm), + &nrf, (ndr_push_flags_fn_t)ndr_push_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/samba3sam.c b/source4/dsdb/samdb/ldb_modules/samba3sam.c index 0d4fead2b5..c8266a5f46 100644 --- a/source4/dsdb/samdb/ldb_modules/samba3sam.c +++ b/source4/dsdb/samdb/ldb_modules/samba3sam.c @@ -187,8 +187,9 @@ static struct ldb_val encode_sid(struct ldb_module *module, TALLOC_CTX *ctx, con return out; } - ndr_err = ndr_push_struct_blob(&out, ctx, sid, - (ndr_push_flags_fn_t)ndr_push_dom_sid); + 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)) { return out; diff --git a/source4/dsdb/samdb/ldb_modules/samldb.c b/source4/dsdb/samdb/ldb_modules/samldb.c index 3638b91799..8a80260a69 100644 --- a/source4/dsdb/samdb/ldb_modules/samldb.c +++ b/source4/dsdb/samdb/ldb_modules/samldb.c @@ -50,7 +50,7 @@ static bool samldb_msg_add_sid(struct ldb_module *module, struct ldb_message *ms struct ldb_val v; enum ndr_err_code ndr_err; - ndr_err = ndr_push_struct_blob(&v, msg, sid, + ndr_err = ndr_push_struct_blob(&v, msg, NULL, 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/simple_ldap_map.c b/source4/dsdb/samdb/ldb_modules/simple_ldap_map.c index 7efcccc9ff..070ce6ae69 100644 --- a/source4/dsdb/samdb/ldb_modules/simple_ldap_map.c +++ b/source4/dsdb/samdb/ldb_modules/simple_ldap_map.c @@ -49,7 +49,7 @@ static struct ldb_val encode_guid(struct ldb_module *module, TALLOC_CTX *ctx, co if (!NT_STATUS_IS_OK(status)) { return out; } - ndr_err = ndr_push_struct_blob(&out, ctx, &guid, + ndr_err = ndr_push_struct_blob(&out, ctx, NULL, &guid, (ndr_push_flags_fn_t)ndr_push_GUID); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { return out; @@ -93,7 +93,7 @@ static struct ldb_val encode_ns_guid(struct ldb_module *module, TALLOC_CTX *ctx, if (!NT_STATUS_IS_OK(status)) { return out; } - ndr_err = ndr_push_struct_blob(&out, ctx, &guid, + ndr_err = ndr_push_struct_blob(&out, ctx, NULL, &guid, (ndr_push_flags_fn_t)ndr_push_GUID); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { return out; diff --git a/source4/dsdb/schema/schema_init.c b/source4/dsdb/schema/schema_init.c index f15b03c9b4..80cd8040e4 100644 --- a/source4/dsdb/schema/schema_init.c +++ b/source4/dsdb/schema/schema_init.c @@ -174,7 +174,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, &pfm, + ndr_err = ndr_push_struct_blob(prefixMap, mem_ctx, lp_iconv_convenience(global_loadparm), &pfm, (ndr_push_flags_fn_t)ndr_push_prefixMapBlob); talloc_free(ctr); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { diff --git a/source4/dsdb/schema/schema_syntax.c b/source4/dsdb/schema/schema_syntax.c index a8fe4a3b9d..6490e8740f 100644 --- a/source4/dsdb/schema/schema_syntax.c +++ b/source4/dsdb/schema/schema_syntax.c @@ -898,8 +898,7 @@ static WERROR dsdb_syntax_DN_ldb_to_drsuapi(const struct dsdb_schema *schema, ZERO_STRUCT(id3); id3.dn = (const char *)in->values[i].data; - ndr_err = ndr_push_struct_blob(&blobs[i], blobs, &id3, - (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3); + ndr_err = ndr_push_struct_blob(&blobs[i], blobs, lp_iconv_convenience(global_loadparm), &id3, (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { NTSTATUS status = ndr_map_error2ntstatus(ndr_err); return ntstatus_to_werror(status); @@ -998,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, &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); |