Skip Menu |

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

Report information
The Basics
Id: 3806
Status: resolved
Priority: 0/
Queue: DNS-ZoneParse

People
Owner: Nobody in particular
Requestors: thorsten [...] colt.net
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.91
Fixed in: (no value)



Subject: Error in RegEx Parsing BIND-Reverse Entries (IN PTR)
Bug in DNS::ZoneParse v0.91: There is a little error in the regex, ignoring single-digit reverse entries like this: 2 IN PTR i.think.so. 10 IN PTR i.think.so.too. only the row with '10' will be parsed , not the row with the '2'. Caused is this by the following regex in sub _parse: my $valid_name = qr/[\@a-z_\-\.0-9\*]+/i; replace it with: my $valid_name = qr/[\@a-z_\-\.0-9\*]*/i; and it also catches single digit entries.
FROM: Shaun [ISAT] unix-scripts.com I also ran into this problem. Thanks for the regex fix, i wish the developer would pay attention and update the module.
[guest - Thu Sep 18 08:00:46 2003]: Show quoted text
> Bug in DNS::ZoneParse v0.91: > > There is a little error in the regex, ignoring single-digit reverse > entries like this: > 2 IN PTR i.think.so. > 10 IN PTR i.think.so.too. > > only the row with '10' will be parsed , not the row with the '2'. > Caused is this by the following regex in sub _parse: > my $valid_name = qr/[\@a-z_\-\.0-9\*]+/i; > > replace it with: > my $valid_name = qr/[\@a-z_\-\.0-9\*]*/i; > > and it also catches single digit entries.
The following will also correct this problem, and may be a little more consistent with what the author intended. --- ZoneParse.pm Fri Jun 25 12:00:15 2004 +++ ZoneParse.pm Fri Jun 25 12:10:33 2004 @@ -239,7 +239,7 @@ email =>$5, serial => $6, refresh=> $7, retry=> $8, expire=> $9, minimumTTL => $10 }); } - elsif (/(\d$valid_name+)\s+($rr_ttl)?\s*?($rr_class)?\s*?PTR\s+($valid_name)/i) + elsif (/($valid_name+)\s+($rr_ttl)?\s*?($rr_class)?\s*?PTR\s+($valid_name)/i) { # PTR push @{$dns_ptr{$self}},