From 5a30cd8097f043fc7466e72f6d63305883392a46 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 14 Oct 2005 05:29:44 +0000 Subject: r10983: Another case were we want to avoid DNS for unqualified names. Andrew Bartlett (This used to be commit 1d7094b8dfd53dfda55db7ce30f47f74864093bf) --- source4/heimdal/lib/krb5/get_host_realm.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'source4/heimdal/lib/krb5') diff --git a/source4/heimdal/lib/krb5/get_host_realm.c b/source4/heimdal/lib/krb5/get_host_realm.c index 78684f20a9..33a3438b12 100644 --- a/source4/heimdal/lib/krb5/get_host_realm.c +++ b/source4/heimdal/lib/krb5/get_host_realm.c @@ -233,6 +233,7 @@ krb5_get_host_realm(krb5_context context, krb5_realm **realms) { char hostname[MAXHOSTNAMELEN]; + krb5_boolean use_dns; if (host == NULL) { if (gethostname (hostname, sizeof(hostname))) @@ -240,5 +241,11 @@ krb5_get_host_realm(krb5_context context, host = hostname; } - return _krb5_get_host_realm_int (context, host, 1, realms); + if (strchr(host, '.') == NULL) { + use_dns = FALSE; + } else { + use_dns = TRUE; + } + + return _krb5_get_host_realm_int (context, host, use_dns, realms); } -- cgit