From: Mark Andrews Date: Mon, 25 Jun 2001 08:34:46 +0000 (+0000) Subject: 911. [bug] Fail gracefully with multiple hint zones. [RT #1433] X-Git-Tag: v9.1.3rc3~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ee1f8a575d0d785ba6e079e7072aca9de684829e;p=thirdparty%2Fbind9.git 911. [bug] Fail gracefully with multiple hint zones. [RT #1433] --- diff --git a/CHANGES b/CHANGES index e4954b419f4..3e3d6199661 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,4 @@ + 911. [bug] Fail gracefully with multiple hint zones. [RT #1433] --- 9.1.3rc2 released --- diff --git a/bin/named/server.c b/bin/named/server.c index e4611d6b1e4..0d6a2958268 100644 --- a/bin/named/server.c +++ b/bin/named/server.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: server.c,v 1.276.2.2 2001/03/13 02:40:22 bwelling Exp $ */ +/* $Id: server.c,v 1.276.2.3 2001/06/25 08:34:46 marka Exp $ */ #include @@ -1135,15 +1135,23 @@ configure_zone(dns_c_ctx_t *cctx, dns_c_zone_t *czone, dns_c_view_t *cview, result = ISC_R_FAILURE; goto cleanup; } - if (dns_name_equal(origin, dns_rootname)) { - result = configure_hints(view, czone->u.hzone.file); - } else { + if (!dns_name_equal(origin, dns_rootname)) { isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER, ISC_LOG_WARNING, "ignoring non-root hint zone '%s'", corigin); result = ISC_R_SUCCESS; + goto cleanup; + } + if (view->hints != NULL) { + isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, + NS_LOGMODULE_SERVER, ISC_LOG_ERROR, + "'%s' hint zone already defined", + corigin); + result = ISC_R_EXISTS; + goto cleanup; } + result = configure_hints(view, czone->u.hzone.file); goto cleanup; }