From: ianmdlvl Date: Sat, 12 Jan 2002 20:11:30 +0000 (+0000) Subject: @@ -1,3 +1,9 @@ X-Git-Tag: debian_version_2_2_2~2 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=chiark-utils.git;a=commitdiff_plain;h=750246f8aec98db8252f896b25e3a3bb64f2e1fb @@ -1,3 +1,9 @@ +chiark-utils (2.2.2) unstable; urgency=low + + * chiark-named-conf does checks on all slaves even for `*' zones. + + -- + chiark-utils (2.2.1) unstable; urgency=low * chiark-named-conf gets list of delegated servers right when doing --- diff --git a/debian/changelog b/debian/changelog index 2395d7f..de171aa 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +chiark-utils (2.2.2) unstable; urgency=low + + * chiark-named-conf does checks on all slaves even for `*' zones. + + -- + chiark-utils (2.2.1) unstable; urgency=low * chiark-named-conf gets list of delegated servers right when doing diff --git a/scripts/named-conf b/scripts/named-conf index 68765c6..6d17775 100755 --- a/scripts/named-conf +++ b/scripts/named-conf @@ -286,8 +286,7 @@ sub process_zones (@) { eval { if ($localonly && $cfg->{'s'} =~ m/f/) { zone_warning("foreign zone specified with -l",''); - } elsif ($cfg->{'s'} =~ m/\*/ || - ($localonly && $cfg->{'s'} !~ m/p/)) { + } elsif ($localonly && $cfg->{'s'} !~ m/p/) { zone_check_local(); } else { zone_check_full(); @@ -352,28 +351,32 @@ sub zone_reset() { } sub zone_investigate() { - my ($super_zone, @super_nsnames, - $super_ns, @super_ns_addrs, $s, $wa, $name_if_auth, + my ($super_zone, @start_nsnames, $start_ww, + $start_ns, @start_ns_addrs, $s, $wa, $name_if_auth, %nsrrset_checked, %soa_checked, $addr, $glueless_ok, $rcode, $name, $is_ns); - $super_zone= $zone; - for (;;) { - debug_trace("zone $zone superzone $super_zone"); - $super_zone =~ s/^[^.]+\.// or die "no superzone ? ($super_zone)\n"; - ($rcode,@super_nsnames)= - lookup($super_zone,'ns-','06',"superzone search"); - last if !$rcode; + if ($cfg->{'s'} !~ m/\*/) { + $super_zone= $zone; + for (;;) { + debug_trace("zone $zone superzone $super_zone"); + $super_zone =~ s/^[^.]+\.// + or die "no superzone ? ($super_zone)\n"; + ($rcode,@start_nsnames)= + lookup($super_zone,'ns-','06',"superzone search"); + last if !$rcode; + } + $start_ww= "server for $super_zone"; + } else { + ($rcode,@start_nsnames)= + lookup($zone,'ns-','0',"initial nameserver search"); + $start_ww= "nameserver for $zone"; } - for $super_ns (@super_nsnames) { - $super_ns= lc $super_ns; - ($rcode,@super_ns_addrs)= - lookup($super_ns,'a','0',"published nameserver"); - foreach $addr (@super_ns_addrs) { - push @to_check, - $addr, - "$super_ns, server for $super_zone", - undef, 0; + for $start_ns (@start_nsnames) { + $start_ns= lc $start_ns; + ($rcode,@start_ns_addrs)= lookup($start_ns,'a','0',"$start_ww"); + foreach $addr (@start_ns_addrs) { + push @to_check, $addr, "$start_ns, $start_ww", undef, 0; } } for (;;) { @@ -407,8 +410,7 @@ sub zone_check_nsrrset ($$$$) { $s2g{lc $dig_rdata} = [ ]; } elsif ($dig_type eq 'a' && exists $s2g{$dig_owner}) { $wwn= "in glue from $ww"; - push @to_check, $dig_rdata, "$dig_owner, $wwn", $dig_owner, 0; - zone_server_addr($dig_rdata,$dig_owner,$wwn,"NS [$uaddr]",0); + zone_server_queue($dig_rdata,$dig_owner,$wwn,"NS [$uaddr]",0); push @{ $s2g{$dig_owner} }, $dig_rdata; } }, @@ -432,8 +434,7 @@ sub zone_check_nsrrset ($$$$) { ($rcode,@glue)= lookup($s,'a','0',"glueless NS from $ww"); foreach $a (@glue) { $wwn= "glueless NS from $ww"; - push @to_check, $a, "$s, $wwn", $s, 0; - zone_server_addr($a,$s,$wwn,"NS [$uaddr]",0); + zone_server_queue($a,$s,$wwn,"NS [$uaddr]",0); } } $glue= join ' ', sort @glue; @@ -461,6 +462,12 @@ sub zone_ns_name ($$) { @{ $cfg->{'self_ns'} }, @{ $cfg->{'self_soa'} }; } +sub zone_server_queue ($$$$$) { + my ($addr,$name,$wwn,$wwq,$is_soa) = @_; + zone_server_addr($addr,$name,$wwn,$wwq,$is_soa); + push @to_check, $addr, "$name, $wwn", $name, $is_soa; +} + sub zone_server_addr ($$$$$) { my ($addr,$name,$ww,$wwq,$is_soa) = @_; debug_trace("zone_server_addr ".join '|',@_); @@ -516,8 +523,7 @@ sub zone_check_soa ($$$$) { ($rcode,@soa_addrs)= lookup($origin,'a','0',"SOA ORIGIN"); $wwn= "SOA ORIGIN from $ww"; foreach $soa_addr (@soa_addrs) { - zone_server_addr($soa_addr,$origin,$wwn,"SOA [$uaddr]",1); - push @to_check, $soa_addr, "$origin, $wwn", $origin, 1; + zone_server_queue($soa_addr,$origin,$wwn,"SOA [$uaddr]",1); } }