From 88779e01acedcd7fd78d52b0363f352b12fdbe3e Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Mon, 25 Jul 2011 13:46:53 +0000 Subject: [PATCH] Fix build without KRB5_DNS_LOOKUP Define MAX_DNS_NAMELEN unconditionally in k5-int.h as we use it unconditionally in kdc_util.c. Don't define it in locate_kdc.c. Conditionalize dns_locate_server() in locate_kdc.c as its only call site (in k5_locate_server) and its helper function (locate_srv_dns_1) are conditional. From Chris Hecker with minor changes. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25042 dc483132-0cff-0310-8789-dd5450dbe970 --- src/include/k5-int.h | 2 +- src/lib/krb5/os/locate_kdc.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/include/k5-int.h b/src/include/k5-int.h index a4ac496c2..2ca649ee7 100644 --- a/src/include/k5-int.h +++ b/src/include/k5-int.h @@ -2094,10 +2094,10 @@ struct srv_dns_entry { unsigned short port; char *host; }; -#ifdef KRB5_DNS_LOOKUP #define MAX_DNS_NAMELEN (15*(MAXHOSTNAMELEN + 1)+1) +#ifdef KRB5_DNS_LOOKUP krb5_error_code krb5int_make_srv_query_realm(const krb5_data *realm, const char *service, diff --git a/src/lib/krb5/os/locate_kdc.c b/src/lib/krb5/os/locate_kdc.c index c2ae0fadb..8bcfb2678 100644 --- a/src/lib/krb5/os/locate_kdc.c +++ b/src/lib/krb5/os/locate_kdc.c @@ -47,8 +47,6 @@ #define MAXHOSTNAMELEN 64 #endif -#define MAX_DNS_NAMELEN (15*(MAXHOSTNAMELEN + 1)+1) - #if KRB5_DNS_LOOKUP_KDC #define DEFAULT_LOOKUP_KDC 1 #else @@ -520,6 +518,7 @@ prof_locate_server(krb5_context context, const krb5_data *realm, dflport1, dflport2); } +#ifdef KRB5_DNS_LOOKUP static krb5_error_code dns_locate_server(krb5_context context, const krb5_data *realm, struct serverlist *serverlist, enum locate_service_type svc, @@ -565,6 +564,7 @@ dns_locate_server(krb5_context context, const krb5_data *realm, } return code; } +#endif /* KRB5_DNS_LOOKUP */ /* * Wrapper function for the various backends -- 2.26.2