chiark / gitweb /
Fix problems with primary-dir
authorianmdlvl <ianmdlvl>
Wed, 2 Jan 2002 21:24:17 +0000 (21:24 +0000)
committerianmdlvl <ianmdlvl>
Wed, 2 Jan 2002 21:24:17 +0000 (21:24 +0000)
scripts/named-conf

index 4426116..f6c518b 100755 (executable)
@@ -151,7 +151,7 @@ sub read_config ($) {
            $suffix= '' if !defined $suffix;
            $subfile= '' if !defined $subfile;
            $suffix= '_db' if !length $suffix && !length $subfile;
-           if (-d "$dir$prefix") { $dir.=$prefix; $prefix=''; }
+           if (-d "$dir/$prefix") { $dir.='/'; $dir.=$prefix; $prefix=''; }
            opendir D, $dir or cfg_fail("open primary-dir $dir:\n $!");
            $lprefix= length $prefix; $lsuffix= length $suffix;
            while (defined($_= readdir D)) {
@@ -207,7 +207,10 @@ sub zone_conf ($$$$$@) {
            unless length $default_output;
        set_output($default_output);
     }
-    cfg_fail("redefined zone $zone") if exists $zone_cfg{$zone};
+    cfg_fail("redefined zone $zone\n".
+            " earlier definition $zone_cfg{$zone}{'where'}")
+       if exists $zone_cfg{$zone};
+    $zone_cfg{$zone}{'where'}= $where;
     $zone_cfg{$zone}{'file'}= $file;
     $zone_cfg{$zone}{'style_p'}= $style.$mod;
     $zone_cfg{$zone}{'s'}= $sabbr.$mod; # p)rimary s)econdary u)npub f)oreign
@@ -474,8 +477,8 @@ sub zone_servers_ok () {
        }
     }
     if ($cfg->{'s'} =~ m/s/ && !$delg_to_us) {
-       zone_warnmore("we are supposedly published secondary,".
-                     " but not listed as a nameserver");
+       zone_warning("we are supposedly published secondary,".
+                    " but not listed as a nameserver");
     }
 }