From: Mark Andrews Date: Tue, 4 Jun 2013 01:34:03 +0000 (+1000) Subject: 3582. [bug] Silence false positive warning regarding missing file X-Git-Tag: v9.10.0a1~314 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1e34fe9044874422104e84373988d07876f716b6;p=thirdparty%2Fbind9.git 3582. [bug] Silence false positive warning regarding missing file directive for inline slave zones. [RT #33662] --- diff --git a/CHANGES b/CHANGES index 87977827e19..e2ba868136d 100644 --- 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 index 00000000000..80210a91fb9 --- /dev/null +++ b/bin/tests/system/checkconf/inline-bad.conf @@ -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 index 00000000000..c7fd2341b3e --- /dev/null +++ b/bin/tests/system/checkconf/inline-good.conf @@ -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 index 00000000000..bebe846ca2f --- /dev/null +++ b/bin/tests/system/checkconf/inline-no.conf @@ -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; }; +}; + diff --git a/bin/tests/system/checkconf/tests.sh b/bin/tests/system/checkconf/tests.sh index 0e5abf2d0e6..2f05c5da5c8 100644 --- a/bin/tests/system/checkconf/tests.sh +++ b/bin/tests/system/checkconf/tests.sh @@ -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 diff --git a/lib/bind9/check.c b/lib/bind9/check.c index b5658a192c5..33dd1639f28 100644 --- a/lib/bind9/check.c +++ b/lib/bind9/check.c @@ -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);