bind8/ 0040755 0005671 0000012 00000000000 10535105465 011552 5 ustar jcameron wheel bind8/master_form.cgi 0100755 0005671 0000012 00000007352 10233321233 014547 0 ustar jcameron wheel #!/usr/local/bin/perl # master_form.cgi # Form for creating a new master zone require './bind8-lib.pl'; &ReadParse(); $access{'master'} || &error($text{'mcreate_ecannot'}); &ui_print_header(undef, $text{'mcreate_title'}, ""); print "
\n"; &ui_print_footer("", $text{'index_return'}); bind8/bind8-lib.pl 0100644 0005671 0000012 00000170535 10530445073 013664 0 ustar jcameron wheel # bind8-lib.pl # Common functions for bind8 config files do '../web-lib.pl'; &init_config(); do 'records-lib.pl'; do '../ui-lib.pl'; @extra_forward = split(/\s+/, $config{'extra_forward'}); @extra_reverse = split(/\s+/, $config{'extra_reverse'}); %is_extra = map { $_, 1 } (@extra_forward, @extra_reverse); %access = &get_module_acl(); $zone_names_cache = "$module_config_directory/zone-names"; $zone_names_version = 2; if (open(VERSION, "$module_config_directory/version")) { chop($bind_version =$text{'forwarding_ip'} | ". "$text{'forwarding_port'} |
\n"; $rv .= " | \n"; $rv .= " |
$out"; } } else { # Kill the process local $pidfile = &get_pid_file(); local $pid = &check_pid_file(&make_chroot($pidfile, 1)); if (!$pid || !&kill_logged('TERM', $pid)) { return $text{'stop_epid'}; } } return undef; } # is_bind_running() # Returns the PID if BIND is running sub is_bind_running { local $pidfile = &get_pid_file(); return &check_pid_file(&make_chroot($pidfile, 1)); } # version_atleast(v1, v2, v3) sub version_atleast { local @vsp = split(/\./, $bind_version); local $i; for($i=0; $i<@vsp || $i<@_; $i++) { return 0 if ($vsp[$i] < $_[$i]); return 1 if ($vsp[$i] > $_[$i]); } return 1; # same! } # get_zone_index(name, [view]) # Returns the index of some zone in the real on-disk configuration sub get_zone_index { undef(@get_config_cache); local $conf = &get_config(); local $vconf = $_[1] ne '' ? $conf->[$in{'view'}]->{'members'} : $conf; local $c; foreach $c (@$vconf) { if ($c->{'name'} eq 'zone' && $c->{'value'} eq $_[0]) { return $c->{'index'}; } } return undef; } # create_zone(&zone, &conf, [view-idx]) # Convenience function for adding a new zone sub create_zone { local ($dir, $conf, $viewidx) = @_; if ($viewidx ne "") { # Adding inside a view local $view = $conf->[$viewidx]; &lock_file(&make_chroot($view->{'file'})); &save_directive($view, undef, [ $dir ], 1); &flush_file_lines(); &unlock_file(&make_chroot($view->{'file'})); } else { # Adding at top level $dir->{'file'} = &add_to_file(); local $pconf = &get_config_parent($dir->{'file'}); &lock_file(&make_chroot($dir->{'file'})); &save_directive($pconf, undef, [ $dir ], 0); &flush_file_lines(); &unlock_file(&make_chroot($dir->{'file'})); } &flush_zone_names(); } $heiropen_file = "$module_config_directory/heiropen"; # get_heiropen() # Returns an array of open categories sub get_heiropen { open(HEIROPEN, $heiropen_file); local @heiropen =
\n"; @recs = &read_zone_file($zone->{'file'}, $dom); if ($dom =~ /in-addr\.arpa/i || $dom =~ /\.$ipv6revzone/i) { @rcodes = &get_reverse_record_types(); } else { @rcodes = &get_forward_record_types(); } foreach $c (@rcodes) { $rnum{$c} = 0; } foreach $r (@recs) { $rnum{$r->{'type'}}++; if ($r->{'type'} eq "SOA") { $soa = $r; } } if ($config{'show_list'}) { # display as list $mid = int((@rcodes+1)/2); print "
\n"; &types_table(@rcodes[0..$mid-1]); print " | \n"; &types_table(@rcodes[$mid..$#rcodes]); print " |
\n"; } print "
\n"; &ui_print_footer(($tv eq "master" ? "edit_master.cgi" : $tv eq "forward" ? "edit_forward.cgi" : "edit_slave.cgi"). "?index=$in{'index'}&view=$in{'view'}", $text{'master_return'}); bind8/config-turbo-linux 0100644 0005671 0000012 00000001067 10376051766 015240 0 ustar jcameron wheel soa_style=1 named_path=/usr/sbin/named named_conf=/etc/named.conf show_list=0 records_order=1 max_zones=50 rev_def=0 support_aaaa=0 allow_comments=0 allow_wild=0 allow_long=0 master_ttl=1 whois_cmd=whois short_names=0 updserial_def=0 updserial_on=1 updserial_man=1 ndc_cmd=ndc forwardzonefilename_format=ZONE.hosts reversezonefilename_format=ZONE.rev rev_must=0 ipv6_mode=1 allow_underscore=1 by_view=0 confirm_zone=1 confirm_rec=0 no_chroot=0 relative_paths=0 rndc_cmd=rndc no_pid_chroot=0 soa_start=0 rndc_conf=/etc/rndc.conf rndcconf_cmd=rndc-confgen largezones=0 bind8/create_slave.cgi 0100755 0005671 0000012 00000007217 10441635331 014676 0 ustar jcameron wheel #!/usr/local/bin/perl # create_slave.cgi # Create a new slave zone # Modified by Howard Wilkinson".join("
", map { "$_->[0]->{'host'} : $_->[1]" }
@slaveerrs)));
}
}
&redirect(($in{'type'} ? "edit_slave.cgi" : "edit_stub.cgi").
"?index=$idx&view=$in{'view'}");
bind8/slave_form.cgi 0100755 0005671 0000012 00000004772 10370036213 014374 0 ustar jcameron wheel #!/usr/local/bin/perl
# slave_form.cgi
# A form for creating a new slave or stub zone
require './bind8-lib.pl';
$type = ($0 =~ /slave_form/);
$access{'slave'} || &error($type ? $text{'screate_ecannot1'}
: $text{'screate_ecannot2'});
&ui_print_header(undef, $type ? $text{'screate_title1'} : $text{'screate_title2'}, "");
print "
\n";
if ($len) {
# sort list of zones
@zorder = sort { $ztitles[$a] cmp $ztitles[$b] } (0 .. $len-1);
@zlinks = map { $zlinks[$_] } @zorder;
@ztitles = map { $ztitles[$_] } @zorder;
@zicons = map { $zicons[$_] } @zorder;
@ztypes = map { $ztypes[$_] } @zorder;
@zdels = map { $zdels[$_] } @zorder;
if ($config{'show_list'}) {
# display as list
$mid = int((@zlinks+1)/2);
print &ui_form_start("mass_delete.cgi", "post");
print &select_all_link("d", 0),"\n";
print &select_invert_link("d", 0),"
\n";
print "
\n"; &zones_table([ @zlinks[0 .. $mid-1] ], [ @ztitles[0 .. $mid-1] ], [ @ztypes[0 .. $mid-1] ], [ @zdels[0 .. $mid-1] ] ); print " | \n"; if ($mid < @zlinks) { &zones_table([ @zlinks[$mid .. $#zlinks] ], [ @ztitles[$mid .. $#ztitles] ], [ @ztypes[$mid .. $#ztypes] ], [ @zdels[$mid .. $#zdels] ]); } print " |
\n"; } &ui_print_footer("", $text{'index_return'}); bind8/acl_security.pl 0100644 0005671 0000012 00000021466 10365526617 014612 0 ustar jcameron wheel require 'bind8-lib.pl'; # acl_security_form(&options) # Output HTML for editing security options for the bind8 module sub acl_security_form { local $m = $_[0]->{'zones'} eq '*' ? 1 : $_[0]->{'zones'} =~ /^\!/ ? 2 : 0; print "
\n";
printf " %s \n", $m == 1 ? 'checked' : '', $text{'acl_zall'}; printf " %s \n", $m == 0 ? 'checked' : '', $text{'acl_zsel'}; printf " %s | \n",
$m == 2 ? 'checked' : '', $text{'acl_znsel'};
print "
\n";
printf " %s \n", $m == 1 ? 'checked' : '', $text{'acl_vall'}; printf " %s \n", $m == 0 ? 'checked' : '', $text{'acl_vsel'}; printf " %s | \n",
$m == 2 ? 'checked' : '', $text{'acl_vnsel'};
print "
$text{'fcreate_opts'} | ||||||||||||||||
|
\n"; print "\n"; print "
\n"; if ($type eq 'hint') { print $text{'delete_mesg2'},"
\n"; } else { print &text('delete_mesg', "".&ip6int_to_net(&arpa_to_ip( $zconf->{'value'})).""),"
\n"; } print "
".join("
", map { "$_->[0]->{'host'} : $_->[1]" }
@slaveerrs)));
}
}
&redirect("");
sub slave_error_handler
{
$slave_error = $_[0];
}
bind8/conf_servers.cgi 0100755 0005671 0000012 00000004204 10231647376 014741 0 ustar jcameron wheel #!/usr/local/bin/perl
# conf_servers.cgi
# Display options for other DNS servers
require './bind8-lib.pl';
$access{'defaults'} || &error($text{'servers_ecannot'});
&ui_print_header(undef, $text{'servers_title'}, "");
$conf = &get_config();
@servers = ( &find("server", $conf), { } );
@keys = &find("key", $conf);
print "
$text{'servers_ip'} | ", "$text{'servers_bogus'} | ", "$text{'servers_format'} | ", "$text{'servers_trans'} | ", (@keys ? "$text{'servers_keys'} | " : ""), "
\n", $s->{'value'}; $bogus = &find_value("bogus", $s->{'members'}); printf " | %s\n", lc($bogus) eq 'yes' ? "checked" : "", $text{'yes'}; printf " %s | \n", lc($bogus) eq 'yes' ? "" : "checked", $text{'no'}; $format = &find_value("transfer-format", $s->{'members'}); printf "%s\n", lc($format) eq 'one-answer' ? "checked" : "", $text{'servers_one'}; printf " %s\n", lc($format) eq 'many-answers' ? "checked" : "", $text{'servers_many'}; printf " %s | \n", $format ? "" : "checked", $text{'default'}; printf "\n", &find_value("transfers", $s->{'members'}); if (@keys) { local %haskey; $keys = &find("keys", $s->{'members'}); foreach $k (@{$keys->{'members'}}) { $haskey{$k->{'name'}}++; } print " | \n"; foreach $k (@keys) { local $v = $k->{'value'}; printf " %s\n", $v, $haskey{$v} ? "checked" : "", $v; } print " | \n"; } print "
\n"; &types_table(@rcodes[0..$mid-1]); print " | \n"; &types_table(@rcodes[$mid..$#rcodes]); print " |
\n"; print "\n"; print " | $text{'master_delmsg'}\n"; if ($dom !~ /in-addr\.arpa/i && $dom !~ /\.$ipv6revzone/i) { print "$text{'master_delrev'}\n"; } print " |
\n"; print "\n"; $args = $view ? "$dom IN $view->{'value'}" : $dom; $cmd = &has_ndc() == 2 ? $config{'rndc_cmd'} : $config{'ndc_cmd'}; print " | ",&text('master_applymsg', "$cmd reload $args"); print " |
",&text('index_enamed', "$config{'named_path'}", "$gconfig{'webprefix'}/config.cgi?$module_name"),"
\n"; &foreign_require("software", "software-lib.pl"); $lnk = &software::missing_install_link("bind", $text{'index_bind'}, "../$module_name/", $text{'index_title'}); print $lnk,"
\n" if ($lnk); &ui_print_footer("/", $text{"index"}); exit; } # Check if BIND is the right version.. Only BIND 8/9 offers the -f option # Is there a better way to do this? if ($out = &check_bind_8()) { &ui_print_header(undef, $text{'index_title'}, "", undef, 1, 1, 0, &help_search_link("bind", "doc", "google")); print "
",&text('index_eversion', "$config{'named_path'}", "/dnsadmin/", "$config{'named_path'} -help", "
$out"),"
\n"; &ui_print_footer("/", $text{"index"}); exit; } # Try to get the version number $out = `$config{'named_path'} -v 2>&1`; if ($out =~ /(bind|named)\s+([0-9\.]+)/i) { $bind_version = $2; } &open_tempfile(VERSION, ">$module_config_directory/version"); &print_tempfile(VERSION, "$bind_version\n"); &close_tempfile(VERSION); # Get the list of zones @allzones = &list_zone_names(); @zones = grep { $_->{'type'} ne 'view' && &can_edit_zone($_) && (!$access{'ro'} || $_->{'name'} ne '.') } @allzones; @views = grep { $_->{'type'} eq 'view' } @allzones; ($hashint) = grep { $_->{'type'} ne 'view' && $_->{'name'} eq '.' } @allzones; if (@zones == 1 && $access{'zones'} ne '*' && !$access{'defaults'} && !$access{'views'} && $access{'apply'} != 1 && !$access{'master'} && !$access{'slave'} && !$access{'forward'} && $access{'noconfig'}) { # Only one zone, so go direct to it &redirect("edit_master.cgi?index=$zones[0]->{'index'}"); exit; } $chroot = &get_chroot(); &ui_print_header(undef, $text{'index_title'}, "", undef, 1, 1, 0, &help_search_link("bind", "doc", "google"), undef, undef, &text($chroot eq "/" || !$chroot ? 'index_version' : 'index_chroot', $bind_version, "$chroot")); # If the named.conf file does not exist, offer to create it if ($need_create) { print &text('index_eempty', "".&make_chroot($config{'named_conf'}).""),"
\n"; print "
\n"; print " ", "$text{'index_download'}
\n"; print " $text{'index_webmin'}
\n"; print "
$text{'index_toomany'}
\n"; print "
\n"; &zones_table([ @zlinks[0 .. $mid-1] ], [ @ztitles[0 .. $mid-1] ], [ @ztypes[0 .. $mid-1] ], [ @zdels[0 .. $mid-1] ] ); print " | \n"; if ($mid < @zlinks) { &zones_table([ @zlinks[$mid .. $#zlinks] ], [ @ztitles[$mid .. $#ztitles] ], [ @ztypes[$mid .. $#ztypes] ], [ @zdels[$mid .. $#zdels] ]); } print " |
\n"; &zones_table([ @zlinks[0 .. $mid-1] ], [ @ztitles[0 .. $mid-1] ], [ @ztypes[0 .. $mid-1] ], [ @zdels[0 .. $mid-1] ]); print " | \n"; if ($mid < @zlinks) { &zones_table([ @zlinks[$mid .. $#zlinks] ], [ @ztitles[$mid .. $#ztitles] ], [ @ztypes[$mid .. $#ztypes] ], [ @zdels[$mid .. $#zdels] ]); } print " |
\n"; } &show_buttons(); if ($access{'views'} && $bind_version >= 9) { # Display list of views print "
\n"; } print "$text{'index_addview'}
\n" if (!$access{'ro'} && $access{'views'} != 2); } # read the PID if (!$access{'ro'} && ($access{'apply'} == 1 || $access{'apply'} == 3)) { print "
".join("
", map { "$_->[0]->{'host'} : $_->[1]" }
@slaveerrs)));
}
}
&redirect("edit_master.cgi?index=$idx&view=$in{'view'}");
bind8/edit_slave.cgi 0100755 0005671 0000012 00000007620 10427716740 014366 0 ustar jcameron wheel #!/usr/local/bin/perl
# edit_slave.cgi
# Display records and other info for an existing slave or stub zone
require './bind8-lib.pl';
&ReadParse();
$zone = &get_zone_name($in{'index'}, $in{'view'});
$dom = $zone->{'name'};
&can_edit_zone($zone) ||
&error($text{'slave_ecannot'});
$desc = &ip6int_to_net(&arpa_to_ip($dom));
if ($zone->{'file'}) {
@st = stat(&make_chroot($zone->{'file'}));
$lasttrans = &text('slave_last', @st && $st[7] ? &make_date($st[9])
: $text{'slave_never'});
}
&ui_print_header($desc, $0 =~ /edit_slave/ ? $text{'slave_title'}
: $text{'stub_title'},
"", undef, 0, 0, 0, undef, undef, undef, $lasttrans);
if ($zone->{'file'}) {
print "
\n"; @recs = &read_zone_file($zone->{'file'}, $dom); if ($dom =~ /in-addr\.arpa/i || $dom =~ /\.$ipv6revzone/i) { @rcodes = &get_reverse_record_types(); } else { @rcodes = &get_forward_record_types(); } foreach $c (@rcodes) { $rnum{$c} = 0; } foreach $r (@recs) { $rnum{$r->{'type'}}++; if ($r->{'type'} eq "SOA") { $soa = $r; } } if ($config{'show_list'}) { # display as list $mid = int((@rcodes+1)/2); print "
\n"; &types_table(@rcodes[0..$mid-1]); print " | \n"; &types_table(@rcodes[$mid..$#rcodes]); print " |
\n"; print "\n"; print " | $text{'slave_delmsg'}\n"; print " |
\n"; print "\n"; $args = $view ? "$dom IN $view->{'value'}" : $dom; $cmd = &has_ndc() == 2 ? $config{'rndc_cmd'} : $config{'ndc_cmd'}; print " | ",&text('slave_applymsg', "$cmd reload $args"); print " |
$text{'master_params'} | ||||||||||||||||||
|
\n"; &ui_print_footer("edit_master.cgi?index=$in{'index'}&view=$in{'view'}", $text{'master_return'}); bind8/config.info.ru_SU 0100644 0005671 0000012 00000004033 10067401527 014723 0 ustar jcameron wheel line0= BIND,11 chroot= chroot, BIND,3, named_user=, BIND,3, named_group=, BIND,3, zones_file= ,3,named.conf line1= ,11 show_list= ,1,0-,1- records_order= ,1,1- ,2- ,3- IP,0- max_zones= ,0 rev_def= ,1,0- ,1- ,2- support_aaaa= DNS IPv6,1,0-,1- allow_comments= ,1,0-,1- allow_wild= ( ),1,0-,1- allow_long= ,1,0-,1- short_names= ?,1,0-,1- by_view= ?,1,1-,0- line2= ,11 soa_style= ,1,0- ,1- () master_ttl= $ttl ,1,1-,0- master_dir= master,3, slave_dir= slave/stub,3, forwardzonefilename_format= forward,0 reversezonefilename_format= ,0 file_owner= (:),3, file_perms= ( ),3, default_master= () slave,0 default_slave= ,0 updserial_on= ,1,1-,0- line3= ,11 named_conf= named.conf,0 named_path= named,0 whois_cmd= whois,0 ndc_cmd= ,0 pid_file= PID ,3,/var/run/named.pid start_cmd= BIND,3, bind8/config.info.zh_CN 0100644 0005671 0000012 00000001233 07224543151 014667 0 ustar jcameron wheel named_conf=named.conf ļ·,0 named_path=named ļ·,0 show_list=ʾʽ,1,0-ͼ,1-б soa_style=к,1,0-б,1- (YYYYMMDDnn) records_order=,1,1-,2-ֵ,3-By IP,0-ӵ˳ chroot=ı䵽Ŀ¼ BIND ķʽ,3,Default start_cmd=ʼ BIND ,3,Default max_zones=Ҫʾ,0 rev_def=,1,0-ȱʡ,1-ȱʡ named_user= BIND ûķʽ,3,Ĭ named_group= BIND Ϊ,3,Ĭ master_dir=ļĿ¼,3,Ĭ slave_dir=slave/stub ļĿ¼,3,Ĭ support_aaaa=DNS IPv6 ַ,1,0-,1- allow_comments=עͼ¼,1,0-,1- allow_wild=ͨ (Ƽ),1,0-,1- allow_long=,1,0-,1- bind8/conf_zonedef.cgi 0100755 0005671 0000012 00000010311 10267115061 014664 0 ustar jcameron wheel #!/usr/local/bin/perl # conf_zonedef.cgi # Display defaults for master zones require './bind8-lib.pl'; $access{'defaults'} || &error($text{'zonedef_ecannot'}); &ui_print_header(undef, $text{'zonedef_title'}, ""); print "
$text{'zonedef_msg'} | ||||||||||||||||||||||||||
|
$text{'zonedef_msg2'} |
",$type ? $text{'screate_header1'} : $text{'screate_header2'}," | ||||||||||||||||||||||||
|
$text{'misc_header'} | ||||||||