]> 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:15 +0000 (13:41 +1000)
bin/tests/system/checkconf/tests.sh
lib/bind9/check.c

index c5e65d149257156e6b7ce8220f3b427484053246..37512e4682cbbaed6c0de41a8625f9ee8fc5c678 100644 (file)
@@ -75,6 +75,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 389ab00604d2168be0eedad64eb253ba85b7e53a..f76560415539c2a671447235d4312c14f35a0a9a 100644 (file)
@@ -2191,20 +2191,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.
         */