summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2009-03-10 01:28:12 +0000
committerGreg Hudson <ghudson@mit.edu>2009-03-10 01:28:12 +0000
commitbc8407661a88d924bb535d7c08136ebad5be344b (patch)
treebf87070529844016037ff17a54827a12e26c9adb /src/plugins
parent08cce764c4c96345b9c0f7d2150b8b66c9081527 (diff)
downloadkrb5-bc8407661a88d924bb535d7c08136ebad5be344b.tar.gz
krb5-bc8407661a88d924bb535d7c08136ebad5be344b.tar.xz
krb5-bc8407661a88d924bb535d7c08136ebad5be344b.zip
Rename kdb_setup_lib_handle to krb5_db_setup_lib_handle and export it.
Make kdb5_ldap_util work again by calling this function to set up dal_handle instead of using one with an uninitialized lib_handle. It is likely that kdb5_ldap_util will only function given a krb5.conf which specifies a realm with an LDAP database module as the default realm. Not sure if that was the case before. ticket: 6403 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22071 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/kdb/ldap/ldap_util/kdb5_ldap_util.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_util.c b/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_util.c
index 33511af47b..0c9929562a 100644
--- a/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_util.c
+++ b/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_util.c
@@ -297,7 +297,6 @@ int main(argc, argv)
unsigned int ldapmask = 0;
unsigned int passwd_len = 0;
char *prompt = NULL;
- kdb5_dal_handle *dal_handle = NULL;
krb5_ldap_context *ldap_context=NULL;
char *value = NULL, *conf_section = NULL;
krb5_boolean realm_name_required = TRUE;
@@ -587,12 +586,13 @@ int main(argc, argv)
cmd = cmd_lookup(cmd_argv[0]);
/* Setup DAL handle to access the database */
- dal_handle = calloc((size_t)1, sizeof(kdb5_dal_handle));
- if (dal_handle == NULL) {
+ db_retval = krb5_db_setup_lib_handle(util_context);
+ if (db_retval) {
+ com_err(progname, db_retval, "while setting up lib handle");
+ exit_status++;
goto cleanup;
}
- dal_handle->db_context = ldap_context;
- util_context->dal_handle = dal_handle;
+ util_context->dal_handle->db_context = ldap_context;
ldap_context = NULL;
db_retval = krb5_ldap_read_server_params(util_context, conf_section, KRB5_KDB_SRV_TYPE_OTHER);
@@ -603,7 +603,7 @@ int main(argc, argv)
}
if (cmd->opendb) {
- db_retval = krb5_ldap_db_init(util_context, (krb5_ldap_context *)dal_handle->db_context);
+ db_retval = krb5_ldap_db_init(util_context, (krb5_ldap_context *)util_context->dal_handle->db_context);
if (db_retval) {
com_err(progname, db_retval, "while initializing database");
exit_status++;
@@ -639,8 +639,6 @@ cleanup:
free(prompt);
if (conf_section)
free(conf_section);
- if (dal_handle)
- free(dal_handle);
if (usage_print) {
usage();