chiark / gitweb /
Fix problems with primary-dir
[chiark-utils.git] / scripts / named-conf
index 44261169a5b2978fc2ba376d2b759b669051c05d..f6c518b4f7d3161f632a67cef5996783ccb63419 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");
     }
 }