From: Mark Andrews Date: Thu, 16 Aug 2012 03:53:47 +0000 (+1000) Subject: we didn't catch a zero option at the global level when views are active X-Git-Tag: v9.7.7rc1~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5a066083d8e4d37c17a67aacce520327a3c94402;p=thirdparty%2Fbind9.git we didn't catch a zero option at the global level when views are active --- diff --git a/bin/tests/system/checkconf/tests.sh b/bin/tests/system/checkconf/tests.sh index f564fc23ee0..42dd5383e3b 100644 --- a/bin/tests/system/checkconf/tests.sh +++ b/bin/tests/system/checkconf/tests.sh @@ -74,6 +74,15 @@ EOF $CHECKCONF badzero.conf > /dev/null 2>&1 [ $? -eq 1 ] || { echo "I: view $field failed" ; ret=1; } cat > badzero.conf << EOF +options { + $field 0; +}; +view dummy { +}; +EOF + $CHECKCONF badzero.conf > /dev/null 2>&1 + [ $? -eq 1 ] || { echo "I: options + view $field failed" ; ret=1; } + cat > badzero.conf << EOF zone dummy { type slave; masters { 0.0.0.0; }; diff --git a/lib/bind9/check.c b/lib/bind9/check.c index c69fb08b4af..933f3c30daa 100644 --- a/lib/bind9/check.c +++ b/lib/bind9/check.c @@ -2007,20 +2007,23 @@ check_viewconf(const cfg_obj_t *config, const cfg_obj_t *voptions, * Check that forwarding is reasonable. */ if (voptions == NULL) { - if (options != NULL) { + if (options != NULL) if (check_forward(options, NULL, logctx) != ISC_R_SUCCESS) result = ISC_R_FAILURE; - if (check_nonzero(options, logctx) != ISC_R_SUCCESS) - result = ISC_R_FAILURE; - } } else { if (check_forward(voptions, NULL, logctx) != ISC_R_SUCCESS) result = ISC_R_FAILURE; - if (check_nonzero(voptions, logctx) != ISC_R_SUCCESS) - result = ISC_R_FAILURE; } + /* + * Check non-zero options at the global and view levels. + */ + if (options != NULL && check_nonzero(options, logctx) != ISC_R_SUCCESS) + result = ISC_R_FAILURE; + if (voptions != NULL &&check_nonzero(voptions, logctx) != ISC_R_SUCCESS) + result = ISC_R_FAILURE; + /* * Check that dual-stack-servers is reasonable. */