From fbf106f6701c580f5839da575996de34fc953e1f Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 15 Dec 2005 20:38:24 +0000 Subject: r12269: Update to current lorikeet-heimdal. This changed the way the hdb interface worked, so hdb-ldb.c and the glue have been updated. Andrew Bartlett (This used to be commit 8fd5224c6b5c17c3a2c04c7366b7e367012db77e) --- source4/heimdal/lib/krb5/set_default_realm.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'source4/heimdal/lib/krb5/set_default_realm.c') diff --git a/source4/heimdal/lib/krb5/set_default_realm.c b/source4/heimdal/lib/krb5/set_default_realm.c index 965883309c..fd57b6fe67 100644 --- a/source4/heimdal/lib/krb5/set_default_realm.c +++ b/source4/heimdal/lib/krb5/set_default_realm.c @@ -77,8 +77,19 @@ krb5_set_default_realm(krb5_context context, "libdefaults", "default_realm", NULL); - if (realms == NULL) - ret = krb5_get_host_realm(context, NULL, &realms); + if (realms == NULL) { + char hostname[MAXHOSTNAMELEN]; + if (gethostname (hostname, sizeof(hostname))) { + return errno; + } + + if (strchr(hostname, '.') == NULL) { + /* There is no way we can get this mapping, as we can't do DNS */ + return KRB5_CONFIG_NODEFREALM; + } + ret = krb5_get_host_realm(context, hostname, + &realms); + } } else { ret = string_to_list (context, realm, &realms); } -- cgit