]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
4197. [bug] 'named-checkconf -z' didn't handle 'in-view' clauses.
authorMark Andrews <marka@isc.org>
Wed, 9 Sep 2015 07:56:23 +0000 (17:56 +1000)
committerMark Andrews <marka@isc.org>
Wed, 9 Sep 2015 07:56:23 +0000 (17:56 +1000)
                        [RT #40603]

CHANGES
bin/check/named-checkconf.c
bin/tests/system/checkconf/in-view-good.conf [new file with mode: 0644]
bin/tests/system/checkconf/shared.example.db [new file with mode: 0644]
bin/tests/system/checkconf/tests.sh

diff --git a/CHANGES b/CHANGES
index 954f9ae55dca584e6c75ee75a27bc1edc67d0bc9..0822c5666ce8bbdc7b354ba2e8e1ac22a60da569 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+4197.  [bug]           'named-checkconf -z' didn't handle 'in-view' clauses.
+                       [RT #40603]
+
 4196.  [doc]           Improve how "enum + other" types are documented.
                        [RT #40608]
 
index f6d817820414b26145f323699a8e10ca480106cc..62f7433a525f991fd01f7c16cc8a3962413c6617 100644 (file)
@@ -180,6 +180,7 @@ configure_zone(const char *vclass, const char *view,
        const char *zfile = NULL;
        const cfg_obj_t *maps[4];
        const cfg_obj_t *mastersobj = NULL;
+       const cfg_obj_t *inviewobj = NULL;
        const cfg_obj_t *zoptions = NULL;
        const cfg_obj_t *classobj = NULL;
        const cfg_obj_t *typeobj = NULL;
@@ -211,6 +212,10 @@ configure_zone(const char *vclass, const char *view,
        }
        maps[i] = NULL;
 
+       cfg_map_get(zoptions, "in-view", &inviewobj);
+       if (inviewobj != NULL)
+               return (ISC_R_SUCCESS);
+
        cfg_map_get(zoptions, "type", &typeobj);
        if (typeobj == NULL)
                return (ISC_R_FAILURE);
diff --git a/bin/tests/system/checkconf/in-view-good.conf b/bin/tests/system/checkconf/in-view-good.conf
new file mode 100644 (file)
index 0000000..3a6b63b
--- /dev/null
@@ -0,0 +1,12 @@
+view internal {
+       zone shared.example {
+               type master;
+               file "shared.example.db";
+       };
+};
+
+view external {
+       zone shared.example {
+               in-view internal;
+       };
+};
diff --git a/bin/tests/system/checkconf/shared.example.db b/bin/tests/system/checkconf/shared.example.db
new file mode 100644 (file)
index 0000000..0d90a07
--- /dev/null
@@ -0,0 +1,2 @@
+@      0       SOA     . . 0 0 0 0 0
+@      0       NS      .
index 54792f6b5733ef353e7416aeb2495502311bf56d..031f6fe5de443e109003250637153cb4a6972861 100644 (file)
@@ -254,5 +254,12 @@ grep "range 8610 8614;" checkconf.out7 > /dev/null || ret=1
 if [ $ret != 0 ]; then echo "I:failed"; ret=1; fi
 status=`expr $status + $ret`
 
+echo "I: check that named-checkconf -z handles in-view"
+ret=0
+$CHECKCONF -z in-view-good.conf > checkconf.out7 2>&1 || ret=1
+grep "zone shared.example/IN: loaded serial" < checkconf.out7 > /dev/null || ret=1
+if [ $ret != 0 ]; then echo "I:failed"; ret=1; fi
+status=`expr $status + $ret`
+
 echo "I:exit status: $status"
 exit $status