mirror of
https://github.com/isc-projects/bind9.git
synced 2026-02-21 00:40:39 -05:00
3795. [bug] Make named-checkconf detect raw masterfiles for
hint zones and reject them. [RT #35268]
Squashed commit of the following:
commit 5b0254711d6b77940d6217b9131b9d401df8a866
Author: Mukund Sivaraman <muks@isc.org>
Date: Fri Mar 28 02:09:01 2014 +0530
Remove redundant helper function
commit a4341c1a2ba830c8cee1def57a533f987f67c3dc
Author: Mark Andrews <marka@isc.org>
Date: Thu Jan 30 10:08:17 2014 +1100
error out if masterfile-format raw is specified for a hint zone.
(cherry picked from commit ef9334d745)
This commit is contained in:
parent
24356993e3
commit
8da4c8daec
4 changed files with 10 additions and 15 deletions
3
CHANGES
3
CHANGES
|
|
@ -1,3 +1,6 @@
|
|||
3795. [bug] Make named-checkconf detect raw masterfiles for
|
||||
hint zones and reject them. [RT #35268]
|
||||
|
||||
3794. [maint] Added AAAA for C.ROOT-SERVERS.NET.
|
||||
|
||||
3793. [bug] zone.c:save_nsec3param() could assert when out of
|
||||
|
|
|
|||
|
|
@ -142,18 +142,6 @@ get_checknames(const cfg_obj_t **maps, const cfg_obj_t **obj) {
|
|||
}
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
config_get(const cfg_obj_t **maps, const char *name, const cfg_obj_t **obj) {
|
||||
int i;
|
||||
|
||||
for (i = 0;; i++) {
|
||||
if (maps[i] == NULL)
|
||||
return (ISC_R_NOTFOUND);
|
||||
if (cfg_map_get(maps[i], name, obj) == ISC_R_SUCCESS)
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
configure_hint(const char *zfile, const char *zclass, isc_mem_t *mctx) {
|
||||
isc_result_t result;
|
||||
|
|
@ -366,8 +354,7 @@ configure_zone(const char *vclass, const char *view,
|
|||
|
||||
masterformat = dns_masterformat_text;
|
||||
fmtobj = NULL;
|
||||
result = config_get(maps, "masterfile-format", &fmtobj);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
if (get_maps(maps, "masterfile-format", &fmtobj)) {
|
||||
const char *masterformatstr = cfg_obj_asstring(fmtobj);
|
||||
if (strcasecmp(masterformatstr, "text") == 0)
|
||||
masterformat = dns_masterformat_text;
|
||||
|
|
|
|||
5
bin/tests/system/checkconf/bad-hint.conf
Normal file
5
bin/tests/system/checkconf/bad-hint.conf
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
zone "." {
|
||||
type hint;
|
||||
masterfile-format raw;
|
||||
file "hint";
|
||||
};
|
||||
|
|
@ -1367,7 +1367,7 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
|
|||
{ "integrity-check", MASTERZONE },
|
||||
{ "check-mx-cname", MASTERZONE },
|
||||
{ "check-srv-cname", MASTERZONE },
|
||||
{ "masterfile-format", MASTERZONE | SLAVEZONE | STUBZONE | HINTZONE |
|
||||
{ "masterfile-format", MASTERZONE | SLAVEZONE | STUBZONE |
|
||||
REDIRECTZONE },
|
||||
{ "update-check-ksk", MASTERZONE | SLAVEZONE },
|
||||
{ "dnssec-dnskey-kskonly", MASTERZONE | SLAVEZONE },
|
||||
|
|
|
|||
Loading…
Reference in a new issue