From: Mark Andrews Date: Thu, 24 Jan 2002 03:49:04 +0000 (+0000) Subject: pullup: X-Git-Tag: v9.2.0^2~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2a091ec9326b0e108a7af35823d412f9a2e7317b;p=thirdparty%2Fbind9.git pullup: 988. [bug] 'additional-from-auth no;' did not work reliably in the case of queries answered from the cache. [RT #1436] --- diff --git a/CHANGES b/CHANGES index 0aae8fceadc..c19f1aab0d7 100644 --- a/CHANGES +++ b/CHANGES @@ -100,6 +100,10 @@ 1012. [bug] The -p option to named did not behave as documented. + 988. [bug] 'additional-from-auth no;' did not work reliably + in the case of queries answered from the cache. + [RT #1436] + --- 9.2.0 released --- 1134. [bug] Multithreaded servers could deadlock in ferror() diff --git a/bin/named/include/named/query.h b/bin/named/include/named/query.h index ada1fbd78a1..8840338b8ac 100644 --- a/bin/named/include/named/query.h +++ b/bin/named/include/named/query.h @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: query.h,v 1.28 2001/03/14 19:33:00 halley Exp $ */ +/* $Id: query.h,v 1.28.2.1 2002/01/24 03:49:02 marka Exp $ */ #ifndef NAMED_QUERY_H #define NAMED_QUERY_H 1 @@ -46,6 +46,7 @@ struct ns_query { unsigned int fetchoptions; dns_db_t * gluedb; dns_db_t * authdb; + isc_boolean_t authdbvalid; dns_fetch_t * fetch; dns_a6context_t a6ctx; isc_bufferlist_t namebufs; diff --git a/bin/named/query.c b/bin/named/query.c index 66506710ade..270fdc7f06d 100644 --- a/bin/named/query.c +++ b/bin/named/query.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: query.c,v 1.198.2.2 2001/11/27 00:43:06 marka Exp $ */ +/* $Id: query.c,v 1.198.2.3 2002/01/24 03:49:01 marka Exp $ */ #include @@ -246,7 +246,7 @@ query_reset(ns_client_t *client, isc_boolean_t everything) { client->query.dboptions = 0; client->query.fetchoptions = 0; client->query.gluedb = NULL; - client->query.authdb = NULL; + client->query.authdbvalid = ISC_FALSE; } static void @@ -473,6 +473,7 @@ ns_query_init(ns_client_t *client) { client->query.qname = NULL; client->query.fetch = NULL; client->query.authdb = NULL; + client->query.authdbvalid = ISC_FALSE; query_reset(client, ISC_FALSE); result = query_newdbversion(client, 3); if (result != ISC_R_SUCCESS) @@ -550,25 +551,15 @@ query_getzonedb(ns_client_t *client, dns_name_t *name, unsigned int options, goto fail; /* - * If this is the first time we are called (that is, looking up - * the actual name in the query section) remember this database. - * - * If authdb is non-NULL, we have been here before, and the - * found database is always returned. - * * This limits our searching to the zone where the first name - * (the query target) is found. This prevents following CNAMES - * or DNAMES into other zones and prevents returning additional - * data from other zones. + * (the query target) was looked for. This prevents following + * CNAMES or DNAMES into other zones and prevents returning + * additional data from other zones. */ - if (!client->view->additionalfromauth) { - if (client->query.authdb != NULL) { - if (db != client->query.authdb) - goto refuse; - } else { - dns_db_attach(db, &client->query.authdb); - } - } + if (!client->view->additionalfromauth && + client->query.authdbvalid && + db != client->query.authdb) + goto refuse; /* * If the zone has an ACL, we'll check it, otherwise @@ -2442,6 +2433,12 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype) if (is_zone) authoritative = ISC_TRUE; + + if (event == NULL && client->query.restarts == 0) { + if (is_zone) + dns_db_attach(db, &client->query.authdb); + client->query.authdbvalid = ISC_TRUE; + } db_find: CTRACE("query_find: db_find");