]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
4359. [bug] Inherited 'also-notify' lists were not being checked
authorMark Andrews <marka@isc.org>
Thu, 5 May 2016 11:59:09 +0000 (21:59 +1000)
committerMark Andrews <marka@isc.org>
Thu, 5 May 2016 11:59:09 +0000 (21:59 +1000)
                        by named-checkconf. [RT #42174]

CHANGES
bin/tests/system/checkconf/bad-options-also-notify.conf [new file with mode: 0644]
bin/tests/system/checkconf/bad-view-also-notify.conf [new file with mode: 0644]
bin/tests/system/checkconf/good-options-also-notify.conf [new file with mode: 0644]
bin/tests/system/checkconf/good-view-also-notify.conf [new file with mode: 0644]
lib/bind9/check.c

diff --git a/CHANGES b/CHANGES
index 1eb602f54ab579bc07836d26287c82fec79ebf05..7344adf3603f0feb142231d8c2129ecb039ad424 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+4359.  [bug]           Inherited 'also-notify' lists were not being checked
+                       by named-checkconf. [RT #42174]
+
 4358.  [test]          Added American Fuzzy Lop harness that allows
                        feeding fuzzed packets into BIND.
                        [RT #41723]
diff --git a/bin/tests/system/checkconf/bad-options-also-notify.conf b/bin/tests/system/checkconf/bad-options-also-notify.conf
new file mode 100644 (file)
index 0000000..936b683
--- /dev/null
@@ -0,0 +1,8 @@
+options {
+       also-notify { missing; };
+};
+
+zone "example.net" {
+       type slave;
+       masters { 192.168.1.1; };
+};
diff --git a/bin/tests/system/checkconf/bad-view-also-notify.conf b/bin/tests/system/checkconf/bad-view-also-notify.conf
new file mode 100644 (file)
index 0000000..8e12d21
--- /dev/null
@@ -0,0 +1,7 @@
+view example {
+       also-notify { missing; };
+       zone "example.net" {
+               type slave;
+               masters { 192.168.1.1; };
+       };
+};
diff --git a/bin/tests/system/checkconf/good-options-also-notify.conf b/bin/tests/system/checkconf/good-options-also-notify.conf
new file mode 100644 (file)
index 0000000..f676fb7
--- /dev/null
@@ -0,0 +1,9 @@
+options {
+       also-notify { missing; };
+};
+
+zone "example.net" {
+       type slave;
+       notify no;
+       masters { 192.168.1.1; };
+};
diff --git a/bin/tests/system/checkconf/good-view-also-notify.conf b/bin/tests/system/checkconf/good-view-also-notify.conf
new file mode 100644 (file)
index 0000000..4692096
--- /dev/null
@@ -0,0 +1,8 @@
+view example {
+       also-notify { missing; };
+       zone "example.net" {
+               type slave;
+               notify no;
+               masters { 192.168.1.1; };
+       };
+};
index f978abd5444eb92430708db855d432ca643f5dab..8bf7120a42015945e1e99749d2eab80a884879de 100644 (file)
@@ -1780,7 +1780,12 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
                        cfg_obj_log(zoptions, logctx, ISC_LOG_WARNING,
                                    "zone '%s': 'also-notify' set but "
                                    "'notify' is disabled", znamestr);
-               } else if (tresult == ISC_R_SUCCESS) {
+               }
+               if (tresult != ISC_R_SUCCESS && voptions != NULL)
+                       tresult = cfg_map_get(voptions, "also-notify", &obj);
+               if (tresult != ISC_R_SUCCESS && goptions != NULL)
+                       tresult = cfg_map_get(goptions, "also-notify", &obj);
+               if (tresult == ISC_R_SUCCESS && donotify) {
                        isc_uint32_t count;
                        tresult = validate_masters(obj, config, &count,
                                                   logctx, mctx);