summaryrefslogtreecommitdiffstats
path: root/source/heimdal/lib/krb5/set_default_realm.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/heimdal/lib/krb5/set_default_realm.c')
-rw-r--r--source/heimdal/lib/krb5/set_default_realm.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/source/heimdal/lib/krb5/set_default_realm.c b/source/heimdal/lib/krb5/set_default_realm.c
index fd57b6fe679..965883309c0 100644
--- a/source/heimdal/lib/krb5/set_default_realm.c
+++ b/source/heimdal/lib/krb5/set_default_realm.c
@@ -77,19 +77,8 @@ krb5_set_default_realm(krb5_context context,
"libdefaults",
"default_realm",
NULL);
- 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);
- }
+ if (realms == NULL)
+ ret = krb5_get_host_realm(context, NULL, &realms);
} else {
ret = string_to_list (context, realm, &realms);
}