From 519e411817a2a7989645a9a87eaeb63225638bae Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Wed, 8 Dec 2004 20:20:14 +0000 Subject: [PATCH] pullup from trunk 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 | 1 + src/include/k5-int.h | 1 + src/lib/krb4/ChangeLog | 5 +++++ src/lib/krb4/RealmsConfig-glue.c | 29 ++++++++++++++++------------- src/lib/krb5/os/ChangeLog | 4 ++++ src/lib/krb5/os/accessor.c | 2 ++ 6 files changed, 29 insertions(+), 13 deletions(-) diff --git a/src/include/ChangeLog b/src/include/ChangeLog index 3f902d78b..f5f5a2d3e 100644 --- a/src/include/ChangeLog +++ b/src/include/ChangeLog @@ -1,6 +1,7 @@ 2004-12-08 Ken Raeburn * 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 diff --git a/src/include/k5-int.h b/src/include/k5-int.h index 1251f735f..8d2262ac9 100644 --- a/src/include/k5-int.h +++ b/src/include/k5-int.h @@ -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); diff --git a/src/lib/krb4/ChangeLog b/src/lib/krb4/ChangeLog index 63ef3ec97..b9258c750 100644 --- a/src/lib/krb4/ChangeLog +++ b/src/lib/krb4/ChangeLog @@ -1,3 +1,8 @@ +2004-12-08 Ken Raeburn + + * 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 * macsock.c: Deleted. diff --git a/src/lib/krb4/RealmsConfig-glue.c b/src/lib/krb4/RealmsConfig-glue.c index 0635284c0..dbdfe54cd 100644 --- a/src/lib/krb4/RealmsConfig-glue.c +++ b/src/lib/krb4/RealmsConfig-glue.c @@ -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; diff --git a/src/lib/krb5/os/ChangeLog b/src/lib/krb5/os/ChangeLog index 9c1fd0b71..1c0876503 100644 --- a/src/lib/krb5/os/ChangeLog +++ b/src/lib/krb5/os/ChangeLog @@ -1,3 +1,7 @@ +2004-12-08 Ken Raeburn + + * accessor.c (krb5int_accessor): Set new field use_dns_kdc. + 2004-12-06 Tom Yu * locate_kdc.c (krb5_locate_srv_dns_1): Don't compile if diff --git a/src/lib/krb5/os/accessor.c b/src/lib/krb5/os/accessor.c index 4e907b1c4..078e036fe 100644 --- a/src/lib/krb5/os/accessor.c +++ b/src/lib/krb5/os/accessor.c @@ -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; -- 2.26.2