From 3aa2f81cf52e50743f7ff29635ed496df51dd5fe Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Fri, 4 Apr 2008 00:35:45 +0000 Subject: [PATCH] Correct parsing of previous record --- bind8/CHANGELOG | 2 ++ bind8/edit_slave.cgi | 4 ++-- bind8/records-lib.pl | 7 ++++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/bind8/CHANGELOG b/bind8/CHANGELOG index ba5fac4bff..931521629c 100644 --- a/bind8/CHANGELOG +++ b/bind8/CHANGELOG @@ -69,3 +69,5 @@ BIND on Windows can now be configured using this module. Mass record creation can now add records for the domain name (by entering @ as the name), as records that already exist. ---- Changes since 1.400 ---- Keys in ACL sections are no long mangled by Webmin. This means that each IP or key must be entered on a separate line in the Access Control Lists page. +---- Changes since 1.410 ---- +Corrected parsing of records in zone files with no names, which inherit from the previous record. diff --git a/bind8/edit_slave.cgi b/bind8/edit_slave.cgi index 6f634edd30..69ac587280 100755 --- a/bind8/edit_slave.cgi +++ b/bind8/edit_slave.cgi @@ -43,9 +43,9 @@ if ($zone->{'file'}) { if ($config{'show_list'}) { # display as list $mid = int((@rcodes+1)/2); - print "
\n"; + print "
\n"; &types_table(@rcodes[0..$mid-1]); - print "\n"; + print "\n"; &types_table(@rcodes[$mid..$#rcodes]); print "
\n"; } diff --git a/bind8/records-lib.pl b/bind8/records-lib.pl index d88fcdb80d..10791f4fc0 100644 --- a/bind8/records-lib.pl +++ b/bind8/records-lib.pl @@ -207,7 +207,12 @@ sub read_zone_file $i++; } if ($dir{'name'} eq '') { - local $prv = $#rv >= 0 ? $rv[$#rv] : $_[2]; + # Name comes from previous record + for(my $p=$#rv; $p>=0; $p--) { + $prv = $rv[$p]; + last if ($prv->{'name'}); + } + $prv ||= $_[2]; $prv || &error(&text('efirst', $lnum[$i]+1, $file)); $dir{'name'} = $prv->{'name'}; $dir{'realname'} = $prv->{'realname'};