diff --git a/CHANGES b/CHANGES index 2ceab6069e..c2da2d5539 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ + 756. [bug] dns_zone_load() could "return" success when no master + file was configured. + + 755. [bug] Fix format bugs in zone.c (non-exploitable). 754. [bug] Certain failure returns from sendto() could cause the server to retry the transmission diff --git a/lib/dns/include/dns/result.h b/lib/dns/include/dns/result.h index 9451c3dbd1..7ffe420ed1 100644 --- a/lib/dns/include/dns/result.h +++ b/lib/dns/include/dns/result.h @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: result.h,v 1.77 2001/01/09 21:53:24 bwelling Exp $ */ +/* $Id: result.h,v 1.78 2001/02/26 01:45:56 marka Exp $ */ #ifndef DNS_RESULT_H #define DNS_RESULT_H 1 @@ -110,8 +110,9 @@ #define DNS_R_CNAMEANDOTHER (ISC_RESULTCLASS_DNS + 71) #define DNS_R_SINGLETON (ISC_RESULTCLASS_DNS + 72) #define DNS_R_HINTNXRRSET (ISC_RESULTCLASS_DNS + 73) +#define DNS_R_NOMASTERFILE (ISC_RESULTCLASS_DNS + 74) -#define DNS_R_NRESULTS 74 /* Number of results */ +#define DNS_R_NRESULTS 75 /* Number of results */ /* * DNS wire format rcodes. diff --git a/lib/dns/include/dns/zone.h b/lib/dns/include/dns/zone.h index bca15e6617..ff61784b5f 100644 --- a/lib/dns/include/dns/zone.h +++ b/lib/dns/include/dns/zone.h @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: zone.h,v 1.99 2001/02/14 03:50:14 gson Exp $ */ +/* $Id: zone.h,v 1.100 2001/02/26 01:45:57 marka Exp $ */ #ifndef DNS_ZONE_H #define DNS_ZONE_H 1 @@ -26,6 +26,7 @@ #include +#include #include #include @@ -1287,7 +1288,8 @@ dns_zone_setdialup(dns_zone_t *zone, dns_dialuptype_t dialup); */ void -dns_zone_log(dns_zone_t *zone, int level, const char *msg, ...); +dns_zone_log(dns_zone_t *zone, int level, const char *msg, ...) + ISC_FORMAT_PRINTF(3, 4); /* * Log the message 'msg...' at 'level', including text that identifies * the message as applying to 'zone'. diff --git a/lib/dns/result.c b/lib/dns/result.c index 6b1f6855fb..2d41ef6724 100644 --- a/lib/dns/result.c +++ b/lib/dns/result.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: result.c,v 1.85 2001/01/09 21:51:29 bwelling Exp $ */ +/* $Id: result.c,v 1.86 2001/02/26 01:45:53 marka Exp $ */ #include @@ -113,7 +113,8 @@ static const char *text[DNS_R_NRESULTS] = { "CNAME and other data", /* 71 DNS_R_CNAMEANDOTHER */ "multiple RRs of singleton type", /* 72 DNS_R_SINGLETON */ - "hint nxrrset" /* 73 DNS_R_HINTNXRRSET */ + "hint nxrrset", /* 73 DNS_R_HINTNXRRSET */ + "no master file configured" /* 74 DNS_R_NOMASTERFILE */ }; static const char *rcode_text[DNS_R_NRCODERESULTS] = { diff --git a/lib/dns/zone.c b/lib/dns/zone.c index ac6fdbb1e4..7508159b59 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: zone.c,v 1.309 2001/02/24 00:58:53 bwelling Exp $ */ +/* $Id: zone.c,v 1.310 2001/02/26 01:45:54 marka Exp $ */ #include @@ -967,11 +967,15 @@ dns_zone_load(dns_zone_t *zone) { if (zone->masterfile != NULL) { result = zone_startload(db, zone, loadtime); } else { + result = DNS_R_NOMASTERFILE; if (zone->type == dns_zone_master) { dns_zone_log(zone, ISC_LOG_ERROR, - "loading zone: ", + "loading zone: " "no master file configured"); + goto cleanup; } + dns_zone_log(zone, ISC_LOG_INFO, "loading zone: " + "no master file configured: continuing"); } } @@ -1108,7 +1112,7 @@ zone_postload(dns_zone_t *zone, dns_db_t *db, isc_time_t loadtime, if (result == ISC_R_FILENOTFOUND) dns_zone_log(zone, ISC_LOG_DEBUG(1), "no master file"); - else + else if (result != DNS_R_NOMASTERFILE) dns_zone_log(zone, ISC_LOG_ERROR, "loading master file %s: %s", zone->masterfile, @@ -2828,7 +2832,7 @@ stub_callback(isc_task_t *task, isc_event_t *event) { dns_zone_log(zone, ISC_LOG_INFO, "refreshing stub: " "unexpected rcode (%.*s) from %s", - rb.used, rcode, master); + (int)rb.used, rcode, master); goto next_master; } @@ -2853,8 +2857,7 @@ stub_callback(isc_task_t *task, isc_event_t *event) { * If non-auth log and next master. */ if ((msg->flags & DNS_MESSAGEFLAG_AA) == 0) { - dns_zone_log(zone, ISC_LOG_INFO, - "refreshing stub: ", + dns_zone_log(zone, ISC_LOG_INFO, "refreshing stub: " "non-authorative answer from master %s", master); goto next_master; } @@ -3037,7 +3040,7 @@ refresh_callback(isc_task_t *task, isc_event_t *event) { dns_zone_log(zone, ISC_LOG_INFO, "refresh: unexpected rcode (%.*s) from master %s", - rb.used, rcode, master); + (int)rb.used, rcode, master); goto next_master; } @@ -4863,7 +4866,7 @@ got_transfer_quota(isc_task_t *task, isc_event_t *event) { } if (use_ixfr == ISC_FALSE) { dns_zone_log(zone, ISC_LOG_DEBUG(3), - "IXFR disabled, ", + "IXFR disabled, " "requesting AXFR from %s", mastertext); xfrtype = dns_rdatatype_axfr; @@ -5041,7 +5044,7 @@ forward_callback(isc_task_t *task, isc_event_t *event) { dns_zone_log(zone, ISC_LOG_WARNING, "forwarding dynamic update: " "unexpected response: master %s returned: %.*s", - master, rb.used, rcode); + master, (int)rb.used, rcode); goto next_master; }