From: Mark Andrews Date: Wed, 9 Sep 2015 07:56:23 +0000 (+1000) Subject: 4197. [bug] 'named-checkconf -z' didn't handle 'in-view' clauses. X-Git-Tag: v9.11.0a1~502^2~9 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=075a3d60c23140f05db10d70126ff271ef6469c9;p=thirdparty%2Fbind9.git 4197. [bug] 'named-checkconf -z' didn't handle 'in-view' clauses. [RT #40603] --- diff --git a/CHANGES b/CHANGES index 954f9ae55dc..0822c5666ce 100644 --- 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] diff --git a/bin/check/named-checkconf.c b/bin/check/named-checkconf.c index f6d81782041..62f7433a525 100644 --- a/bin/check/named-checkconf.c +++ b/bin/check/named-checkconf.c @@ -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 index 00000000000..3a6b63b001b --- /dev/null +++ b/bin/tests/system/checkconf/in-view-good.conf @@ -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 index 00000000000..0d90a0795ad --- /dev/null +++ b/bin/tests/system/checkconf/shared.example.db @@ -0,0 +1,2 @@ +@ 0 SOA . . 0 0 0 0 0 +@ 0 NS . diff --git a/bin/tests/system/checkconf/tests.sh b/bin/tests/system/checkconf/tests.sh index 54792f6b573..031f6fe5de4 100644 --- a/bin/tests/system/checkconf/tests.sh +++ b/bin/tests/system/checkconf/tests.sh @@ -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