]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
pullup:
authorMark Andrews <marka@isc.org>
Thu, 24 Jan 2002 03:49:04 +0000 (03:49 +0000)
committerMark Andrews <marka@isc.org>
Thu, 24 Jan 2002 03:49:04 +0000 (03:49 +0000)
 988.   [bug]           'additional-from-auth no;' did not work reliably
                        in the case of queries answered from the cache.
                        [RT #1436]

CHANGES
bin/named/include/named/query.h
bin/named/query.c

diff --git a/CHANGES b/CHANGES
index 0aae8fceadc52c246760b873c54cd6d111998990..c19f1aab0d7b3d267482aa6fa5c22dd5cfc36a09 100644 (file)
--- a/CHANGES
+++ b/CHANGES
 
 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()
index ada1fbd78a1faa8f4a6926c8469065795cd03f43..8840338b8ac3eeb645d8a6a1781641800719f081 100644 (file)
@@ -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;
index 66506710ade1d5aed26988ef3b4dcb2bc50455de..270fdc7f06d17be8c5ac1935c78336ed663fd91b 100644 (file)
@@ -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 <config.h>
 
@@ -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");