From d26d184367f4d4b7a8691395a4c6302338535755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Sun, 9 Dec 2007 05:59:34 +0000 Subject: [PATCH] Use hdb_db_dir(). git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22252 ec53bebd-3082-4978-b11e-865c3cabbd6b --- kpasswd/kpasswdd.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/kpasswd/kpasswdd.c b/kpasswd/kpasswdd.c index 76805ef55..ed98e21db 100644 --- a/kpasswd/kpasswdd.c +++ b/kpasswd/kpasswdd.c @@ -711,15 +711,15 @@ sigterm(int sig) exit_flag = 1; } -const char *check_library = NULL; -const char *check_function = NULL; +static const char *check_library = NULL; +static const char *check_function = NULL; static getarg_strings policy_libraries = { 0, NULL }; -char *keytab_str = "HDB:"; -char *realm_str; -int version_flag; -int help_flag; -char *port_str; -char *config_file; +static char *keytab_str = "HDB:"; +static char *realm_str; +static int version_flag; +static int help_flag; +static char *port_str; +static char *config_file; struct getargs args[] = { #ifdef HAVE_DLOPEN @@ -760,8 +760,11 @@ main (int argc, char **argv) exit(0); } - if (config_file == NULL) - config_file = HDB_DB_DIR "/kdc.conf"; + if (config_file == NULL) { + asprintf(&config_file, "%s/kdc.conf", hdb_db_dir(context)); + if (config_file == NULL) + errx(1, "out of memory"); + } ret = krb5_prepend_config_files_default(config_file, &files); if (ret)