summaryrefslogtreecommitdiff
path: root/source4/kdc
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-02-21 14:16:02 +0100
committerJelmer Vernooij <jelmer@samba.org>2008-02-21 14:16:02 +0100
commit37deca2d41d74faa7abe060a21340263bd6d66f7 (patch)
tree6518c1de676c2ceb9358128fc6a7ff8900186499 /source4/kdc
parentee6f838d3a5aaa54b105249391aae89803901a2e (diff)
downloadsamba-37deca2d41d74faa7abe060a21340263bd6d66f7.tar.gz
samba-37deca2d41d74faa7abe060a21340263bd6d66f7.tar.bz2
samba-37deca2d41d74faa7abe060a21340263bd6d66f7.zip
Avoid use of global_loadparm.
(This used to be commit c5a95bbe0ce55c29e135a9c6058bf192ec3bb546)
Diffstat (limited to 'source4/kdc')
-rw-r--r--source4/kdc/hdb-ldb.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/source4/kdc/hdb-ldb.c b/source4/kdc/hdb-ldb.c
index 51726a03c3..d8877655c9 100644
--- a/source4/kdc/hdb-ldb.c
+++ b/source4/kdc/hdb-ldb.c
@@ -180,6 +180,7 @@ static void hdb_ldb_free_entry(krb5_context context, hdb_entry_ex *entry_ex)
}
static krb5_error_code LDB_message2entry_keys(krb5_context context,
+ struct smb_iconv_convenience *iconv_convenience,
TALLOC_CTX *mem_ctx,
struct ldb_message *msg,
unsigned int userAccountControl,
@@ -213,7 +214,7 @@ static krb5_error_code LDB_message2entry_keys(krb5_context context,
/* supplementalCredentials if present */
if (sc_val) {
- ndr_err = ndr_pull_struct_blob_all(sc_val, mem_ctx, lp_iconv_convenience(global_loadparm), &scb,
+ ndr_err = ndr_pull_struct_blob_all(sc_val, mem_ctx, iconv_convenience, &scb,
(ndr_pull_flags_fn_t)ndr_pull_supplementalCredentialsBlob);
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
dump_data(0, sc_val->data, sc_val->length);
@@ -250,7 +251,7 @@ static krb5_error_code LDB_message2entry_keys(krb5_context context,
talloc_steal(mem_ctx, blob.data);
/* TODO: use ndr_pull_struct_blob_all(), when the ndr layer handles it correct with relative pointers */
- ndr_err = ndr_pull_struct_blob(&blob, mem_ctx, lp_iconv_convenience(global_loadparm), &_pkb,
+ ndr_err = ndr_pull_struct_blob(&blob, mem_ctx, iconv_convenience, &_pkb,
(ndr_pull_flags_fn_t)ndr_pull_package_PrimaryKerberosBlob);
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
krb5_set_error_string(context, "LDB_message2entry_keys: could not parse package_PrimaryKerberosBlob");
@@ -393,6 +394,7 @@ static krb5_error_code LDB_message2entry(krb5_context context, HDB *db,
krb5_boolean is_computer = FALSE;
const char *dnsdomain = ldb_msg_find_attr_as_string(realm_ref_msg, "dnsRoot", NULL);
char *realm = strupper_talloc(mem_ctx, dnsdomain);
+ struct loadparm_context *lp_ctx = ldb_get_opaque((struct ldb_context *)db->hdb_db, "loadparm");
struct ldb_dn *domain_dn = samdb_result_dn((struct ldb_context *)db->hdb_db,
mem_ctx,
realm_ref_msg,
@@ -481,7 +483,7 @@ static krb5_error_code LDB_message2entry(krb5_context context, HDB *db,
entry_ex->entry.flags.ok_as_delegate = 1;
}
- if (lp_parm_bool(global_loadparm, NULL, "kdc", "require spn for service", true)) {
+ if (lp_parm_bool(lp_ctx, NULL, "kdc", "require spn for service", true)) {
if (!is_computer && !ldb_msg_find_attr_as_string(msg, "servicePrincipalName", NULL)) {
entry_ex->entry.flags.server = 0;
}
@@ -544,7 +546,7 @@ static krb5_error_code LDB_message2entry(krb5_context context, HDB *db,
entry_ex->entry.generation = NULL;
/* Get keys from the db */
- ret = LDB_message2entry_keys(context, private, msg, userAccountControl, entry_ex);
+ ret = LDB_message2entry_keys(context, lp_iconv_convenience(lp_ctx), private, msg, userAccountControl, entry_ex);
if (ret) {
/* Could be bougus data in the entry, or out of memory */
goto out;