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

Don't insert 2nd space between NSEC3 nexthash and typemap fields

This commit is contained in:
Mukund Sivaraman
2018-05-23 18:40:48 +05:30
committed by Mark Andrews
parent 374746430d
commit d4ea1edd2c
6 changed files with 19 additions and 7 deletions

View File

@@ -469,7 +469,7 @@ typemap_totext(isc_region_t *sr, dns_rdata_textctx_t *tctx,
{
unsigned int i, j, k;
unsigned int window, len;
isc_boolean_t first = ISC_FALSE;
isc_boolean_t first = ISC_TRUE;
for (i = 0; i < sr->length; i += len) {
if (tctx != NULL &&

View File

@@ -69,6 +69,12 @@ totext_csync(ARGS_TOTEXT) {
snprintf(buf, sizeof(buf), "%lu", num);
RETERR(str_totext(buf, target));
/*
* Don't leave a trailing space when there's no typemap present.
*/
if (sr.length > 0) {
RETERR(str_totext(" ", target));
}
return (typemap_totext(&sr, NULL, target));
}

View File

@@ -162,9 +162,9 @@ totext_nsec3(ARGS_TOTEXT) {
/*
* Don't leave a trailing space when there's no typemap present.
*/
if (((tctx->flags & DNS_STYLEFLAG_MULTILINE) == 0) && (sr.length > 0))
if (((tctx->flags & DNS_STYLEFLAG_MULTILINE) == 0) && (sr.length > 0)) {
RETERR(str_totext(" ", target));
}
RETERR(typemap_totext(&sr, tctx, target));
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)

View File

@@ -61,6 +61,12 @@ totext_nsec(ARGS_TOTEXT) {
dns_name_fromregion(&name, &sr);
isc_region_consume(&sr, name_length(&name));
RETERR(dns_name_totext(&name, ISC_FALSE, target));
/*
* Don't leave a trailing space when there's no typemap present.
*/
if (sr.length > 0) {
RETERR(str_totext(" ", target));
}
return (typemap_totext(&sr, NULL, target));
}