From cf9efd9db17d9ae52165bc67455a8b756240f06c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Fri, 1 Sep 2006 10:16:28 +0000 Subject: [PATCH] (fallback_get_hosts): limit the fallback lookups to 5. Patch from Wesley Craig, umich.edu git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17958 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/krb5/krbhst.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/krb5/krbhst.c b/lib/krb5/krbhst.c index 639b4326a..2aa29b72f 100644 --- a/lib/krb5/krbhst.c +++ b/lib/krb5/krbhst.c @@ -422,6 +422,15 @@ fallback_get_hosts(krb5_context context, struct krb5_krbhst_data *kd, struct addrinfo hints; char portstr[NI_MAXSERV]; + /* + * Don't try forever in case the DNS server keep returning us + * entries (like wildcard entries or the .nu TLD) + */ + if(kd->fallback_count >= 5) { + kd->flags |= KD_FALLBACK; + return 0; + } + if(kd->fallback_count == 0) asprintf(&host, "%s.%s.", serv_string, kd->realm); else