2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 14:35:26 +00:00

Merge branch '1655-bind-9-11-5-writes-syntax-errors-to-its-zone-cache' into 'master'

Resolve "BIND 9.11.5 writes syntax errors to its zone cache"

Closes #1655

See merge request isc-projects/bind9!3150
This commit is contained in:
Mark Andrews
2020-03-13 04:00:26 +00:00
3 changed files with 13 additions and 4 deletions

View File

@@ -1,3 +1,6 @@
5368. [bug] Named failed to restart if 'rndc addzone' names
contained special characters (e.g. '/'). [GL #1655]
5367. [placeholder]
5366. [bug] Fix a race condition with the keymgr when the same

View File

@@ -7779,6 +7779,7 @@ data_to_cfg(dns_view_t *view, MDB_val *key, MDB_val *data, isc_buffer_t **text,
const char *zone_config;
size_t zone_config_len;
cfg_obj_t *zoneconf = NULL;
char bufname[DNS_NAME_FORMATSIZE];
REQUIRE(view != NULL);
REQUIRE(key != NULL);
@@ -7801,20 +7802,23 @@ data_to_cfg(dns_view_t *view, MDB_val *key, MDB_val *data, isc_buffer_t **text,
INSIST(zone_config != NULL && zone_config_len > 0);
/* zone zonename { config; }; */
result = isc_buffer_reserve(text, 5 + zone_name_len + 1 +
result = isc_buffer_reserve(text, 6 + zone_name_len + 2 +
zone_config_len + 2);
if (result != ISC_R_SUCCESS) {
goto cleanup;
}
CHECK(putstr(text, "zone "));
CHECK(putstr(text, "zone \""));
CHECK(putmem(text, (const void *)zone_name, zone_name_len));
CHECK(putstr(text, " "));
CHECK(putstr(text, "\" "));
CHECK(putmem(text, (const void *)zone_config, zone_config_len));
CHECK(putstr(text, ";\n"));
snprintf(bufname, sizeof(bufname), "%.*s", (int)zone_name_len,
zone_name);
cfg_parser_reset(named_g_addparser);
result = cfg_parse_buffer(named_g_addparser, *text, zone_name, 0,
result = cfg_parse_buffer(named_g_addparser, *text, bufname, 0,
&cfg_type_addzoneconf, 0, &zoneconf);
if (result != ISC_R_SUCCESS) {
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,

View File

@@ -718,6 +718,8 @@ echo_i "check that named restarts with multiple added zones ($n)"
ret=0
$RNDCCMD 10.53.0.3 addzone "test4.baz" '{ type master; file "e.db"; };' > /dev/null 2>&1 || ret=1
$RNDCCMD 10.53.0.3 addzone "test5.baz" '{ type master; file "e.db"; };' > /dev/null 2>&1 || ret=1
$RNDCCMD 10.53.0.3 addzone '"test/.baz"' '{ type master; check-names ignore; file "e.db"; };' > /dev/null 2>&1 || ret=1
$RNDCCMD 10.53.0.3 addzone '"test\".baz"' '{ type master; check-names ignore; file "e.db"; };' > /dev/null 2>&1 || ret=1
$PERL $SYSTEMTESTTOP/stop.pl addzone ns3
$PERL $SYSTEMTESTTOP/start.pl --noclean --restart --port ${PORT} addzone ns3 || ret=1
retry_quiet 10 _check_version_bind || ret=1