Author: abartlet
Date: 2005-10-14 05:29:44 +0000 (Fri, 14 Oct 2005)
New Revision: 10983

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=10983

Log:
Another case were we want to avoid DNS for unqualified names.

Andrew Bartlett

Modified:
   branches/SAMBA_4_0/source/heimdal/lib/krb5/get_host_realm.c


Changeset:
Modified: branches/SAMBA_4_0/source/heimdal/lib/krb5/get_host_realm.c
===================================================================
--- branches/SAMBA_4_0/source/heimdal/lib/krb5/get_host_realm.c 2005-10-14 
04:04:52 UTC (rev 10982)
+++ branches/SAMBA_4_0/source/heimdal/lib/krb5/get_host_realm.c 2005-10-14 
05:29:44 UTC (rev 10983)
@@ -233,6 +233,7 @@
                    krb5_realm **realms)
 {
     char hostname[MAXHOSTNAMELEN];
+    krb5_boolean use_dns;
 
     if (host == NULL) {
        if (gethostname (hostname, sizeof(hostname)))
@@ -240,5 +241,11 @@
        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);
 }

Reply via email to