From eea693e4b1d4df8d09a5565ef62635ea765bd2ce Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Fri, 24 Oct 2008 00:36:26 +0000 Subject: [PATCH] 2471. [bug] named-checkzone was not reporting missing manditory glue when sibling checks were disabled. [RT #18768] --- CHANGES | 3 +++ bin/check/check-tool.c | 19 ++++++++++++++++++- lib/dns/zone.c | 10 ++++++---- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index 214fb95880..85a34f65fb 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +2471. [bug] named-checkzone was not reporting missing manditory + glue when sibling checks were disabled. [RT #18768] + 2470. [bug] Elements of the isc_radix_node_t could be incorrectly overwritten. [RT# 18719] diff --git a/bin/check/check-tool.c b/bin/check/check-tool.c index 85067ddb25..fd28fbde39 100644 --- a/bin/check/check-tool.c +++ b/bin/check/check-tool.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: check-tool.c,v 1.31 2007/09/13 04:45:18 each Exp $ */ +/* $Id: check-tool.c,v 1.31.62.1 2008/10/24 00:36:26 marka Exp $ */ /*! \file */ @@ -47,6 +47,14 @@ #include +#ifndef CHECK_SIBLING +#define CHECK_SIBLING 1 +#endif + +#ifndef CHECK_LOCAL +#define CHECK_LOCAL 1 +#endif + #ifdef HAVE_ADDRINFO #ifdef HAVE_GETADDRINFO #ifdef HAVE_GAISTRERROR @@ -75,14 +83,23 @@ static const char *dbtype[] = { "rbt" }; int debug = 0; isc_boolean_t nomerge = ISC_TRUE; +#if CHECK_LOCAL isc_boolean_t docheckmx = ISC_TRUE; isc_boolean_t dochecksrv = ISC_TRUE; isc_boolean_t docheckns = ISC_TRUE; +#else +isc_boolean_t docheckmx = ISC_FALSE; +isc_boolean_t dochecksrv = ISC_FALSE; +isc_boolean_t docheckns = ISC_FALSE; +#endif unsigned int zone_options = DNS_ZONEOPT_CHECKNS | DNS_ZONEOPT_CHECKMX | DNS_ZONEOPT_MANYERRORS | DNS_ZONEOPT_CHECKNAMES | DNS_ZONEOPT_CHECKINTEGRITY | +#if CHECK_SIBLING + DNS_ZONEOPT_CHECKSIBLING | +#endif DNS_ZONEOPT_CHECKWILDCARD | DNS_ZONEOPT_WARNMXCNAME | DNS_ZONEOPT_WARNSRVCNAME; diff --git a/lib/dns/zone.c b/lib/dns/zone.c index 8e489fc8fc..855532bb7b 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: zone.c,v 1.470.12.5 2008/04/07 05:30:58 marka Exp $ */ +/* $Id: zone.c,v 1.470.12.6 2008/10/24 00:36:25 marka Exp $ */ /*! \file */ @@ -1767,14 +1767,16 @@ zone_check_glue(dns_zone_t *zone, dns_db_t *db, dns_name_t *name, if (result == DNS_R_NXRRSET || result == DNS_R_NXDOMAIN || result == DNS_R_EMPTYNAME || result == DNS_R_DELEGATION) { const char *what; - if (dns_name_issubdomain(name, owner)) + isc_boolean_t required = ISC_FALSE; + if (dns_name_issubdomain(name, owner)) { what = "REQUIRED GLUE "; - else if (result == DNS_R_DELEGATION) + required = ISC_TRUE; + } else if (result == DNS_R_DELEGATION) what = "SIBLING GLUE "; else what = ""; - if (result != DNS_R_DELEGATION || + if (result != DNS_R_DELEGATION || required || DNS_ZONE_OPTION(zone, DNS_ZONEOPT_CHECKSIBLING)) { dns_zone_log(zone, level, "%s/NS '%s' has no %s" "address records (A or AAAA)",