Fix parsing of funny blocks like sortlist
authorJamie Cameron <jcameron@webmin.com>
Sun, 26 Apr 2009 05:40:25 +0000 (05:40 +0000)
committerJamie Cameron <jcameron@webmin.com>
Sun, 26 Apr 2009 05:40:25 +0000 (05:40 +0000)
bind8/CHANGELOG
bind8/bind8-lib.pl

index 1a7a14e..3999bcc 100644 (file)
@@ -106,3 +106,4 @@ When adding a master zone with automatically created slaves, add an also-notify
 ---- Changes since 1.480 ----
 Added mass record change and creation buttons to the zone search results page.
 Made the manual config file editor textboxes full-width.
+Fixed a bug that cause blocks like sortlist not be parsed properly, and possible cause Webmin to corrupt other parts of the named.conf file.
index 5c1ab9c..99e222c 100644 (file)
@@ -197,8 +197,15 @@ sub parse_struct
 {
 local (%str, $i, $j, $t, @vals);
 $i = ${$_[2]};
-$str{'name'} = lc($_[0]->[$i]);
 $str{'line'} = $_[1]->[$i];
+if ($_[0]->[$i] ne '{') {
+       # Has a name
+       $str{'name'} = lc($_[0]->[$i]);
+       }
+else {
+       # No name, so need to move token pointer back one
+       $i--;
+       }
 $str{'index'} = $_[3];
 $str{'file'} = $_[4];
 if ($str{'name'} eq 'inet') {