From e034e05c14da4bd3ee890da4d61ec90e693d641e Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Mon, 30 Apr 2007 01:36:21 +0000 Subject: [PATCH] 2172. [bug] query_addsoa() was being called with a non zone db. [RT #16834] --- CHANGES | 3 +++ bin/named/query.c | 19 +++++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 65a1d5dda2..bd730afdf4 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +2172. [bug] query_addsoa() was being called with a non zone db. + [RT #16834] + 2171. [bug] Handle breaks in DNSSEC trust chains where the parent servers are not DS aware (DS queries to the parent return a referral to the child). diff --git a/bin/named/query.c b/bin/named/query.c index ba2b81a861..a124e2b4b0 100644 --- a/bin/named/query.c +++ b/bin/named/query.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: query.c,v 1.198.2.13.4.44 2006/12/07 04:38:19 marka Exp $ */ +/* $Id: query.c,v 1.198.2.13.4.45 2007/04/30 01:36:21 marka Exp $ */ #include @@ -2798,7 +2798,7 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype) else QUERY_ERROR(DNS_R_SERVFAIL); } else { - /* + * * This is the best answer. */ client->query.attributes |= @@ -3212,6 +3212,21 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype) * an error unless we were searching for * glue. Ugh. */ + if (!is_zone) { + authoritative = ISC_FALSE; + dns_rdatasetiter_destroy(&rdsiter); + if (RECURSIONOK(client)) { + result = query_recurse(client, + qtype, + NULL, + NULL); + if (result == ISC_R_SUCCESS) + client->query.attributes |= + NS_QUERYATTR_RECURSING; + else + QUERY_ERROR(DNS_R_SERVFAIL); } + goto addauth; + } /* * We were searching for SIG records in * a nonsecure zone. Send a "no error,