* include/k5-int.h (struct _krb5int_access): Add function pointer field
authorKen Raeburn <raeburn@mit.edu>
Wed, 8 Dec 2004 06:04:49 +0000 (06:04 +0000)
committerKen Raeburn <raeburn@mit.edu>
Wed, 8 Dec 2004 06:04:49 +0000 (06:04 +0000)
use_dns_kdc.
* lib/krb5/os/accessor.c (krb5int_accessor): Set new field use_dns_kdc.
* lib/krb4/RealmsConfig-glue.c (krb_get_krbhst): Check if DNS should be used
for getting KDC names before actually using it.

ticket: 2772

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16920 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 5cb27111d15304593c464ce5ad58a05993734df8..fa9f14aa762014ea563c05e53622e5ab185eea6d 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-12-06  Ken Raeburn  <raeburn@mit.edu>
 
index 5ad06d2b47d34ac2df20bf00fe5efa6b32cd7f8a..1d913ed99801bc68e8b3be1f4afa35cdc6646db6 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;