From a3a7d467640b54db66a11f041d2d5d87d704da38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Wed, 2 May 2007 22:57:48 +0000 Subject: [PATCH] (hdb_get_dbinfo) If there are no database specified, create one and let it use the defaults. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20576 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/hdb/dbinfo.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/hdb/dbinfo.c b/lib/hdb/dbinfo.c index 865438751..dde62a9c6 100644 --- a/lib/hdb/dbinfo.c +++ b/lib/hdb/dbinfo.c @@ -91,7 +91,6 @@ hdb_get_dbinfo(krb5_context context, struct hdb_dbinfo **dbp) const krb5_config_binding *db_binding; struct hdb_dbinfo *di, **dt, *databases; const char *default_dbname = HDB_DEFAULT_DB; - const char *default_mkey = HDB_DB_DIR "/m-key"; const char *default_acl = HDB_DB_DIR "/kadmind.acl"; const char *p; int ret; @@ -135,13 +134,11 @@ hdb_get_dbinfo(krb5_context context, struct hdb_dbinfo **dbp) } if(databases == NULL) { - /* if there are none specified, use some default */ + /* if there are none specified, create one and use defaults */ di = calloc(1, sizeof(*di)); - di->dbname = strdup(default_dbname); - di->mkey_file = strdup(default_mkey); - di->acl_file = strdup(default_acl); databases = di; } + for(di = databases; di; di = di->next) { if(di->dbname == NULL) di->dbname = strdup(default_dbname); @@ -158,7 +155,6 @@ hdb_get_dbinfo(krb5_context context, struct hdb_dbinfo **dbp) } if(di->acl_file == NULL) di->acl_file = strdup(default_acl); - } *dbp = databases; return 0;