pullup from trunk
authorTom Yu <tlyu@mit.edu>
Wed, 8 Dec 2004 20:20:14 +0000 (20:20 +0000)
committerTom Yu <tlyu@mit.edu>
Wed, 8 Dec 2004 20:20:14 +0000 (20:20 +0000)
ticket: 2772
version_fixed: 1.4

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-4@16922 dc483132-0cff-0310-8789-dd5450dbe970

src/include/ChangeLog
src/include/k5-int.h
src/lib/krb4/ChangeLog
src/lib/krb4/RealmsConfig-glue.c
src/lib/krb5/os/ChangeLog
src/lib/krb5/os/accessor.c

index 3f902d78bcce7fcdc0320eba58768713aa5574e1..f5f5a2d3ea9d2ae7a5f75dc3f1ed50309bdd1767 100644 (file)
@@ -1,6 +1,7 @@
 2004-12-08  Ken Raeburn  <raeburn@mit.edu>
 
        * k5-int.h (KRB5INT_ACCESS_STRUCT_VERSION): Bump to 9.
+       (struct _krb5int_access): Add function pointer field use_dns_kdc.
 
 2004-10-29  Ken Raeburn  <raeburn@mit.edu>
 
index 1251f735fce4ff64788f2edca9ef134e50ee0b9e..8d2262ac9aebe49ead7730b7218fd3255bfbc424 100644 (file)
@@ -1704,6 +1704,7 @@ typedef struct _krb5int_access {
                                            const char *protocol,
                                            struct srv_dns_entry **answers);
     void (*free_srv_dns_data)(struct srv_dns_entry *);
+    int (*use_dns_kdc)(krb5_context);
 
     /* krb4 compatibility stuff -- may be null if not enabled */
     krb5_int32 (*krb_life_to_time)(krb5_int32, int);
index 63ef3ec9782d9ad805655f3aba910fca43fd485e..b9258c750427bfb113111b795c1334c0d828caff 100644 (file)
@@ -1,3 +1,8 @@
+2004-12-08  Ken Raeburn  <raeburn@mit.edu>
+
+       * RealmsConfig-glue.c (krb_get_krbhst): Check if DNS should be
+       used for getting KDC names before actually using it.
+
 2004-07-16  Ken Raeburn  <raeburn@mit.edu>
 
        * macsock.c: Deleted.
index 0635284c05b54d4b63c92c59b1d801c751e8bd9c..dbdfe54cd1ccb7ed73803c88f63b9a4665bf0a81 100644 (file)
@@ -536,21 +536,24 @@ krb_get_krbhst(
        if (err)
            break;
 
-       realmdat.data = realm;
-       realmdat.length = strlen(realm);
-       err = k5.make_srv_query_realm(&realmdat, "_kerberos-iv", "_udp", &srv);
-       if (err)
-           break;
+       if (k5.use_dns_kdc(krb5__krb4_context)) {
+           realmdat.data = realm;
+           realmdat.length = strlen(realm);
+           err = k5.make_srv_query_realm(&realmdat, "_kerberos-iv", "_udp",
+                                         &srv);
+           if (err)
+               break;
 
-       if (srv == 0)
-           break;
+           if (srv == 0)
+               break;
 
-       if (dnscache.srv)
-           k5.free_srv_dns_data(dnscache.srv);
-       dnscache.srv = srv;
-       strncpy(dnscache.realm, realm, REALM_SZ);
-       dnscache.when = now;
-       goto get_from_dnscache;
+           if (dnscache.srv)
+               k5.free_srv_dns_data(dnscache.srv);
+           dnscache.srv = srv;
+           strncpy(dnscache.realm, realm, REALM_SZ);
+           dnscache.when = now;
+           goto get_from_dnscache;
+       }
     } while (0);
 #endif
     return KFAILURE;
index 9c1fd0b71da8c30d13966e0f188abdeb54a77f78..1c08765036fc93413161c6cc243bb2a308cb9612 100644 (file)
@@ -1,3 +1,7 @@
+2004-12-08  Ken Raeburn  <raeburn@mit.edu>
+
+       * accessor.c (krb5int_accessor): Set new field use_dns_kdc.
+
 2004-12-06  Tom Yu  <tlyu@mit.edu>
 
        * locate_kdc.c (krb5_locate_srv_dns_1): Don't compile if
index 4e907b1c4d1292652fadbd1640d9d36decba08e7..078e036fedf9899c54412849edf7c8cb8abf0026 100644 (file)
@@ -45,9 +45,11 @@ krb5int_accessor(krb5int_access *internals, krb5_int32 version)
 #ifdef KRB5_DNS_LOOKUP
     internals_temp.make_srv_query_realm = krb5int_make_srv_query_realm;
     internals_temp.free_srv_dns_data = krb5int_free_srv_dns_data;
+    internals_temp.use_dns_kdc = _krb5_use_dns_kdc;
 #else
     internals_temp.make_srv_query_realm = 0;
     internals_temp.free_srv_dns_data = 0;
+    internals_temp.use_dns_kdc = 0;
 #endif
 #ifdef KRB5_KRB4_COMPAT
     internals_temp.krb_life_to_time = krb5int_krb_life_to_time;