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