]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
we didn't catch a zero option at the global level when views are active
authorMark Andrews <marka@isc.org>
Thu, 16 Aug 2012 03:53:47 +0000 (13:53 +1000)
committerMark Andrews <marka@isc.org>
Fri, 17 Aug 2012 03:41:31 +0000 (13:41 +1000)
bin/tests/system/checkconf/tests.sh
lib/bind9/check.c

index f564fc23ee0c945f70408cabd2b1d86c004caaae..42dd5383e3b65d89e66be93581a1e2245b46b208 100644 (file)
@@ -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; };
index c69fb08b4af97e1cc0196c479b09784c5bee8ff4..933f3c30daa433ec2a7796ce750a7c3fe0887b9b 100644 (file)
@@ -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.
         */