Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: reto.burkhalter [...] basis06.com
Cc:
AdminCc:

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



Subject: Error deleting records from zone file
perl -v: This is perl, v5.6.1 built for i386-freebsd uname -a: FreeBSD 4.5-RELEASE Other versions of Perl and OS are also affected -------------------------------------------------------- Code snippet from my application: [...] [get values for $name and $host] my $zonefile = DNS::ZoneParse->new("$zone_dir/$domain"); $records = $zonefile->a(); # delete the desired entry my $counter = 0; foreach $record (@$records) { # match the "name" to delete if ($record->{name} eq $name) { # match the hostname in case a host is given (round robin support) if (($host eq '') || ($record->{host} eq $host)) { delete (@$records[$counter]); } } $counter++; } Bug seen: Sometimes there is a "IN" still standing on the deleted line. Ex. www IN A 10.0.0.1 after delete: IN This sometimes leads to corrupted zone files, since zoneparse tries to fill up empty lines with meaningful entries...
[guest - Tue Mar 9 12:36:17 2004]: Show quoted text
> Bug seen: > Sometimes there is a "IN" still standing on the deleted line. > Ex. > www IN A 10.0.0.1 > after delete: > IN > > This sometimes leads to corrupted zone files, since zoneparse tries > to fill up empty lines with meaningful entries...
Thanks for reporting this bug. Unfortunately I can't replicate the problem. Can you send me a sample zone file that exhibits this behaviour? Thanks Simon Flack
I "fixed" it with my own delete-routine (remove the line from the file...) I am not quite sure, if your tool was ever mentioned for deleting records (because it is not documented). I tried to delete records with the code sample posted at CPAN-rt tool. You may try to delete a record which is not the last one in the file. And also try to delete the last record in a zone file.
Use Split instead of Delete for removing array entries. Same problem here. Richard [guest - Mon Aug 23 10:58:35 2004]: Show quoted text
> I "fixed" it with my own delete-routine (remove the line from the > file...) > I am not quite sure, if your tool was ever mentioned for deleting > records > (because it is not documented). > I tried to delete records with the code sample posted at CPAN-rt
tool. Show quoted text
> > You may try to delete a record which is not the last one in the
file. Show quoted text
> And > also try to delete the last record in a zone file.