From: Evan Hunt Date: Wed, 20 Feb 2013 22:01:31 +0000 (-0800) Subject: [master] forbid inline-signing slave with no file X-Git-Tag: v9.10.0a1~505 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a81ae06ed3081753a73e7638919673be57eaf47f;p=thirdparty%2Fbind9.git [master] forbid inline-signing slave with no file 3491. [bug] Slave zones using inline-signing must specify a file name. [RT #31946] --- diff --git a/CHANGES b/CHANGES index 54d36400112..3cec7e7ba85 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +3491. [bug] Slave zones using inline-signing must specify a + file name. [RT #31946] + 3490. [bug] When logging RDATA during update, truncate if it's too long. [RT #32365] diff --git a/bin/tests/system/checkconf/bad-inline-slave.conf b/bin/tests/system/checkconf/bad-inline-slave.conf new file mode 100644 index 00000000000..06d9cfd0707 --- /dev/null +++ b/bin/tests/system/checkconf/bad-inline-slave.conf @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2005, 2007, 2010-2012 Internet Systems Consortium, Inc. ("ISC") + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE + * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + + /* + * An inline-signing slave should be forced to have a file option + */ + + zone "." { + type slave; + inline-signing yes; + masters { 10.53.0.1; }; + }; \ No newline at end of file diff --git a/lib/bind9/check.c b/lib/bind9/check.c index 413686801fc..56ae672f9fa 100644 --- a/lib/bind9/check.c +++ b/lib/bind9/check.c @@ -1876,6 +1876,8 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions, /* * If the zone type is rbt/rbt64 then master/hint zones * require file clauses. + * If inline signing is used, then slave zones require a + * file clause as well */ obj = NULL; dlz = ISC_FALSE; @@ -1896,13 +1898,17 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions, (strcmp("rbt", cfg_obj_asstring(obj)) == 0 || strcmp("rbt64", cfg_obj_asstring(obj)) == 0)))) { + isc_result_t res1; obj = NULL; tresult = cfg_map_get(zoptions, "file", &obj); - if (tresult != ISC_R_SUCCESS && - (ztype == MASTERZONE || ztype == HINTZONE)) { + 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)) { cfg_obj_log(zconfig, logctx, ISC_LOG_ERROR, - "zone '%s': missing 'file' entry", - znamestr); + "zone '%s': missing 'file' entry", + znamestr); result = tresult; } }