]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
973. [bug] Failed to log the question name when logging:
authorMark Andrews <marka@isc.org>
Thu, 30 Aug 2001 23:51:45 +0000 (23:51 +0000)
committerMark Andrews <marka@isc.org>
Thu, 30 Aug 2001 23:51:45 +0000 (23:51 +0000)
                        "bad zone transfer request: non-authoritative zone
                        (NOTAUTH)".

CHANGES
bin/named/xfrout.c

diff --git a/CHANGES b/CHANGES
index fb5247d8787120820712278587798e5451fd11bb..81e90c654fb14cf7bb886a0f5e946f64c91b5c12 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+ 973.  [bug]           Failed to log the question name when logging:
+                       "bad zone transfer request: non-authoritative zone
+                       (NOTAUTH)".
+
  972.  [bug]           The file modification time code in zone.c was using the
                        wrong epoch.  [RT #1667]
 
index 6c7c7555797f16080ba3c2ab0695a37f366a4163..c0e1197ea6eabc8ce29d60bc86d660eaf2ff7e78 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: xfrout.c,v 1.101 2001/08/08 22:54:22 gson Exp $ */
+/* $Id: xfrout.c,v 1.102 2001/08/30 23:51:45 marka Exp $ */
 
 #include <config.h>
 
                if (result != ISC_R_SUCCESS) goto failure;      \
        } while (0)
 
+#define FAILQ(code, msg, question, rdclass) \
+       do {                                                    \
+               char _buf1[DNS_NAME_FORMATSIZE];                \
+               char _buf2[DNS_RDATACLASS_FORMATSIZE];          \
+               result = (code);                                \
+               dns_name_format(question, _buf1, sizeof(_buf1));  \
+               dns_rdataclass_format(rdclass, _buf2, sizeof(_buf2)); \
+               ns_client_log(client, DNS_LOGCATEGORY_XFER_OUT, \
+                          NS_LOGMODULE_XFER_OUT, ISC_LOG_INFO, \
+                          "bad zone transfer request: '%s/%s' %s (%s)", \
+                          _buf1, _buf2, msg, isc_result_totext(code)); \
+               if (result != ISC_R_SUCCESS) goto failure;      \
+       } while (0)
+
 #define CHECK(op) \
        do { result = (op);                                     \
                if (result != ISC_R_SUCCESS) goto failure;      \
@@ -926,13 +940,15 @@ ns_xfr_start(ns_client_t *client, dns_rdatatype_t reqtype) {
        result = dns_zt_find(client->view->zonetable, question_name, 0, NULL,
                             &zone);
        if (result != ISC_R_SUCCESS)
-               FAILC(DNS_R_NOTAUTH, "non-authoritative zone");
+               FAILQ(DNS_R_NOTAUTH, "non-authoritative zone",
+                     question_name, question_class);
        switch(dns_zone_gettype(zone)) {
        case dns_zone_master:
        case dns_zone_slave:
                break;  /* Master and slave zones are OK for transfer. */
        default:
-               FAILC(DNS_R_NOTAUTH, "non-authoritative zone");
+               FAILQ(DNS_R_NOTAUTH, "non-authoritative zone",
+                     question_name, question_class);
        }
        CHECK(dns_zone_getdb(zone, &db));
        dns_db_currentversion(db, &ver);