Commit b75970ef authored by Mark Andrews's avatar Mark Andrews
Browse files

named-checkconf triggered a assertion when a mirror zone had a bad name

parent 314a25e4
Pipeline #8214 passed with stages
in 21 minutes and 59 seconds
5116. [bug] Named/named-checkconf triggered a assertion when
a mirror zone's name is bad. [GL #778]
5115. [bug] Allow unsupported algorithms in zone when not used for 5115. [bug] Allow unsupported algorithms in zone when not used for
signing with dnssec-signzone. [GL #783] signing with dnssec-signzone. [GL #783]
   
......
zone "\0example" {
type mirror;
file "example.db";
};
...@@ -1958,7 +1958,7 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions, ...@@ -1958,7 +1958,7 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
unsigned int i; unsigned int i;
dns_rdataclass_t zclass; dns_rdataclass_t zclass;
dns_fixedname_t fixedname; dns_fixedname_t fixedname;
dns_name_t *zname = NULL; dns_name_t *zname = NULL; /* NULL if parsing of zone name fails. */
isc_buffer_t b; isc_buffer_t b;
bool root = false; bool root = false;
bool rfc1918 = false; bool rfc1918 = false;
...@@ -1977,10 +1977,10 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions, ...@@ -1977,10 +1977,10 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
}; };
static optionstable dialups[] = { static optionstable dialups[] = {
{ "notify", CFG_ZONE_MASTER | CFG_ZONE_SLAVE }, { "notify", CFG_ZONE_MASTER | CFG_ZONE_SLAVE },
{ "notify-passive", CFG_ZONE_SLAVE }, { "notify-passive", CFG_ZONE_SLAVE },
{ "passive", CFG_ZONE_SLAVE | CFG_ZONE_STUB }, { "passive", CFG_ZONE_SLAVE | CFG_ZONE_STUB },
{ "refresh", CFG_ZONE_SLAVE | CFG_ZONE_STUB }, { "refresh", CFG_ZONE_SLAVE | CFG_ZONE_STUB },
}; };
znamestr = cfg_obj_asstring(cfg_tuple_get(zconfig, "name")); znamestr = cfg_obj_asstring(cfg_tuple_get(zconfig, "name"));
...@@ -2273,7 +2273,8 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions, ...@@ -2273,7 +2273,8 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
* server list is used in the absence of one explicitly specified. * server list is used in the absence of one explicitly specified.
*/ */
if (ztype == CFG_ZONE_SLAVE || ztype == CFG_ZONE_STUB || if (ztype == CFG_ZONE_SLAVE || ztype == CFG_ZONE_STUB ||
(ztype == CFG_ZONE_MIRROR && !dns_name_equal(zname, dns_rootname))) (ztype == CFG_ZONE_MIRROR && zname != NULL &&
!dns_name_equal(zname, dns_rootname)))
{ {
obj = NULL; obj = NULL;
if (cfg_map_get(zoptions, "masters", &obj) != ISC_R_SUCCESS) { if (cfg_map_get(zoptions, "masters", &obj) != ISC_R_SUCCESS) {
...@@ -2567,7 +2568,6 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions, ...@@ -2567,7 +2568,6 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
} }
} }
/* /*
* Check that max-zone-ttl isn't used with masterfile-format map * Check that max-zone-ttl isn't used with masterfile-format map
*/ */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment