mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-29 13:38:26 +00:00
[master] allow null "file" for DLZ or alternate db zones
3803. [bug] "named-checkconf -z" incorrectly rejected zones using alternate data sources for not having a "file" option. [RT #35685]
This commit is contained in:
parent
5b60bde47b
commit
baad8d9fd8
4
CHANGES
4
CHANGES
@ -1,3 +1,7 @@
|
|||||||
|
3803. [bug] "named-checkconf -z" incorrectly rejected zones
|
||||||
|
using alternate data sources for not having a "file"
|
||||||
|
option. [RT #35685]
|
||||||
|
|
||||||
3802. [bug] Various header files were not being installed.
|
3802. [bug] Various header files were not being installed.
|
||||||
|
|
||||||
--- 9.10.0rc1 released ---
|
--- 9.10.0rc1 released ---
|
||||||
|
@ -178,10 +178,12 @@ configure_zone(const char *vclass, const char *view,
|
|||||||
const char *zname;
|
const char *zname;
|
||||||
const char *zfile = NULL;
|
const char *zfile = NULL;
|
||||||
const cfg_obj_t *maps[4];
|
const cfg_obj_t *maps[4];
|
||||||
|
const cfg_obj_t *mastersobj = NULL;
|
||||||
const cfg_obj_t *zoptions = NULL;
|
const cfg_obj_t *zoptions = NULL;
|
||||||
const cfg_obj_t *classobj = NULL;
|
const cfg_obj_t *classobj = NULL;
|
||||||
const cfg_obj_t *typeobj = NULL;
|
const cfg_obj_t *typeobj = NULL;
|
||||||
const cfg_obj_t *fileobj = NULL;
|
const cfg_obj_t *fileobj = NULL;
|
||||||
|
const cfg_obj_t *dlzobj = NULL;
|
||||||
const cfg_obj_t *dbobj = NULL;
|
const cfg_obj_t *dbobj = NULL;
|
||||||
const cfg_obj_t *obj = NULL;
|
const cfg_obj_t *obj = NULL;
|
||||||
const cfg_obj_t *fmtobj = NULL;
|
const cfg_obj_t *fmtobj = NULL;
|
||||||
@ -212,6 +214,19 @@ configure_zone(const char *vclass, const char *view,
|
|||||||
if (typeobj == NULL)
|
if (typeobj == NULL)
|
||||||
return (ISC_R_FAILURE);
|
return (ISC_R_FAILURE);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Skip checks when using an alternate data source.
|
||||||
|
*/
|
||||||
|
cfg_map_get(zoptions, "database", &dbobj);
|
||||||
|
if (dbobj != NULL &&
|
||||||
|
strcmp("rbt", cfg_obj_asstring(dbobj)) != 0 &&
|
||||||
|
strcmp("rbt64", cfg_obj_asstring(dbobj)) != 0)
|
||||||
|
return (ISC_R_SUCCESS);
|
||||||
|
|
||||||
|
cfg_map_get(zoptions, "dlz", &dlzobj);
|
||||||
|
if (dlzobj != NULL)
|
||||||
|
return (ISC_R_SUCCESS);
|
||||||
|
|
||||||
cfg_map_get(zoptions, "file", &fileobj);
|
cfg_map_get(zoptions, "file", &fileobj);
|
||||||
if (fileobj != NULL)
|
if (fileobj != NULL)
|
||||||
zfile = cfg_obj_asstring(fileobj);
|
zfile = cfg_obj_asstring(fileobj);
|
||||||
@ -227,13 +242,18 @@ configure_zone(const char *vclass, const char *view,
|
|||||||
(strcasecmp(cfg_obj_asstring(typeobj), "redirect") != 0))
|
(strcasecmp(cfg_obj_asstring(typeobj), "redirect") != 0))
|
||||||
return (ISC_R_SUCCESS);
|
return (ISC_R_SUCCESS);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Is the redirect zone configured as a slave?
|
||||||
|
*/
|
||||||
|
if (strcasecmp(cfg_obj_asstring(typeobj), "redirect") == 0) {
|
||||||
|
cfg_map_get(zoptions, "masters", &mastersobj);
|
||||||
|
if (mastersobj != NULL)
|
||||||
|
return (ISC_R_SUCCESS);
|
||||||
|
}
|
||||||
|
|
||||||
if (zfile == NULL)
|
if (zfile == NULL)
|
||||||
return (ISC_R_FAILURE);
|
return (ISC_R_FAILURE);
|
||||||
|
|
||||||
cfg_map_get(zoptions, "database", &dbobj);
|
|
||||||
if (dbobj != NULL)
|
|
||||||
return (ISC_R_SUCCESS);
|
|
||||||
|
|
||||||
obj = NULL;
|
obj = NULL;
|
||||||
if (get_maps(maps, "check-dup-records", &obj)) {
|
if (get_maps(maps, "check-dup-records", &obj)) {
|
||||||
if (strcasecmp(cfg_obj_asstring(obj), "warn") == 0) {
|
if (strcasecmp(cfg_obj_asstring(obj), "warn") == 0) {
|
||||||
|
22
bin/tests/system/checkconf/altdb.conf
Normal file
22
bin/tests/system/checkconf/altdb.conf
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2014 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
view override_bind chaos {
|
||||||
|
zone "version.bind" chaos {
|
||||||
|
type master;
|
||||||
|
database "_builtin version";
|
||||||
|
};
|
||||||
|
};
|
25
bin/tests/system/checkconf/altdlz.conf
Normal file
25
bin/tests/system/checkconf/altdlz.conf
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2014 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
dlz external {
|
||||||
|
database "dlopen driver.so";
|
||||||
|
search no;
|
||||||
|
};
|
||||||
|
|
||||||
|
zone "example.com" {
|
||||||
|
type master;
|
||||||
|
dlz external;
|
||||||
|
};
|
@ -108,6 +108,12 @@ view "second" {
|
|||||||
zone "clone" {
|
zone "clone" {
|
||||||
in-view "first";
|
in-view "first";
|
||||||
};
|
};
|
||||||
|
zone "." {
|
||||||
|
type redirect;
|
||||||
|
masters {
|
||||||
|
1.2.3.4 ;
|
||||||
|
};
|
||||||
|
};
|
||||||
dnssec-lookaside "." trust-anchor "dlv.isc.org.";
|
dnssec-lookaside "." trust-anchor "dlv.isc.org.";
|
||||||
dnssec-validation auto;
|
dnssec-validation auto;
|
||||||
zone-statistics full;
|
zone-statistics full;
|
||||||
@ -132,6 +138,12 @@ view "third" {
|
|||||||
"any";
|
"any";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
view "chaos" chaos {
|
||||||
|
zone "hostname.bind" chaos {
|
||||||
|
type master;
|
||||||
|
database "_builtin hostname";
|
||||||
|
};
|
||||||
|
};
|
||||||
key "mykey" {
|
key "mykey" {
|
||||||
algorithm "hmac-md5";
|
algorithm "hmac-md5";
|
||||||
secret "qwertyuiopasdfgh";
|
secret "qwertyuiopasdfgh";
|
||||||
|
@ -179,5 +179,17 @@ $CHECKCONF -z max-ttl-bad.conf > /dev/null 2>&1 && ret=1
|
|||||||
if [ $ret != 0 ]; then echo "I:failed"; ret=1; fi
|
if [ $ret != 0 ]; then echo "I:failed"; ret=1; fi
|
||||||
status=`expr $status + $ret`
|
status=`expr $status + $ret`
|
||||||
|
|
||||||
|
echo "I: checking that named-checkconf -z skips zone check with alternate databases"
|
||||||
|
ret=0
|
||||||
|
$CHECKCONF -z altdb.conf > /dev/null 2>&1 || ret=1
|
||||||
|
if [ $ret != 0 ]; then echo "I:failed"; ret=1; fi
|
||||||
|
status=`expr $status + $ret`
|
||||||
|
|
||||||
|
echo "I: checking that named-checkconf -z skips zone check with DLZ"
|
||||||
|
ret=0
|
||||||
|
$CHECKCONF -z altdlz.conf > /dev/null 2>&1 || ret=1
|
||||||
|
if [ $ret != 0 ]; then echo "I:failed"; ret=1; fi
|
||||||
|
status=`expr $status + $ret`
|
||||||
|
|
||||||
echo "I:exit status: $status"
|
echo "I:exit status: $status"
|
||||||
exit $status
|
exit $status
|
||||||
|
Loading…
x
Reference in New Issue
Block a user