From eece94d418d5a15be2dc77c60e8c749cff237df0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Tue, 10 Jul 2007 14:21:57 +0000 Subject: [PATCH] (find_db_spec): match realm-less as the default realm. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21462 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/kadm5/context_s.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/kadm5/context_s.c b/lib/kadm5/context_s.c index 375eb1215..5dd958556 100644 --- a/lib/kadm5/context_s.c +++ b/lib/kadm5/context_s.c @@ -85,10 +85,13 @@ find_db_spec(kadm5_server_context *ctx) while ((d = hdb_dbinfo_get_next(info, d)) != NULL) { const char *p = hdb_dbinfo_get_realm(context, d); - if(strcmp(ctx->config.realm, p) != 0) + /* match default (realm-less) */ + if(p != NULL && strcmp(ctx->config.realm, p) != 0) continue; - ctx->config.dbname = strdup(p); + p = hdb_dbinfo_get_dbname(context, d); + if (p) + ctx->config.dbname = strdup(p); p = hdb_dbinfo_get_acl_file(context, d); if (p)