Subject: | fix for parsing NSEC3 and NSEC3PARAM records |
Date: | Fri, 22 Jul 2011 17:43:02 +0100 |
To: | bug-Net-DNS-ZoneParse [...] rt.cpan.org |
From: | Anthony Kirby <anthony [...] anthony.org> |
Hi Benjamin,
thank you for Net::DNS::ZoneParse - I'm finding it very useful!
I think I've fixed a problem with parsing NSEC3 and NSEC3PARAM
records; the pattern used to match TTLs also inadvertently matches
"NSEC3" and "NSEC3PARAM". It can be easily fixed by anchoring the
regex that looks for the TTL.
ZoneParse::Parser::_dns_parse_line use regex "$_dns_ttlre" to match
the TTL, with BIND's W/d/h/m/s extensions
if($type =~ $_dns_ttlre) {
$prep{ttl} = $1;
next;
}
but this matches _anything_ with a number in it :-(
Suggested patch is
ZoneParse/Parser/Native.pm
39c39
< my $_dns_ttlre = qr/(\d+[\dwdhms]*)/;
---
Show quoted text
> my $_dns_ttlre = qr/^(\d+[\dwdhms]*)$/;
context:
Net-DNS-ZoneParse-0.102
Perl v5.10.1 (*) built for x86_64-linux-gnu-thread-multi
Linux 2.6.32-32-generic #62-Ubuntu SMP Wed Apr 20 21:52:38 UTC 2011
x86_64 GNU/Linux
I hope this is helpful...
many thanks!
Anthony