Skip Menu |

This queue is for tickets about the Net-DNS CPAN distribution.

Report information
The Basics
Id: 133655
Status: open
Priority: 0/
Queue: Net-DNS

People
Owner: Nobody in particular
Requestors: FANY [...] cpan.org
Cc: NNIS-15623 [...] jira.noris.de
AdminCc:

Bug Information
Severity: (no value)
Broken in:
  • 1.26
  • 1.28
Fixed in: (no value)



CC: NNIS-15623 [...] jira.noris.de
Subject: Parsing continuation lines
RFC 1035 reads: Show quoted text
> ( ) Parentheses are used to group data that crosses a line > boundary. In effect, line terminations are not > recognized within parentheses.
Unfortunately it does not explicitly state if the line termination counts as whitespace and thus separates RDATA fields. But that's at least the way BIND interprets it, e.g. if I write: test IN TXT ( foo bar ) test IN MX ( 42 mx.example.org. ) … BIND will serve it like this: test IN TXT "foo" "bar" test IN TXT 42 mx.example.org. But Net::DNS::ZoneFile just strips the line termination, thus the first record becomes: test IN TXT foobar And the second cannot be parsed at all: Show quoted text
> Argument "10mx" isn't numeric in integer addition (+) at /usr/local/lib/perl5/site_perl/5.32.0/Net/DNS/RR/MX.pm line 69, <GEN0> line 15.
This may be fixed by just adding an additional space when two lines are concatenated in Net::DNS::ZoneFile::_getline(), that is by replacing the line … $_ = pop(@token) . $_; # splice fragmented string … by … $_ = pop(@token) . " $_"; # splice fragmented string Please let me know if you are interested in a patch including a test for this. Regards Martin
On Mon Nov 02 10:11:55 2020, FANY wrote: Show quoted text
> > Unfortunately it does not explicitly state if the line termination > counts as whitespace and thus separates RDATA fields. But that's at > least the way BIND interprets it, e.g. if I write: > > test IN TXT ( foo > bar ) > test IN MX ( 42 > mx.example.org. )
The word "unfortunately" might apply to some unintended inconsistency or error by the author. There is no evidence to support that proposition. Section 5.1 contains two sentences which are relevant in the situation you describe: <character-string> is expressed in one or two ways: as a contiguous set of characters without interior spaces, or as a string beginning with a " and ending with a ". Inside a " delimited string any character can occur, except for a " itself, which must be quoted using \ (back slash). ( ) Parentheses are used to group data that crosses a line boundary. In effect, line terminations are not recognized within parentheses. Nowhere does RFC1035 specify or imply that the line terminator should be replaced by or interpreted as a space character. Consequently: The line terminator between 'foo' and 'bar' is not recognized. There is then nothing separating 'foo' from 'bar'. The RDATA element 'foobar' is parsed as a contiguous set of characters without interior spaces. Note that <line terminator> denotes a logical separator between lines, and does not refer to a <lf> or similar character. The code implements RFC1035 as written and is IMO correct.