]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
3582. [bug] Silence false positive warning regarding missing file
authorMark Andrews <marka@isc.org>
Tue, 4 Jun 2013 01:34:03 +0000 (11:34 +1000)
committerMark Andrews <marka@isc.org>
Tue, 4 Jun 2013 01:34:03 +0000 (11:34 +1000)
                        directive for inline slave zones.  [RT #33662]

CHANGES
bin/tests/system/checkconf/inline-bad.conf [new file with mode: 0644]
bin/tests/system/checkconf/inline-good.conf [new file with mode: 0644]
bin/tests/system/checkconf/inline-no.conf [new file with mode: 0644]
bin/tests/system/checkconf/tests.sh
lib/bind9/check.c

diff --git a/CHANGES b/CHANGES
index 87977827e190577e235e27838d08046e9a682e29..e2ba868136d452af0c7bdd37e86606b4e867f174 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+3582.  [bug]           Silence false positive warning regarding missing file
+                       directive for inline slave zones.  [RT #33662]
+
 3581.  [bug]           Changed the tcp-listen-queue default to 10. [RT #33029]
 
 3580.  [bug]           Addressed a possible race in acache.c [RT #33602]
diff --git a/bin/tests/system/checkconf/inline-bad.conf b/bin/tests/system/checkconf/inline-bad.conf
new file mode 100644 (file)
index 0000000..80210a9
--- /dev/null
@@ -0,0 +1,14 @@
+acl "transferees" {};
+masters "stealthMasters" {127.0.0.1;};
+masters "publicSlaves" {127.0.0.1;};
+zone "example.net" {
+        type slave;
+        key-directory "/var/lib/bind/example.net";
+        auto-dnssec maintain;
+        inline-signing yes;
+        masters { stealthMasters; };
+        notify explicit;
+        also-notify { publicSlaves; };
+        allow-transfer { localhost; transferees; };
+};
+
diff --git a/bin/tests/system/checkconf/inline-good.conf b/bin/tests/system/checkconf/inline-good.conf
new file mode 100644 (file)
index 0000000..c7fd234
--- /dev/null
@@ -0,0 +1,15 @@
+acl "transferees" {};
+masters "stealthMasters" {127.0.0.1;};
+masters "publicSlaves" {127.0.0.1;};
+zone "example.net" {
+        type slave;
+        file "/var/cache/bind/example.net.db";
+        key-directory "/var/lib/bind/example.net";
+        auto-dnssec maintain;
+        inline-signing yes;
+        masters { stealthMasters; };
+        notify explicit;
+        also-notify { publicSlaves; };
+        allow-transfer { localhost; transferees; };
+};
+
diff --git a/bin/tests/system/checkconf/inline-no.conf b/bin/tests/system/checkconf/inline-no.conf
new file mode 100644 (file)
index 0000000..bebe846
--- /dev/null
@@ -0,0 +1,14 @@
+acl "transferees" {};
+masters "stealthMasters" {127.0.0.1;};
+masters "publicSlaves" {127.0.0.1;};
+zone "example.net" {
+        type slave;
+        key-directory "/var/lib/bind/example.net";
+        auto-dnssec maintain;
+        inline-signing no;
+        masters { stealthMasters; };
+        notify explicit;
+        also-notify { publicSlaves; };
+        allow-transfer { localhost; transferees; };
+};
+
index 0e5abf2d0e621f243a930f83c76b8c5bf1060e2a..2f05c5da5c8a50e41e82e00904899cab0b7423fe 100644 (file)
@@ -107,6 +107,18 @@ n=`$CHECKCONF bad-dnssec.conf 2>&1 | grep "dnssec-loadkeys-interval.*requires in
 [ $n -eq 1 ] || ret=1
 n=`$CHECKCONF bad-dnssec.conf 2>&1 | grep "update-check-ksk.*requires inline" | wc -l`
 [ $n -eq 1 ] || ret=1
+if [ $ret != 0 ]; then echo "I:failed"; fi
+status=`expr $status + $ret`
+
+echo "I: check file + inline-signing for slave zones"
+n=`$CHECKCONF inline-no.conf 2>&1 | grep "missing 'file' entry" | wc -l`
+[ $n -eq 0 ] || ret=1
+n=`$CHECKCONF inline-good.conf 2>&1 | grep "missing 'file' entry" | wc -l`
+[ $n -eq 0 ] || ret=1
+n=`$CHECKCONF inline-bad.conf 2>&1 | grep "missing 'file' entry" | wc -l`
+[ $n -eq 1 ] || ret=1
+if [ $ret != 0 ]; then echo "I:failed"; fi
+status=`expr $status + $ret`
 
 echo "I: checking named-checkconf DLZ warnings"
 ret=0
index b5658a192c57d50262270171b9c1fed0d5db7366..33dd1639f2847c1b5a2ebb7aef714bf48df7a786 100644 (file)
@@ -1930,8 +1930,9 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
                obj = NULL;
                res1 = cfg_map_get(zoptions, "inline-signing", &obj);
                if ((tresult != ISC_R_SUCCESS &&
-                   (ztype == MASTERZONE || ztype == HINTZONE)) ||
-                   (ztype == SLAVEZONE && res1 == ISC_R_SUCCESS)) {
+                   (ztype == MASTERZONE || ztype == HINTZONE ||
+                    (ztype == SLAVEZONE && res1 == ISC_R_SUCCESS &&
+                     cfg_obj_asboolean(obj))))) {
                        cfg_obj_log(zconfig, logctx, ISC_LOG_ERROR,
                            "zone '%s': missing 'file' entry",
                            znamestr);