Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • BIND BIND
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 569
    • Issues 569
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 96
    • Merge requests 96
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • ISC Open Source ProjectsISC Open Source Projects
  • BINDBIND
  • Issues
  • #281
Closed
Open
Issue created May 22, 2018 by Brian Conry@bconryContributor

9.11.3-S1 totext_nsec3 inserts a redundant white space between next hash and type map [ISC-support #12887]

It now inserts two spaces like this:

1 0 10 333CE2965C8CED75929F 8EJE0O8JKCEL3SGRS8KK18ATDP6EQ270  NS SOA RRSIG DNSKEY NSEC3PARAM

That's still a valid textual representation standard-wise, but would look a bit more awkward. Furthermore, for us specifically it would break an assumption of an RDATA text matching script, so it's not only cosmetic.

The redundant space is inserted because rdata.c:typemap_totext() initializes 'first' to false (which is obviously wrong):

typemap_totext(isc_region_t *sr, dns_rdata_textctx_t *tctx,
	       isc_buffer_t *target)
{
	unsigned int i, j, k;
	unsigned int window, len;
	isc_boolean_t first = ISC_FALSE;

But fixing it would then break totext_nsec(). You'll now need to add a space before calling typemap_totext() as follows:

@@ -65,6 +65,7 @@ totext_nsec(ARGS_TOTEXT) {
 	dns_name_fromregion(&name, &sr);
 	isc_region_consume(&sr, name_length(&name));
 	RETERR(dns_name_totext(&name, ISC_FALSE, target));
+	RETERR(str_totext(" ", target));
 	return (typemap_totext(&sr, NULL, target));
 }

Whether the added space was intentional or not, I'd also point it out it should have been easily detected (in case it was intentional) or assured (in case it was intentional) with a simple test in rdata_test.c (something similar to the 'nsec' test). I'd suggest you adding tests like that whenever you try to tweak textual output.

Edited May 22, 2018 by Brian Conry
Assignee
Assign to
Time tracking