From: Mark Andrews Date: Thu, 30 Aug 2001 23:51:45 +0000 (+0000) Subject: 973. [bug] Failed to log the question name when logging: X-Git-Tag: v9.2.2rc1^3~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=452b30ddb32dd9370b2e5ee10427dd3758ef98b4;p=thirdparty%2Fbind9.git 973. [bug] Failed to log the question name when logging: "bad zone transfer request: non-authoritative zone (NOTAUTH)". --- diff --git a/CHANGES b/CHANGES index fb5247d8787..81e90c654fb 100644 --- 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] diff --git a/bin/named/xfrout.c b/bin/named/xfrout.c index 6c7c7555797..c0e1197ea6e 100644 --- a/bin/named/xfrout.c +++ b/bin/named/xfrout.c @@ -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 @@ -85,6 +85,20 @@ 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);