summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-01-01 22:05:05 -0600
committerStefan Metzmacher <metze@samba.org>2008-01-01 16:12:11 -0600
commit86dc05e99f124db47f2743d1fc23117a7f5145ab (patch)
treede35ed7a8a34c9efb04cfe7f94d72551ae78e176 /source4/dsdb/samdb
parentcf80a01591d57d346e42a0a0f9d662cc24ddff51 (diff)
downloadsamba-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/samdb')
-rw-r--r--source4/dsdb/samdb/ldb_modules/objectclass.c5
-rw-r--r--source4/dsdb/samdb/ldb_modules/objectguid.c5
-rw-r--r--source4/dsdb/samdb/ldb_modules/password_hash.c20
-rw-r--r--source4/dsdb/samdb/ldb_modules/repl_meta_data.c25
-rw-r--r--source4/dsdb/samdb/ldb_modules/samba3sam.c5
-rw-r--r--source4/dsdb/samdb/ldb_modules/samldb.c2
-rw-r--r--source4/dsdb/samdb/ldb_modules/simple_ldap_map.c4
7 files changed, 48 insertions, 18 deletions
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;