bind8/ 0000755 0005671 0000012 00000000000 11137650374 011551 5 ustar jcameron wheel bind8/config-sol-linux 0000664 0005671 0000012 00000001450 11137650373 014672 0 ustar jcameron wheel soa_style=0 named_path=/server/bind/sbin/named named_conf=/server/bind/etc/named.conf show_list=0 records_order=0 start_cmd=/etc/rc.d/bin/bind start stop_cmd=/etc/rc.d/bin/bind stop max_zones=50 rev_def=0 support_aaaa=0 allow_comments=0 allow_wild=1 allow_long=0 master_ttl=1 whois_cmd=whois short_names=0 pid_file=/server/bind/var/run/named.pid 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 checkzone=named-checkzone keygen=dnssec-keygen signzone=dnssec-signzone checkconf=named-checkconf other_slaves=1 bind8/slave_delete.cgi 0000775 0005671 0000012 00000001022 11137650373 014670 0 ustar jcameron wheel #!/usr/local/bin/perl # Remove some servers from the managed list require './bind8-lib.pl'; $access{'slaves'} || &error($text{'slaves_ecannot'}); &ReadParse(); &foreign_require("servers", "servers-lib.pl"); @servers = &list_slave_servers(); @d = split(/\0/, $in{'d'}); foreach $id (@d) { ($server) = grep { $_->{'id'} == $id } @servers; &delete_slave_server($server); } if (@d == 1) { &webmin_log("delete", "host", $server->{'host'}); } else { &webmin_log("delete", "group", scalar(@d)); } &redirect("list_slaves.cgi"); bind8/restart.cgi 0000755 0005671 0000012 00000001227 11137650373 013725 0 ustar jcameron wheel #!/usr/local/bin/perl # restart.cgi # Restart the running named require './bind8-lib.pl'; &ReadParse(); $access{'ro'} && &error($text{'restart_ecannot'}); $access{'apply'} == 1 || $access{'apply'} == 3 || &error($text{'restart_ecannot'}); &error_setup($text{'restart_err'}); $err = &restart_bind(); &error($err) if ($err); if ($access{'remote'}) { # Restart all slaves too &error_setup(); @slaveerrs = &restart_on_slaves(); if (@slaveerrs) { &error(&text('restart_errslave', "
".join("
", map { "$_->[0]->{'host'} : $_->[1]" }
@slaveerrs)));
}
}
&webmin_log("apply");
&redirect($in{'return'} ? $ENV{'HTTP_REFERER'} : "");
bind8/config.info.uk_UA 0000664 0005671 0000012 00000004154 11137650373 014703 0 ustar jcameron wheel named_path= , , named,0
named_conf= named.conf,0
soa_style= ,1, 0- ,1- ()
show_list= ,1,0-,1-
records_order= ,1,1- ,2- ,3- IP,0-
updserial_on= ,1,1-,0-
ndc_cmd= ,0
reversezonefilename_format= ,0
forwardzonefilename_format= forward,0
allow_long= ,1,0-,1-
default_master= () slave,0
default_slave= ,0
named_group=, BIND,3,
master_ttl= $ttl ,1,1-,0-
file_owner= (:),3,
slave_dir= slave/stub,3,
allow_wild= ( ),1,0-,1-
max_zones= ,0
start_cmd= BIND,3,
by_view= ?,1,1-,0-
whois_cmd= whois,0
short_names= ?,1,0-,1-
line0= BIND,11
file_perms= ( ),3,
line1= ,11
allow_comments= ,1,0-,1-
line2= ,11
master_dir= master,3,
chroot= chroot, BIND,3,
line3= ,11
support_aaaa=ϳ DNS IPv6,1,0-,1-
rev_def=³ ,1,0- ,1- ,2-
pid_file= PID ,3,/var/run/named.pid
zones_file= ,3,named.conf
named_user=, BIND,3,
bind8/config-redhat-linux-11.0-* 0000664 0005671 0000012 00000001637 11137650373 016057 0 ustar jcameron wheel soa_style=0
named_path=/usr/sbin/named
named_conf=/etc/named.conf
show_list=0
records_order=0
start_cmd=/etc/rc.d/init.d/named start
stop_cmd=/etc/rc.d/init.d/named stop
max_zones=50
rev_def=0
support_aaaa=0
allow_comments=0
allow_wild=1
allow_long=0
master_ttl=1
pid_file=/var/run/named/named.pid
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
chroot=/var/named/chroot
relative_paths=0
rndc_cmd=rndc
master_dir=/var/named
slave_dir=/var/named/slaves
auto_chroot=sh -c '. /etc/sysconfig/named && echo "$ROOTDIR"'
no_pid_chroot=0
soa_start=0
rndc_conf=/etc/rndc.conf
rndcconf_cmd=rndc-confgen
largezones=0
checkzone=named-checkzone
keygen=dnssec-keygen
signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
bind8/config.info.tr 0000644 0005671 0000012 00000001106 11137650373 014314 0 ustar jcameron wheel named_conf=named.conf dosyasnn tam yolu,0
named_path=named altrlabilir dosyasnn tam yolu,0
show_list=Alanlar grntleme ekli,1,0-konlarla,1-Listeyle
soa_style=Seri nuamaras tipi,1,0-alma numaras ile,1-Tarih tabanl (YYYYAAGGss)
records_order=Kaytlar grntleme ekli,1,1-sime gre,2-Deerine gre,3-By IP,0-Eklenmi olarak
chroot=BIND altnda altrlacak Chroot dizini,3,ntanml
start_cmd=BIND'i balatma komutu,3,ntanml
max_zones=Grntlenecek en ok blge says,0
rev_def=Ters kaytlar gncelle,1,0-ntanml olarak ak,1-ntanml olarak kapal
bind8/conf_misc.cgi 0000755 0005671 0000012 00000003521 11137650373 014200 0 ustar jcameron wheel #!/usr/local/bin/perl
# conf_misc.cgi
# Display miscellaneous options
require './bind8-lib.pl';
$access{'defaults'} || &error($text{'misc_ecannot'});
&ui_print_header(undef, $text{'misc_title'}, "",
undef, undef, undef, undef, &restart_links());
&ReadParse();
$conf = &get_config();
$options = &find("options", $conf);
$mems = $options->{'members'};
# Start of the form
print &ui_form_start("save_misc.cgi");
print &ui_table_start($text{'misc_header'}, "width=100%", 4);
print &opt_input($text{'misc_core'}, 'coresize', $mems, $text{'default'}, 8);
print &opt_input($text{'misc_data'}, 'datasize', $mems, $text{'default'}, 8);
print &opt_input($text{'misc_files'}, 'files', $mems, $text{'default'}, 8);
print &opt_input($text{'misc_stack'}, 'stacksize', $mems, $text{'default'}, 8);
print &ui_table_hr();
print &opt_input($text{'misc_clean'}, 'cleaning-interval', $mems,
$text{'default'}, 8, "$text{'misc_mins'}");
print &opt_input($text{'misc_iface'}, 'interface-interval', $mems,
$text{'default'}, 8, "$text{'misc_mins'}");
print &opt_input($text{'misc_stats'}, 'statistics-interval', $mems,
$text{'default'}, 8, "$text{'misc_mins'}");
print &ui_table_hr();
print &choice_input($text{'misc_recursion'}, 'recursion', $mems,
$text{'yes'}, 'yes', $text{'no'}, 'no',
$text{'default'}, undef);
print &choice_input($text{'misc_cnames'}, 'multiple-cnames', $mems,
$text{'yes'}, 'yes', $text{'no'}, 'no',
$text{'default'}, undef);
print &choice_input($text{'misc_glue'}, 'fetch-glue', $mems,
$text{'yes'}, 'yes', $text{'no'}, 'no',
$text{'default'}, undef);
print &choice_input($text{'misc_nx'}, 'auth-nxdomain', $mems,
$text{'yes'}, 'yes', $text{'no'}, 'no',
$text{'default'}, undef);
print &ui_table_end();
print &ui_form_end([ [ undef, $text{'save'} ] ]);
&ui_print_footer("", $text{'index_return'});
bind8/convert_master.cgi 0000775 0005671 0000012 00000001666 11137650373 015305 0 ustar jcameron wheel #!/usr/local/bin/perl
# convert_master.cgi
# Convert a master zone into a slave
require './bind8-lib.pl';
&ReadParse();
$conf = &get_config();
if ($in{'view'} ne '') {
$conf = $conf->[$in{'view'}]->{'members'};
}
$zconf = $conf->[$in{'index'}];
&error_setup($text{'convert_err'});
&lock_file(&make_chroot($zconf->{'file'}));
$access{'slave'} || &error($text{'screate_ecannot1'});
# Change the type directive
&save_directive($zconf, 'type', [ { 'name' => 'type',
'values' => [ 'slave' ] } ], 1);
# Add a masters section
if ($config{'default_master'}) {
@mdirs = map { { 'name' => $_ } } split(/\s+/, $config{'default_master'});
&save_directive($zconf, 'masters', [ { 'name' => 'masters',
'type' => 1,
'members' => \@mdirs } ], 1);
}
# Take out directives not allowed in slaves
&save_directive($zconf, 'allow-update', [ ], 1);
&flush_file_lines();
&unlock_file(&make_chroot($zconf->{'file'}));
&redirect("");
bind8/save_controls.cgi 0000775 0005671 0000012 00000004250 11137650373 015123 0 ustar jcameron wheel #!/usr/local/bin/perl
# Save control interface options
require './bind8-lib.pl';
$access{'defaults'} || &error($text{'controls_ecannot'});
&error_setup($text{'controls_err'});
&ReadParse();
# Validate and store inputs
&lock_file(&make_chroot($config{'named_conf'}));
$parent = &get_config_parent();
$conf = &get_config();
$controls = &find("controls", $conf);
if (!$controls) {
$controls = { 'name' => 'controls', 'type' => 1 };
&save_directive($parent, "controls", [ $controls ]);
}
$inet = &find("inet", $controls->{'members'});
$unix = &find("unix", $controls->{'members'});
# Save inet control options
if ($in{'inet'}) {
$inet ||= { 'name' => 'inet', 'type' => 2 };
&check_ipaddress($in{'ip'}) || &error($text{'controls_einetip'});
$in{'port'} =~ /^\d+$/ && $in{'port'} > 0 && $in{'port'} < 65536 ||
&error($text{'controls_einetport'});
$inet->{'values'} = [ $in{'ip'}, "port", $in{'port'} ];
@allow = split(/\s+/, $in{'allow'});
foreach $a (@allow) {
&check_ipaddress($a) ||
&error(&text('controls_einetallow', $a));
}
@allow || &error($text{'controls_einetallows'});
$inet->{'members'}->{'allow'} =
[ map { { 'name' => $_ } } @allow ];
@keys = split(/\s+/, $in{'keys'});
if (@keys) {
$inet->{'members'}->{'keys'} =
[ map { { 'name' => $_ } } @keys ];
}
else {
delete($inet->{'members'}->{'keys'});
}
&save_directive($controls, "inet", [ $inet ], 1);
}
else {
&save_directive($controls, "inet", [ ], 1);
}
# Save local control options
if ($in{'unix'}) {
$unix ||= { 'name' => 'unix', 'type' => 0 };
$in{'path'} =~ /^\/\S+$/ || &error($text{'controls_eunixpath'});
$in{'perm'} =~ /^[0-7]{3,4}$/ || &error($text{'controls_eunixperm'});
$owner = getpwnam($in{'owner'});
defined($owner) || &error($text{'controls_eunixowner'});
$group = getgrnam($in{'group'});
defined($group) || &error($text{'controls_eunixgroup'});
$unix->{'values'} = [ $in{'path'}, "perm", $in{'perm'},
"owner", $owner, "group", $group ];
&save_directive($controls, "unix", [ $unix ], 1);
}
else {
&save_directive($controls, "unix", [ ], 1);
}
&flush_file_lines();
&unlock_file(&make_chroot($config{'named_conf'}));
&webmin_log("controls", undef, undef, \%in);
&redirect("");
bind8/view_text.cgi 0000755 0005671 0000012 00000001643 11137650373 014261 0 ustar jcameron wheel #!/usr/local/bin/perl
# view_text.cgi
# Display the records in a zone
require './bind8-lib.pl';
&ReadParse();
$zone = &get_zone_name($in{'index'}, $in{'view'});
$file = &absolute_path($zone->{'file'});
$tv = $zone->{'type'};
&can_edit_zone($zone) ||
&error($text{'master_ecannot'});
$access{'file'} || &error($text{'text_ecannot'});
&ui_print_header($file, $text{'text_title2'}, "",
undef, undef, undef, undef, &restart_links($zone));
print &text('text_desc2', "$file"),"
\n"; $text = &read_file_contents(&make_chroot($file)); if ($text) { print &ui_table_start(undef, "width=100%", 2); print &ui_table_row(undef, "
".&html_escape($text)."", 2); print &ui_table_end(); } else { print "$text{'text_none'}
\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-openmamba-linux 0000664 0005671 0000012 00000001364 11137650373 016040 0 ustar jcameron wheel soa_style=0 named_path=/usr/sbin/named named_conf=/etc/named.conf show_list=0 records_order=0 start_cmd=/etc/rc.d/init.d/named start stop_cmd=/etc/rc.d/init.d/named stop max_zones=50 rev_def=0 support_aaaa=0 allow_comments=0 allow_wild=1 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 checkzone=named-checkzone keygen=dnssec-keygen signzone=dnssec-signzone checkconf=named-checkconf other_slaves=1 bind8/acl_security.pl 0000755 0005671 0000012 00000021753 11137650373 014606 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'}; printf " %s | \n",
$m == 3 ? 'checked' : '', $text{'acl_vnone'};
print "
".join("
", map { "$_->[0]->{'host'} : $_->[1]" }
@slaveerrs)));
}
}
&redirect("edit_master.cgi?index=$idx&view=$in{'view'}");
bind8/config-mandrake-linux 0000664 0005671 0000012 00000001364 11137650373 015663 0 ustar jcameron wheel soa_style=0
named_path=/usr/sbin/named
named_conf=/etc/named.conf
show_list=0
records_order=0
start_cmd=/etc/rc.d/init.d/named start
stop_cmd=/etc/rc.d/init.d/named stop
max_zones=50
rev_def=0
support_aaaa=0
allow_comments=0
allow_wild=1
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
checkzone=named-checkzone
keygen=dnssec-keygen
signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
bind8/mass_create.cgi 0000775 0005671 0000012 00000016315 11137650373 014535 0 ustar jcameron wheel #!/usr/local/bin/perl
# Actually create multiple zones
require './bind8-lib.pl';
&ReadParseMime();
&ui_print_unbuffered_header(undef, $text{'mass_title'}, "");
&error_setup($text{'mass_err'});
$conf = &get_config();
$access{'ro'} && &error($text{'master_ero'});
# Check if the template needs IPs
if ($in{'tmpl'}) {
for($i=0; $config{"tmpl_$i"}; $i++) {
@c = split(/\s+/, $config{"tmpl_$i"}, 3);
if ($c[1] eq 'A' && !$c[2]) {
$tmpl_ip++;
}
}
}
# Build map of taken zones
if ($in{'view'} ne '') {
# In some view
@zones = grep { $_->{'viewindex'} eq $in{'view'} &&
$_->{'type'} ne 'view' }
&list_zone_names();
$view = $conf->[$in{'view'}];
&can_edit_view($view) || &error($text{'mass_eviewcannot'});
$vn = $view->{'value'};
}
else {
# At top-level
@zones = grep { !$_->{'view'} && $_->{'type'} ne 'view' }
&list_zone_names();
$vn = undef;
}
%taken = map { $_->{'name'}, $_ } @zones;
# Get zone defaults
&get_zone_defaults(\%zd);
if ($in{'local'}) {
&allowed_zone_file(\%access, $in{'local'}) ||
&error($text{'mass_elocalcannot'});
$local = &read_file_contents($in{'local'});
$local || &error($text{'mass_elocal'});
print "",&text('mass_dolocal', "$in{'local'}"),"
\n";
&execute_batchfile($local);
print "",$text{'mass_done'},"
\n";
}
if ($in{'upload'}) {
print "",&text('mass_doupload'),"
\n";
&execute_batchfile($in{'upload'});
print "",$text{'mass_done'},"
\n";
}
if ($in{'text'}) {
print "",&text('mass_dotext'),"
\n";
&execute_batchfile($in{'text'});
print "",$text{'mass_done'},"
\n";
}
&webmin_log("mass", undef, $zonecount);
&ui_print_footer("", $text{'index_return'});
# execute_batchfile(data)
sub execute_batchfile
{
local @lines = split(/[\r\n]+/, $_[0]);
local $l;
local $lnum = 0;
foreach $l (@lines) {
$lnum++;
local @w = split(/:/, $l);
local $dom = $w[0];
if ($dom !~ /^[a-z0-9\.\-\_]+$/) {
&line_error($l, $text{'mass_edom'});
next;
}
local $isrev = 0;
if (&check_ipaddress($dom)) {
$dom = &ip_to_arpa($dom);
$isrev = 1;
}
# Check for a clash
if ($taken{$dom}) {
&line_error($l, $text{'mass_etaken'});
next;
}
# Get the IP addresses
local @mips = split(/\s+/, $w[3]);
foreach $mip (@mips) {
if (!&check_ipaddress($mip)) {
&line_error($l, $text{'mass_eip'});
next;
}
}
local $type = $w[1] || "master";
local $file = $w[2];
local $dir;
if ($type eq "master") {
# Creating a master zone
if (!$access{'master'}) {
&line_error($l, $text{'mcreate_ecannot'});
next;
}
# Work out the base
$base = $config{'master_dir'} ? $config{'master_dir'} :
$access{'dir'} eq '/' ? &base_directory($conf) :
$access{'dir'};
if ($base !~ /^([a-z]:)?\//) {
# Master dir is relative .. make absolute
$base = &base_directory()."/".$base;
}
# Make sure a template IP was given, if needed
if ($tmpl_ip && !@mips) {
&line_error($l, $text{'mass_etmpl'});
next;
}
# Work out the filename
if ($file) {
if ($file !~ /^\//) {
$file = $base."/".$file;
}
if (!&allowed_zone_file(\%access, $file)) {
&line_error($l, &text('create_efile2', $file));
next;
}
}
else {
$file = &automatic_filename($dom, $isrev, $base, $vn);
}
if (-r &make_chroot($file)) {
&line_error($l, &text('create_efile4', $file));
next;
}
# Create the zone file and initial records
local $master = $config{'default_prins'} ||
&get_system_hostname();
$master =~ s/\.$//;
$master .= ".";
local $email = $config{'tmpl_email'} || "root\@$master";
$email = &email_to_dotted($email);
&create_master_records($file, $dom, $master, $email,
$zd{'refresh'}.$zd{'refunit'},
$zd{'retry'}.$zd{'retunit'},
$zd{'expiry'}.$zd{'expunit'},
$zd{'minimum'}.$zd{'minunit'},
1,
$in{'onslave'} && $access{'remote'},
$in{'tmpl'}, $mips[0]);
# Create the zone directive
$dir = { 'name' => 'zone',
'values' => [ $dom ],
'type' => 1,
'members' => [ { 'name' => 'type',
'values' => [ 'master' ] },
{ 'name' => 'file',
'values' => [ $file ] } ]
};
}
elsif ($type eq "slave" || $type eq "stub") {
# Creating a slave or stub zone
if (!$access{'slave'}) {
&line_error($l, $text{'screate_ecannot1'});
next;
}
# Work out the base
$base = $config{'slave_dir'} ? $config{'slave_dir'} :
$access{'dir'} eq '/' ? &base_directory($conf) :
$access{'dir'};
if ($base !~ /^([a-z]:)?\//) {
# Slave dir is relative .. make absolute
$base = &base_directory()."/".$base;
}
# Make sure some master IPs were given
if (!@mips) {
&line_error($l, $text{'mass_emips'});
next;
}
# Work out the filename
if ($file eq "none") {
$file = undef; # no file!
}
elsif ($file) {
if ($file !~ /^\//) {
$file = $base."/".$file;
}
if (!&allowed_zone_file(\%access, $file)) {
&line_error($l, &text('create_efile2', $file));
next;
}
}
else {
$file = &automatic_filename($dom, $isrev, $base, $vn);
}
# Create the file now
if ($file) {
if (!open(ZONE, ">".&make_chroot($file))) {
&line_error($l, &text('create_efile3',
$file, $!));
next;
}
close(ZONE);
&set_ownership(&make_chroot($file));
}
# Create the structure
local @mdirs = map { { 'name' => $_ } } @mips;
local $masters = { 'name' => 'masters',
'type' => 1,
'members' => \@mdirs };
$dir = { 'name' => 'zone',
'values' => [ $dom ],
'type' => 1,
'members' => [ { 'name' => 'type',
'values' => [ $type ] },
$masters
]
};
if ($file) {
push(@{$dir->{'members'}},
{ 'name' => 'file',
'values' => [ $file ] });
}
}
elsif ($type eq "forward") {
# Creating a forward
if (!$access{'forward'}) {
&line_error($l, $text{'fcreate_ecannot'});
next;
}
# Make sure some master IPs were given
if (!@mips) {
&line_error($l, $text{'mass_emips'});
next;
}
# Create the structure
local @mdirs = map { { 'name' => $_ } } @mips;
local $masters = { 'name' => 'forwarders',
'type' => 1,
'members' => \@mdirs };
$dir = { 'name' => 'zone',
'values' => [ $dom ],
'type' => 1,
'members' => [ { 'name' => 'type',
'values' => [ 'forward' ] },
$masters
]
};
}
else {
&line_error($l, $text{'mass_etype'});
next;
}
if ($dir) {
# Add the zone structure
&create_zone($dir, $conf, $in{'view'});
&set_ownership(&make_chroot($named_conf));
&add_zone_access($dom);
$taken{$dom}++;
&line_ok($dom, $type);
$zonecount++;
}
if ($type eq "master" && $in{'onslave'} && $access{'remote'}) {
# Create on slave servers
local @slaveerrs = &create_on_slaves($dom,
$config{'this_ip'} || &to_ipaddress(&get_system_hostname()),
undef, undef, $vn);
print " \n";
if (@slaveerrs) {
$serrs = join(", ", map { "$_->[0]->{'host'} : $_->[1]" } @slaveerrs);
print "",
&text('mass_eonslave', $serrs),"
\n";
}
else {
print &text('mass_addedslaves', $dom),"
\n";
}
}
}
}
sub line_error
{
print "",&text('mass_eline', $lnum, $_[1], $_[0]),
"
\n";
}
sub line_ok
{
print &text('mass_added'.$_[1], $_[0]),"
\n";
}
bind8/slave_add.cgi 0000775 0005671 0000012 00000007123 11137650373 014166 0 ustar jcameron wheel #!/usr/local/bin/perl
# Add or update a server or group from the webmin servers module
require './bind8-lib.pl';
$access{'slaves'} || &error($text{'slaves_ecannot'});
&ReadParse();
&foreign_require("servers", "servers-lib.pl");
@allservers = grep { $_->{'user'} } &servers::list_servers();
if ($in{'server'} =~ /^group_(\S+)/) {
# Add all from a group
($group) = grep { $_->{'name'} eq $1 }
&servers::list_all_groups(\@allservers);
foreach $m (@{$group->{'members'}}) {
push(@add, grep { $_->{'host'} eq $m } @allservers);
}
&error_setup($text{'add_gerr'});
$msg = &text('add_gmsg', $group->{'name'});
$in{'name_def'} || &error($text{'add_egname'});
}
else {
# Add a single host
@add = grep { $_->{'id'} eq $in{'server'} } @allservers;
&error_setup($text{'add_err'});
$msg = &text('add_msg', &server_name($add[0]));
$in{'name_def'} || &valdnsname($in{'name'}) ||
&error($text{'add_ename'});
}
$in{'view_def'} || $in{'view'} =~ /\S/ || &error($text{'add_eview'});
$myip = $config{'this_ip'} || &to_ipaddress(&get_system_hostname());
$myip && $myip ne "127.0.0.1" ||
&error($text{'add_emyip'});
&ui_print_header(undef, $text{'add_title'}, "");
print "$msg
\n"; # Setup error handler for down hosts sub add_error { $add_error_msg = join("", @_); } &remote_error_setup(\&add_error); # Make sure each host is set up for BIND @zones = grep { $_->{'type'} eq 'master' } &list_zone_names(); foreach $s (@add) { $s->{'bind8_view'} = $in{'view_def'} == 1 ? undef : $in{'view_def'} == 2 ? "*" : $in{'view'}; $add_error_msg = undef; local $bind8 = &remote_foreign_check($s, "bind8"); if ($add_error_msg) { print "$add_error_msg
\n"; next; } if (!$bind8) { print &text('add_echeck', $s->{'host'}),"
\n"; next; } &remote_foreign_require($s, "bind8", "bind8-lib.pl"); local $inst = &remote_foreign_call($s, "bind8", "foreign_installed", "bind8", 1); if (!$inst) { print &text('add_emissing', $s->{'host'}),"
\n"; next; } # Check for needed Webmin versions local $rver = &remote_foreign_call($s, "bind8", "get_webmin_version"); if ($rver < 1.202) { print &text('add_eversion', $s->{'host'}, 1.202),"
\n"; next; } if ($s->{'bind8_view'} && $s->{'bind8_view'} =~ /\s/ && $rver < 1.422) { print &text('add_eversion2', $s->{'host'}, 1.422),"
\n"; } @rzones = grep { $_->{'type'} ne 'view' } &remote_foreign_call($s, "bind8", "list_zone_names"); print &text('add_ok', $s->{'host'}, scalar(@rzones)),"
\n";
$s->{'sec'} = $in{'sec'};
$s->{'nsname'} = $in{'name_def'} ? undef : $in{'name'};
&add_slave_server($s);
%rgot = map { $_->{'name'}, 1 } @rzones;
if ($in{'sync'}) {
# Add all master zones from this server to the slave
$zcount = 0;
$zerr = 0;
foreach $zone (grep { !$rgot{$_->{'name'}} } @zones) {
($slaveerr) = &create_on_slaves($zone->{'name'}, $myip,
undef, [ $s->{'host'} ], $zone->{'view'});
if ($slaveerr) {
$zerrs{$slaveerr->[0]->{'host'}} ||=
$slaveerr->[1];
$zerr++;
}
else {
$zcount++;
}
}
# Restart the slave too
if ($zcount) {
&remote_foreign_call($s, "bind8", "restart_bind");
}
# Tell the user
if ($zerr) {
print &text('add_createerr', $s->{'host'},
$zcount, $zerr),"
\n";
foreach $k (keys %zerrs) {
print "$k : $zerrs{$k}
\n";
}
print "
\n"; } else { print &text('add_createok', $s->{'host'}, $zcount),"
\n"; } } } &remote_finished(); if ($in{'add'}) { &webmin_log("add", "host", $add[0]->{'host'}); } else { &webmin_log("add", "group", $group->{'name'}); } &ui_print_footer("list_slaves.cgi", $text{'slaves_return'}); bind8/create_delegation.cgi 0000755 0005671 0000012 00000003245 11137650373 015701 0 ustar jcameron wheel #!/usr/local/bin/perl # create_forward.cgi # Create a new forward zone require './bind8-lib.pl'; &ReadParse(); &error_setup($text{'dcreate_err'}); $access{'delegation'} || &error($text{'dcreate_ecannot'}); $access{'ro'} && &error($text{'master_ero'}); $conf = &get_config(); if ($in{'view'} ne '') { $view = $conf->[$in{'view'}]; &can_edit_view($view) || &error($text{'master_eviewcannot'}); $vconf = $view->{'members'}; } else { $vconf = $conf; } # validate inputs if ($in{'rev'}) { local($ipv4); ($ipv4 = &check_net_ip($in{'zone'})) || $config{'support_aaaa'} && (($in{'zone'} =~ /^([\w:]+)(\/\d+)$/) || &check_ip6address($1)) || &error(&text('create_enet', $in{'zone'})); if ($ipv4) { $in{'zone'} = &ip_to_arpa($in{'zone'}); } else { $in{'zone'} = &net_to_ip6int($1, ($2 ? substr($2, 1) : "" )); } } else { ($in{'zone'} =~ /^[\d\.]+$/ || $in{'zone'} =~ /^[\d\:]+(\/[\d]+)?$/) && &error(&text('create_edom2', $in{'zone'})); &valdnsname($in{'zone'}, 0, ".") || &error(&text('create_edom', $in{'zone'})); } $in{'zone'} =~ s/\.$//; foreach $z (&find("zone", $vconf)) { if ($z->{'value'} eq $in{'zone'}) { &error($text{'master_etaken'}); } } # Create structure @mdirs = map { { 'name' => $_ } } @masters; $dir = { 'name' => 'zone', 'values' => [ $in{'zone'} ], 'type' => 1, 'members' => [ { 'name' => 'type', 'values' => [ 'delegation-only' ] } ] }; # Create zone directive &create_zone($dir, $conf, $in{'view'}); &webmin_log("create", "delegation", $in{'zone'}, \%in); # Get the new zone's index $idx = &get_zone_index($in{'zone'}, $in{'view'}); &add_zone_access($in{'zone'}); &redirect("edit_delegation.cgi?index=$idx&view=$in{'view'}"); bind8/log_parser.pl 0000775 0005671 0000012 00000004545 11137650373 014257 0 ustar jcameron wheel # log_parser.pl # Functions for parsing this module's logs do 'bind8-lib.pl'; # parse_webmin_log(user, script, action, type, object, ¶ms) # Converts logged information from this module into human-readable form sub parse_webmin_log { local ($user, $script, $action, $type, $object, $p) = @_; if ($type eq 'record') { if ($p->{'type'} eq 'PTR') { return &text("log_${action}_record", $text{"type_$p->{'type'}"}, "".&arpa_to_ip($p->{'name'})."", "".&arpa_to_ip($object).""); } else { $p->{'name'} =~ s/\.$object\.*$//; if (($action eq "modify" || $action eq "create") && $p->{'newvalues'}) { return &text("log_${action}_record_v", $text{"type_$p->{'type'}"}, "$p->{'name'}", "$object", "$p->{'newvalues'}"); } else { return &text("log_${action}_record", $text{"type_$p->{'type'}"}, "$p->{'name'}", "$object"); } } } elsif ($type eq 'recs') { return &text("log_${action}_recs", $object); } elsif ($type eq 'zones') { return &text("log_${action}_zones", $object); } elsif ($type eq "host" || $type eq "group") { return &text("log_${action}_${type}", "$object"); } elsif ($action eq 'create') { return &text("log_${type}", "$object"); } elsif ($action eq 'delete') { return &text("log_delete_${type}", "$object"); } elsif ($action eq 'text') { return &text("log_text", "$object"); } elsif ($action eq 'soa') { return &text("log_soa", "$object"); } elsif ($action eq 'zonekeyon' || $action eq 'zonekeyoff' || $action eq 'sign') { return &text("log_".$action, "$object"); } elsif ($action eq 'opts') { return &text("log_opts", "$object"); } elsif ($action eq 'view') { return &text("log_review", "$object"); } elsif ($action eq 'move') { return &text("log_move", "$object"); } elsif ($action eq 'apply' && $type && $type ne '-') { return &text("log_apply2", "$type"); } elsif ($action eq 'freeze' || $action eq 'thaw') { return &text("log_".$action, "$type"); } elsif ($action eq 'mass') { return &text("log_mass", $object); } elsif ($action eq 'manual') { return &text("log_manual", "$object"); } elsif ($text{"log_${action}"}) { return $text{"log_${action}"}; } else { return undef; } } bind8/config-freebsd-4.0-* 0000664 0005671 0000012 00000001257 11137650373 015005 0 ustar jcameron wheel soa_style=0 named_path=/usr/sbin/named named_conf=/etc/namedb/named.conf show_list=0 records_order=0 max_zones=50 rev_def=0 support_aaaa=0 allow_comments=0 allow_wild=1 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 checkzone=named-checkzone keygen=dnssec-keygen signzone=dnssec-signzone checkconf=named-checkconf other_slaves=1 bind8/save_rndc.cgi 0000775 0005671 0000012 00000005132 11137650373 014206 0 ustar jcameron wheel #!/usr/local/bin/perl # Actually setup rndc require './bind8-lib.pl'; $access{'defaults'} || &error($text{'rndc_ecannot'}); &error_setup($text{'rndc_err'}); $cfile = &make_chroot($config{'named_conf'}); # Generate the RNDC config &execute_command($config{'rndcconf_cmd'}, undef, \$out, \$err); if ($?) { &error("
$err"); } &open_lock_tempfile(CONF, ">$config{'rndc_conf'}"); &print_tempfile(CONF, $out); &close_tempfile(CONF); &set_ownership_permissions(0, 0, 0600, $config{'rndc_conf'}); $rconf = [ &read_config_file($config{'rndc_conf'}) ]; # Get the new key $rkey = &find("key", $rconf); $rkey || &error($text{'rndc_ekey'}); $secret = &find_value("secret", $rkey->{'members'}); $secret || &error($text{'rndc_esecret'}); $options = &find("options", $rconf); if ($options) { $port = &find_value("default-port", $options->{'members'}); } $port ||= 953; # Add the key to named.conf &lock_file($cfile); $parent = &get_config_parent(); $conf = &get_config(); @keys = &find("key", $conf); ($key) = grep { $_->{'values'}->[0] eq "rndc-key" } @keys; if (!$key) { # Need to create key $key = { 'name' => 'key', 'type' => 1, 'values' => [ "rndc-key" ], 'members' => [ ] }; push(@keys, $key); } &save_directive($key, "algorithm", [ { 'name' => 'algorithm', 'values' => [ "hmac-md5" ] } ], 1, 1); &save_directive($key, "secret", [ { 'name' => 'secret', 'values' => [ $secret ] } ], 1, 1); &save_directive($parent, 'key', \@keys, 0); # Make sure there is a control for the inet port $controls = &find("controls", $conf); if (!$controls) { # Need to add controls section $controls = { 'name' => 'controls', 'type' => 1 }; &save_directive($parent, 'controls', [ $controls ]); } $inet = &find("inet", $controls->{'members'}); if (!$inet) { # Need to add inet entry $inet = { 'name' => 'inet', 'type' => 2, 'values' => [ "127.0.0.1", "port", $port ], 'members' => { 'allow' => [ { 'name' => "127.0.0.1" } ], 'keys' => [ { 'name' => "rndc-key" } ] } }; } else { # Just make sure it is valid %keys = map { $_->{'name'}, 1 } @{$inet->{'members'}->{'keys'}}; if (!$keys{'rndc-key'}) { push(@{$inet->{'members'}->{'keys'}}, { 'name' => "rndc-key" }); } } &save_directive($controls, 'inet', [ $inet ], 1); &flush_file_lines(); # MacOS specific fix - remove include for /etc/rndc.key , which we don't need $lref = &read_file_lines($cfile); for(my $i=0; $i<@$lref; $i++) { if ($lref->[$i] =~ /^include\s+"\/etc\/rndc.key"/i) { splice(@$lref, $i, 1); last; } } &flush_file_lines($cfile); &unlock_file($cfile); &restart_bind(); &webmin_log("rndc"); &redirect(""); bind8/setup_trusted.cgi 0000775 0005671 0000012 00000002431 11137650373 015153 0 ustar jcameron wheel #!/usr/local/bin/perl # Add lookaside and trusted key records for ICS's DLV zone require './bind8-lib.pl'; $access{'defaults'} || &error($text{'trusted_ecannot'}); &error_setup($text{'trusted_err'}); &ReadParse(); &lock_file(&make_chroot($config{'named_conf'})); $parent = &get_config_parent(); $conf = $parent->{'members'}; $options = &find("options", $conf); # Enable DNSSEC &save_directive($options, "dnssec-enable", [ { 'name' => 'dnssec-enable', 'values' => [ 'yes' ] } ], 1); if (&supports_dnssec_client() == 2) { &save_directive($options, "dnssec-validation", [ { 'name' => 'dnssec-validation', 'values' => [ 'yes' ] } ], 1); } # Lookaside &save_directive($options, "dnssec-lookaside", [ { 'name' => 'dnssec-lookaside', 'values' => [ ".", "trust-anchor", $dnssec_dlv_zone ] } ], 1); # ICS's key $trusted = &find("trusted-keys", $conf); if (!$trusted) { # Need to create block $trusted = { 'name' => 'trusted-keys', 'type' => 1, 'members' => [ ] }; &save_directive($parent, "trusted-keys", [ $trusted ]); } &save_directive($trusted, [ ], [ { 'name' => $dnssec_dlv_zone, 'values' => \@dnssec_dlv_key } ], 1); &flush_file_lines(); &unlock_file(&make_chroot($config{'named_conf'})); &restart_bind(); &webmin_log("trusted"); &redirect(""); bind8/list_gen.cgi 0000775 0005671 0000012 00000003443 11137650373 014051 0 ustar jcameron wheel #!/usr/local/bin/perl # list_gen.cgi # Display $generate entries require './bind8-lib.pl'; &ReadParse(); $access{'gen'} || &error($text{'gen_ecannot'}); $zone = &get_zone_name($in{'index'}, $in{'view'}); $dom = $zone->{'name'}; &can_edit_zone($zone) || &error($text{'recs_ecannot'}); $desc = &text('recs_header', &ip6int_to_net(&arpa_to_ip($dom))); &ui_print_header($desc, $text{'gen_title'}, "", undef, undef, undef, undef, &restart_links($zone)); @gens = grep { $_->{'generate'} } &read_zone_file($zone->{'file'}, $dom); print "$text{'gen_desc'}
\n";
print &ui_form_start("save_gen.cgi", "post");
print &ui_hidden("index", $in{'index'});
print &ui_hidden("view", $in{'view'});
print &ui_columns_start([ $text{'gen_type'}, $text{'gen_range'},
$text{'gen_name'}, $text{'gen_value'},
$text{'gen_cmt'} ], 100);
$i = 0;
if ($bind_version >= 9) {
@types = ( 'PTR', 'CNAME', 'NS', 'A', 'AAAA', 'DNAME' );
}
else {
@types = ( 'PTR', 'CNAME', 'NS' );
}
foreach $g (@gens, { }) {
@gv = @{$g->{'generate'}};
@cols = ( );
local @r = $gv[0] =~ /^(\d+)-(\d+)(\/(\d+))?$/ ? ( $1, $2, $4 ) : ( );
push(@cols, &ui_select("type_$i", uc($gv[2]),
[ [ '', ' ' ],
map { uc($_) } @types ]));
push(@cols, &ui_textbox("start_$i", $r[0], 3)." - ".
&ui_textbox("stop_$i", $r[1], 3)." $text{'gen_skip'} ".
&ui_textbox("skip_$i", $r[2], 3));
push(@cols, &ui_textbox("name_$i", $gv[1], 20));
push(@cols, &ui_textbox("value_$i", $gv[3], 20));
push(@cols, &ui_textbox("cmt_$i", join(" ", @gv[4..$#gv]), 25));
print &ui_columns_row(\@cols);
$i++;
}
print &ui_columns_end();
@buts = ( [ undef, $text{'save'} ] );
if (@gens) {
push(@buts, [ "show", $text{'gen_show'} ]);
}
print &ui_form_end(\@buts);
&ui_print_footer("edit_master.cgi?index=$in{'index'}&view=$in{'view'}",
$text{'master_return'});
bind8/mass_update_form.cgi 0000775 0005671 0000012 00000002120 11137650373 015564 0 ustar jcameron wheel #!/usr/local/bin/perl
# Show a form for changing the IPs in multiple zones
require './bind8-lib.pl';
&ReadParse();
&error_setup($text{'umass_err'});
@d = split(/\0/, $in{'d'});
@d || &error($text{'umass_enone'});
&ui_print_header(undef, $text{'umass_title'}, "");
print &ui_form_start("mass_update.cgi", "post");
foreach $d (@d) {
print &ui_hidden("d", $d),"\n";
$dc++;
}
print &ui_table_start($text{'umass_header'}, undef, 2);
# Number of domains selected
print &ui_table_row($text{'umass_sel'}, $dc);
# Type to change
@rtypes = ( 'ttl', 'A', 'CNAME', 'NS', 'MX', 'PTR', 'TXT', 'SPF',
$config{'support_aaaa'} ? ( "AAAA" ) : ( ) );
print &ui_table_row($text{'umass_type'},
&ui_select("type", "A",
[ map { [ $_, $text{'recs_'.$_} ] } @rtypes ]));
# Value to change
print &ui_table_row($text{'umass_old'},
&ui_opt_textbox("old", undef, 30, $text{'umass_any'}));
# New value
print &ui_table_row($text{'umass_new'},
&ui_textbox("new", undef, 30));
print &ui_table_end();
print &ui_form_end([ [ "update", $text{'umass_ok'} ] ]);
&ui_print_footer("", $text{'index_return'});
bind8/config-openbsd-2.5-3.1 0000664 0005671 0000012 00000001250 11137650373 015171 0 ustar jcameron wheel soa_style=0
named_path=/usr/sbin/named
named_conf=/etc/named.conf
show_list=0
records_order=0
max_zones=50
rev_def=0
support_aaaa=0
allow_comments=0
allow_wild=1
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
checkzone=named-checkzone
keygen=dnssec-keygen
signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
bind8/config-suse-linux 0000664 0005671 0000012 00000001250 11137650373 015052 0 ustar jcameron wheel soa_style=1
named_path=/usr/sbin/named
named_conf=/etc/named.conf
show_list=0
records_order=0
max_zones=50
rev_def=0
support_aaaa=0
allow_comments=0
allow_wild=1
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
checkzone=named-checkzone
keygen=dnssec-keygen
signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
bind8/mass_delete.cgi 0000775 0005671 0000012 00000005401 11137650373 014526 0 ustar jcameron wheel #!/usr/local/bin/perl
# Delete a bunch of zones, after asking for confirmation
require './bind8-lib.pl';
&ReadParse();
$conf = &get_config();
if ($in{'update'}) {
# Redirect to mass update form
&redirect("mass_update_form.cgi?".
join("&", map { "d=".&urlize($_) } split(/\0/, $in{'d'})));
exit;
}
elsif ($in{'create'}) {
# Redirect to mass create form
&redirect("mass_rcreate_form.cgi?".
join("&", map { "d=".&urlize($_) } split(/\0/, $in{'d'})));
exit;
}
# Get the zones
foreach $d (split(/\0/, $in{'d'})) {
($idx, $viewidx) = split(/\s+/, $d);
if ($viewidx ne '') {
$view = $conf->[$viewidx];
$zconf = $view->{'members'}->[$idx];
}
else {
$zconf = $conf->[$idx];
}
&can_edit_zone($zconf, $view) ||
&error($text{'master_edelete'});
push(@zones, [ $zconf, $view ]);
push(@znames, $zconf->{'value'});
}
$access{'ro'} && &error($text{'master_ero'});
$access{'delete'} || &error($text{'master_edeletecannot'});
if (!$in{'confirm'}) {
# Ask the user if he is sure
&ui_print_header(undef, $text{'massdelete_title'}, "");
@servers = &list_slave_servers();
print &ui_confirmation_form("mass_delete.cgi",
&text('massdelete_rusure', scalar(@zones),
join(", ", @znames)),
[ map { [ "d", $_ ] } split(/\0/, $in{'d'}) ],
[ [ 'confirm', $text{'massdelete_ok'} ] ],
@servers && $access{'remote'} ?
$text{'delete_onslave'}." ".
&ui_yesno_radio("onslave", 1) : "",
);
&ui_print_footer("", $text{'index_return'});
}
else {
# Do it!
&ui_print_unbuffered_header(undef, $text{'massdelete_title'}, "");
foreach $zi (@zones) {
$zconf = $zi->[0];
$view = $zi->[1];
$type = &find_value("type", $zconf->{'members'});
print &text('massdelete_zone', $zconf->{'value'}),"
\n";
# delete the records file
$f = &find("file", $zconf->{'members'});
if ($f && $type ne 'hint') {
&delete_records_file($f->{'value'});
}
# delete any keys
&delete_dnssec_key($zconf);
# remove the zone directive
&lock_file(&make_chroot($zconf->{'file'}));
&save_directive($view || &get_config_parent($zconf->{'file'}),
[ $zconf ], [ ]);
print $text{'massdelete_done'},"
\n";
# Also delete from slave servers
if ($in{'onslave'} && $access{'remote'}) {
$viewname = $view ? $view->{'values'}->[0] : undef;
print &text('massdelete_slaves',
$zconf->{'value'}),"
\n";
@slaveerrs = &delete_on_slaves(
$zconf->{'value'}, undef, $viewname);
if (@slaveerrs) {
print $text{'massdelete_failed'},"
\n";
foreach $s (@slaveerrs) {
print "$s->[0]->{'host'} : $s->[1]
\n";
}
print "
\n"; } else { print $text{'massdelete_done'},"
\n";
}
}
}
&flush_file_lines();
&unlock_all_files();
&webmin_log("delete", "zones", scalar(@zones));
&ui_print_footer("", $text{'index_return'});
}
bind8/config-slackware-linux 0000664 0005671 0000012 00000001250 11137650373 016047 0 ustar jcameron wheel soa_style=0
named_path=/usr/sbin/named
named_conf=/etc/named.conf
show_list=0
records_order=0
max_zones=50
rev_def=0
support_aaaa=0
allow_comments=0
allow_wild=1
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
checkzone=named-checkzone
keygen=dnssec-keygen
signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
bind8/create_view.cgi 0000775 0005671 0000012 00000002603 11137650373 014537 0 ustar jcameron wheel #!/usr/local/bin/perl
# create_view.cgi
require './bind8-lib.pl';
&error_setup($text{'vcreate_err'});
&ReadParse();
$add_to_file = &add_to_file();
$pconf = &get_config_parent($add_to_file);
$conf = $pconf->{'members'};
$access{'views'} == 1 || &error($text{'vcreate_ecannot'});
$access{'ro'} && &error($text{'vcreate_ecannot'});
# Validate inputs
$in{'name'} =~ /^\S+$/ || &error($text{'vcreate_ename'});
@views = &find("view", $conf);
foreach $v (@views) {
&error($text{'vcreate_etaken'}) if ($v->{'value'} eq $in{'name'});
}
$in{'class_def'} || $in{'class'} =~ /^[A-Za-z0-9]+$/ ||
&error($text{'vcreate_eclass'});
# Create the view
&lock_file(&make_chroot($add_to_file));
$dir = { 'name' => 'view',
'values' => [ $in{'name'}, $in{'class_def'} ? ( ) : ( $in{'class'} ) ],
'type' => 1,
'members' => [ ],
'file' => $add_to_file
};
if (!$in{'match_def'}) {
push(@{$dir->{'members'}}, { 'name' => 'match-clients',
'type' => 1,
'members' =>
[ map { { 'name' => $_ } } split(/\s+/, $in{'match'}) ] } );
}
&save_directive($pconf, undef, [ $dir ], 0);
&flush_file_lines();
&unlock_file(&make_chroot($add_to_file));
# Add to user's ACL
if (!&can_edit_view($dir)) {
$access{'vlist'} = join(" ", &unique(
split(/\s+/, $access{'vlist'}), $in{'name'}));
&save_module_acl(\%access);
}
&webmin_log("create", "view", $in{'name'}, \%in);
&redirect("");
bind8/bind8-lib.pl 0000755 0005671 0000012 00000232101 11137650373 013657 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;
# Where to find root zones file
$internic_ftp_host = "rs.internic.net";
$internic_ftp_ip = "198.41.0.6";
$internic_ftp_file = "/domain/named.root";
$internic_ftp_gzip = "/domain/root.zone.gz";
# Get the version number
if (open(VERSION, "$module_config_directory/version")) {
chop($bind_version = \n";
print " \n";
}
&ui_print_footer("", $text{'index_return'});
bind8/config-mandrake-linux-10.2-* 0000664 0005671 0000012 00000001412 11137650373 016362 0 ustar jcameron wheel soa_style=0
named_path=/usr/sbin/named
named_conf=/etc/named.conf
show_list=0
records_order=0
start_cmd=/etc/rc.d/init.d/named start
stop_cmd=/etc/rc.d/init.d/named stop
max_zones=50
rev_def=0
support_aaaa=0
allow_comments=0
allow_wild=1
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
chroot=/var/lib/named
soa_start=0
rndc_conf=/etc/rndc.conf
rndcconf_cmd=rndc-confgen
largezones=0
checkzone=named-checkzone
keygen=dnssec-keygen
signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
bind8/conf_rndc.cgi 0000775 0005671 0000012 00000001676 11137650373 014206 0 ustar jcameron wheel #!/usr/local/bin/perl
# Show a form for setting up RNDC
# XXX should check if already working!
require './bind8-lib.pl';
$access{'defaults'} || &error($text{'rndc_ecannot'});
&ui_print_header(undef, $text{'rndc_title'}, "",
undef, undef, undef, undef, &restart_links());
print $text{'rndc_desc'}," \n";
# Check for rndc-confgen program
if (!&has_command($config{'rndcconf_cmd'})) {
&ui_print_endpage(&text('rndc_ecmd', "$config{'rndcconf_cmd'}",
"../config.cgi?$module_name"));
}
# Check if already working
&execute_command("$config{'rndc_cmd'} status", undef, \$out);
if (!$? && $out !~ /failed/) {
print "",$text{'rndc_desc2'}," \n";
}
# Show form
print &ui_form_start("save_rndc.cgi");
$ex = -s $config{'rndc_conf'};
print &text($ex ? 'rndc_rusure' : 'rndc_rusure2',
"$config{'rndc_conf'}")," \n";
print &ui_submit($text{'rndc_ok'});
print &ui_form_end();
&ui_print_footer("", $text{'index_return'});
bind8/config-unixware 0000664 0005671 0000012 00000001321 11137650373 014577 0 ustar jcameron wheel soa_style=0
named_path=/usr/local/sbin/named
named_conf=/etc/local/named.conf
show_list=0
records_order=0
max_zones=50
rev_def=0
support_aaaa=0
allow_comments=0
allow_wild=1
allow_long=0
pid_file=/etc/inet/named.pid
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
checkzone=named-checkzone
keygen=dnssec-keygen
signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
bind8/conf_trusted.cgi 0000775 0005671 0000012 00000005206 11137650373 014743 0 ustar jcameron wheel #!/usr/local/bin/perl
# Show a form for setting up DNSSEC verification and trusted keys
require './bind8-lib.pl';
&ReadParse();
$access{'defaults'} || &error($text{'trusted_ecannot'});
&supports_dnssec_client() || &error($text{'trusted_esupport'});
&ui_print_header(undef, $text{'trusted_title'}, "",
undef, undef, undef, undef, &restart_links());
$conf = &get_config();
$options = &find("options", $conf);
$mems = $options->{'members'};
@dlv = &find("dnssec-lookaside", $mems);
$tkeys = &find("trusted-keys", $conf);
$tkeys ||= { 'members' => [ ] };
# Check if not setup at all
if (!@dlv && !@{$tkeys->{'members'}}) {
print " \n";
print &ui_form_end([ [ undef, $text{'trusted_ok'} ] ]);
print " \n";
print &ui_form_start("create_hint.cgi");
print &ui_table_start($text{'hcreate_header'}, "width=100%", 4);
# File for root data
print &ui_table_row($text{'hcreate_file'},
&ui_filebox("file", $file, 40));
# Data source
print &ui_table_row($text{'hcreate_real'},
&ui_radio("real", $file ? 3 : 1,
[ [ 1, $text{'hcreate_down'}." \n";
@keys = &get_dnssec_key($zone);
foreach $key (@keys) {
# Collapsible section for key details
$kt = $key->{'ksk'} ? 'ksk' : 'zone';
print &ui_hidden_start($text{'zonekey_expand'.$kt},
$kt, 0, "edit_zonekey.cgi?$in");
print $text{'zonekey_public'}," \n";
print $text{'zonekey_private'}," \n";
}
# Offer to disable
print &ui_hr();
print &ui_buttons_start();
print &ui_buttons_row("disable_zonekey.cgi", $text{'zonekey_disable'},
$text{'zonekey_disabledesc'},
&ui_hidden("view", $in{'view'}).
&ui_hidden("index", $in{'index'}));
# Offer to sign now
print &ui_buttons_row("sign_zone.cgi", $text{'zonekey_sign'},
$text{'zonekey_signdesc'},
&ui_hidden("view", $in{'view'}).
&ui_hidden("index", $in{'index'}));
# Offer to re-generate now, for zones with a KSK
if (@keys == 2) {
print &ui_buttons_row("resign_zone.cgi",
$text{'zonekey_resign'},
$text{'zonekey_resigndesc'},
&ui_hidden("view", $in{'view'}).
&ui_hidden("index", $in{'index'}));
}
print &ui_buttons_end();
}
else {
# Offer to setup
print $text{'zonekey_desc'}," \n";
print &ui_form_start("enable_zonekey.cgi", "post");
print &ui_hidden("index", $in{'index'});
print &ui_hidden("view", $in{'view'});
print &ui_table_start($text{'zonekey_header'}, undef, 2);
# Key algorithm
print &ui_table_row($text{'zonekey_alg'},
&ui_select("alg", "DSA",
[ &list_dnssec_algorithms() ]));
# Key size
print &ui_table_row($text{'zonekey_size'},
&ui_radio("size_def", 1, [ [ 1, $text{'zonekey_ave'}." \n";
# Add default channels to table
@table = ( );
@defchans = ( { 'name' => 'default_syslog',
'syslog' => 'daemon',
'severity' => 'info' },
{ 'name' => 'default_debug',
'file' => 'named.run',
'severity' => 'dynamic' },
{ 'name' => 'default_stderr',
'fd' => 'stderr',
'severity' => 'info' },
{ 'name' => 'null',
'null' => 1 } );
foreach $c (@defchans) {
push(@table, [
$c->{'name'},
$c->{'syslog'} ? $c->{'syslog'} :
$c->{'file'} ? $text{'logging_file'}.
" ".$c->{'file'}."" :
$c->{'fd'} ? $text{'logging_fd'}." ".$c->{'fd'}."" :
$text{'logging_null'},
$c->{'severity'} || "$text{'logging_any'}",
"", "", "",
]);
}
# Add user-defined channels
# XXX
@chans = &find("channel", $mems);
@channames = ( (map { $_->{'value'} } @chans) ,
'default_syslog', 'default_debug', 'default_stderr', 'null' );
push(@chans, { });
for($i=0; $i<@chans; $i++) {
$cmems = $chans[$i]->{'members'};
$file = &find("file", $cmems);
$filestr = $file ? join(" ", @{$file->{'values'}}) : "";
$syslog = &find_value("syslog", $cmems);
$null = &find("null", $cmems);
$stderr = &find("stderr", $cmems);
my @cols;
# Channel name
push(@cols, &ui_textbox("cname_$i", $chans[$i]->{'value'}, 10));
# Log destination
my @dests;
$to = $file ? 0 : $syslog ? 1 : $stderr ? 3 : $null ? 2 : 0;
push(@dests, [ 0, $text{'logging_file'},
&ui_filebox("file_$i", $file->{'value'}, 40) ]);
push(@dests, [ 1, $text{'logging_syslog'},
&ui_select("syslog_$i", $syslog,
\@syslog_levels, 1, 0, $syslog ? 1 : 0) ]);
push(@dests, [ 3, $text{'logging_stderr'} ]);
push(@dests, [ 2, $text{'logging_null'} ]);
push(@cols, &ui_radio_table("to_$i", $to, \@dests));
# Severity
$sev = &find("severity", $cmems);
push(@cols, &ui_select("sev_$i", $sev->{'value'},
[ [ "", " " ],
map { [ $_, $_ eq 'debug' ? $text{'logging_debug'} :
$_ eq 'dynamic' ? $text{'logging_dyn'} : $_ ] }
@severities ],
1, 0, 0, 0,
"onChange='form.debug_$i.disabled = form.sev_$i.value != \"debug\"'"
)." ".
&ui_textbox("debug_$i", $sev->{'value'} eq 'debug' ?
$sev->{'values'}->[1] : "", 5,
$sev->{'value'} ne "debug"));
# Log category, severity and time
push(@cols, &yes_no_default("print-category-$i",
&find_value("print-category", $cmems)));
push(@cols, &yes_no_default("print-severity-$i",
&find_value("print-severity", $cmems)));
push(@cols, &yes_no_default("print-time-$i",
&find_value("print-time", $cmems)));
push(@table, \@cols);
}
# Output the channels table
print &ui_form_columns_table(
"save_logging.cgi",
[ [ undef, $text{'save'} ] ],
0,
undef,
[ [ 'mode', 'chans' ] ],
[ $text{'logging_cname'}, $text{'logging_to'}, $text{'logging_sev'},
$text{'logging_pcat2'}, $text{'logging_psev2'},
$text{'logging_ptime2'} ],
100,
\@table,
undef,
1);
print &ui_tabs_end_tab("mode", "chans");
# Start of categories tab
print &ui_tabs_start_tab("mode", "cats");
print $text{'logging_catsdesc'}," \n";
# Build table of categories
@table = ( );
@cats = ( &find("category", $mems), { } );
for($i=0; $i<@cats; $i++) {
my %cchan;
foreach $c (@{$cats[$i]->{'members'}}) {
$cchan{$c->{'name'}}++;
}
push(@table, [
&ui_select("cat_$i", $cats[$i]->{'value'},
[ [ "", " " ], @cat_list ],
1, 0, $cats[$i]->{'value'} ? 1 : 0),
join(" ", map { &ui_checkbox("cchan_$i", $_, $_, $cchan{$_}) }
@channames)
]);
}
# Show the table
print &ui_form_columns_table(
"save_logging.cgi",
[ [ undef, $text{'save'} ] ],
0,
undef,
[ [ 'mode', 'cats' ] ],
[ $text{'logging_cat'}, $text{'logging_cchans'} ],
100,
\@table,
undef,
1);
print &ui_tabs_end_tab("mode", "cats");
print &ui_tabs_end(1);
&ui_print_footer("", $text{'index_return'});
# yes_no_default(name, value)
sub yes_no_default
{
my ($n, $v) = @_;
return &ui_select($n, lc($v), [ [ '', $text{'default'} ],
[ 'yes', $text{'yes'} ],
[ 'no', $text{'no'} ] ]);
}
bind8/config-openbsd-3.2-* 0000664 0005671 0000012 00000001272 11137650373 015023 0 ustar jcameron wheel soa_style=0
named_path=/usr/sbin/named
named_conf=/etc/named.conf
show_list=0
records_order=0
max_zones=50
rev_def=0
support_aaaa=0
allow_comments=0
allow_wild=1
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
chroot=/var/named
rndc_cmd=rndc
no_pid_chroot=1
soa_start=0
rndc_conf=/etc/rndc.conf
rndcconf_cmd=rndc-confgen
largezones=0
checkzone=named-checkzone
keygen=dnssec-keygen
signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
bind8/save_logging.cgi 0000755 0005671 0000012 00000005370 11137650373 014710 0 ustar jcameron wheel #!/usr/local/bin/perl
# save_logging.cgi
# Save global logging options
require './bind8-lib.pl';
$access{'defaults'} || &error($text{'logging_ecannot'});
&error_setup($text{'files_err'});
&ReadParse();
&lock_file(&make_chroot($config{'named_conf'}));
$conf = &get_config();
$logging = &find("logging", $conf);
if ($in{'mode'} eq 'cats') {
# Save categories
for($i=0; defined($cat = $in{"cat_$i"}); $i++) {
next if (!$cat);
@cchan = split(/\0/, $in{"cchan_$i"});
push(@category, { 'name' => 'category',
'values' => [ $cat ],
'type' => 1,
'members' =>
[ map { { 'name' => $_ } } @cchan ] });
}
@channel = &find("channel", $logging->{'members'}) if ($logging);
}
else {
# Save channels
for($i=0; defined($cname = $in{"cname_$i"}); $i++) {
next if (!$cname);
$cname =~ /^\S+$/ || &error(&text('logging_ename', $cname));
local @mems;
if ($in{"to_$i"} == 0) {
$in{"file_$i"} || &error($text{'logging_efile'});
local @fvals = ( $in{"file_$i"} );
if ($in{"vmode_$i"} == 1) {
push(@fvals, 'versions', 'unlimited');
}
elsif ($in{"vmode_$i"} == 2) {
$in{"ver_$i"} =~ /^\d+$/ ||
&error(&text('logging_ever', $in{"ver_$i"}));
push(@fvals, 'versions', $in{"ver_$i"});
}
if ($in{"smode_$i"}) {
$in{"size_$i"} =~ /^\d+[kmg]*$/i ||
&error(&text('logging_esize', $in{"size_$i"}));
push(@fvals, 'size', $in{"size_$i"});
}
push(@mems, { 'name' => 'file',
'values' => \@fvals });
}
elsif ($in{"to_$i"} == 1) {
push(@mems, { 'name' => 'syslog',
'values' => [ $in{"syslog_$i"} ] });
}
else {
push(@mems, { 'name' => 'null' });
}
if ($in{"sev_$i"} eq 'debug') {
push(@mems, { 'name' => 'severity',
'values' => [ 'debug', $in{"debug_$i"} ] });
}
elsif ($in{"sev_$i"}) {
push(@mems, { 'name' => 'severity',
'values' => [ $in{"sev_$i"} ] });
}
foreach $p ('print-category', 'print-severity', 'print-time') {
push(@mems, { 'name' => $p,
'values' => [ $in{"$p-$i"} ] }) if ($in{"$p-$i"});
}
push(@channel, { 'name' => 'channel',
'values' => [ $cname ],
'type' => 1,
'members' => \@mems } );
}
@category = &find("category", $logging->{'members'}) if ($logging);
}
# Write out the logging section, creating if needed
if ($logging) {
&save_directive($logging, 'channel', \@channel, 1);
&save_directive($logging, 'category', [ ], 1);
&save_directive($logging, 'category', [ reverse(@category) ], 1);
}
else {
$logging = { 'name' => 'logging',
'type' => 1,
'members' => [ @channel, @category ] };
&save_directive(&get_config_parent(), 'logging', [ $logging ], 0);
}
&flush_file_lines();
&unlock_file(&make_chroot($config{'named_conf'}));
&webmin_log("logging", undef, undef, \%in);
&redirect("");
bind8/config-solaris-10-* 0000664 0005671 0000012 00000001431 11137650373 014760 0 ustar jcameron wheel soa_style=0
named_path=/usr/sbin/named
named_conf=/etc/named.conf
show_list=0
records_order=0
max_zones=50
rev_def=0
support_aaaa=0
allow_comments=0
allow_wild=1
allow_long=0
master_ttl=1
whois_cmd=whois
short_names=0
updserial_def=0
updserial_on=1
updserial_man=1
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=/usr/sbin/rndc
start_cmd=svcadm enable dns/server
stop_cmd=svcadm disable dns/server
soa_start=0
rndc_conf=/etc/rndc.conf
rndcconf_cmd=/usr/bin/rndc-confgen
largezones=0
no_pid_chroot=0
checkzone=/usr/bin/named-checkzone
keygen=/usr/bin/dnssec-keygen
signzone=/usr/bin/dnssec-signzone
checkconf=/usr/bin/named-checkconf
other_slaves=1
bind8/convert_slave.cgi 0000775 0005671 0000012 00000001506 11137650373 015115 0 ustar jcameron wheel #!/usr/local/bin/perl
# convert_slave.cgi
# Convert a slave/stub zone into a master
require './bind8-lib.pl';
&ReadParse();
$conf = &get_config();
if ($in{'view'} ne '') {
$conf = $conf->[$in{'view'}]->{'members'};
}
$zconf = $conf->[$in{'index'}];
&error_setup($text{'convert_err'});
$access{'master'} || &error($text{'mcreate_ecannot'});
$file = &find("file", $zconf->{'members'});
if (!$file) {
&error($text{'convert_efile'});
}
&lock_file(&make_chroot($zconf->{'file'}));
# Change the type directive
&save_directive($zconf, 'type', [ { 'name' => 'type',
'values' => [ 'master' ] } ], 1);
# Take out directives not allowed in masters
&save_directive($zconf, 'masters', [ ], 1);
&save_directive($zconf, 'max-transfer-time-in', [ ], 1);
&flush_file_lines();
&unlock_file(&make_chroot($zconf->{'file'}));
&redirect("");
bind8/save_slave.cgi 0000755 0005671 0000012 00000002770 11137650373 014375 0 ustar jcameron wheel #!/usr/local/bin/perl
# save_slave.cgi
# Save changes to slave zone options in named.conf
require './bind8-lib.pl';
&ReadParse();
$conf = &get_config();
if ($in{'view'} ne '') {
$view = $conf->[$in{'view'}];
$conf = $view->{'members'};
$indent = 2;
}
else {
$indent = 1;
}
$zconf = $conf->[$in{'index'}];
&lock_file(&make_chroot($zconf->{'file'}));
&error_setup($text{'slave_err'});
&can_edit_zone($zconf, $view) ||
&error($text{'slave_ecannot'});
$access{'ro'} && &error($text{'master_ero'});
$access{'opts'} || &error($text{'master_eoptscannot'});
&save_port_address("masters", "port", $zconf, $indent);
&save_opt("max-transfer-time-in", \&mtti_check, $zconf, $indent);
&save_opt("file", \&file_check, $zconf, $indent);
&save_choice("check-names", $zconf, $indent);
&save_choice("notify", $zconf, $indent);
&save_addr_match("allow-update", $zconf, $indent);
&save_addr_match("allow-transfer", $zconf, $indent);
&save_addr_match("allow-query", $zconf, $indent);
&save_address("also-notify", $zconf, $indent);
&flush_file_lines();
&unlock_file(&make_chroot($zconf->{'file'}));
&webmin_log("opts", undef, $zconf->{'value'}, \%in);
&redirect("edit_slave.cgi?index=$in{'index'}&view=$in{'view'}");
sub mtti_check
{
return $_[0] =~ /^\d+$/ ? undef : &text('slave_emax', $_[0]);
}
sub file_check
{
return $text{'slave_efile'} if ($_[0] !~ /\S/);
local $file = $_[0];
if ($_[0] !~ /^\//) {
$file = &base_directory($conf)."/".$file;
}
return &allowed_zone_file(\%access, $file) ? undef :
&text('slave_efile2', $_[0]);
}
bind8/whois-servers 0000664 0005671 0000012 00000005275 11137650373 014326 0 ustar jcameron wheel .ac whois.nic.ac
.aero whois.nic.aero
.al whois.ripe.net
.am whois.amnic.net
.as whois.nic.as
.at whois.aco.net
.net.au whois.net.au
.au whois.aunic.net
.az whois.ripe.net
.ba whois.ripe.net
.be whois.ripe.net
.bg whois.ripe.net
.biz whois.neulevel.biz
.br whois.nic.br
.by whois.ripe.net
.ca whois.cira.ca
.cc whois.nic.cc
.ch whois.nic.ch
.cl whois.nic.cl
.cn whois.cnnic.net.cn
.com whois.internic.net
.br.com whois.centralnic.com
.cn.com whois.centralnic.com
.de.com whois.centralnic.com
.eu.com whois.centralnic.com
.gb.com whois.centralnic.com
.gb.net whois.centralnic.com
.hu.com whois.centralnic.com
.no.com whois.centralnic.com
.qc.com whois.centralnic.com
.ru.com whois.centralnic.com
.sa.com whois.centralnic.com
.se.com whois.centralnic.com
.se.net whois.centralnic.com
.uk.com whois.centralnic.com
.uk.net whois.centralnic.com
.us.com whois.centralnic.com
.uy.com whois.centralnic.com
.za.com whois.centralnic.com
.coop whois.nic.coop
.cx whois.nic.cx
.cy whois.ripe.net
.cz whois.ripe.net
.de whois.denic.de
.dk whois.dk-hostmaster.dk
.dz whois.ripe.net
.edu whois.educause.net
.ee whois.ripe.net
.eg whois.ripe.net
.es whois.ripe.net
.fi whois.ripe.net
.fo whois.ripe.net
.fr whois.nic.fr
.gb whois.ripe.net
.ge whois.ripe.net
.gov whois.nic.gov
.gr whois.ripe.net
.gs whois.adamsnames.tc
.hk whois.apnic.net
.hr whois.ripe.net
.hu whois.ripe.net
.ie whois.domainregistry.ie
.il whois.ripe.net
.in whois.ncst.ernet.in
.info whois.afilias.net
.int whois.iana.org
.is whois.ripe.net
.it whois.nic.it
.jp whois.nic.ad.jp
.kh whois.nic.net.kh
.kr whois.apnic.net
.li whois.nic.ch
.lt whois.ripe.net
.lu whois.dns.lu
.lv whois.ripe.net
.ma whois.ripe.net
.md whois.ripe.net
.mil whois.nic.mil
.mk whois.ripe.net
.ms whois.adamsnames.tc
.mt whois.ripe.net
.museum whois.museum
.mx whois.nic.mx
.name whois.nic.name
.net whois.crsnic.net
.nl whois.domain-registry.nl
.no whois.norid.no
.nu whois.nic.nu
.nz whois.domainz.net.nz
.org whois.pir.org
.pl whois.ripe.net
.pr whois.uprr.pr
.pt whois.ripe.net
.ro whois.ripe.net
.ru whois.ripn.ru
.se whois.nic-se.se
.sg whois.nic.net.sg
.sh whois.nic.sh
.si whois.ripe.net
.sk whois.ripe.net
.sm whois.ripe.net
.su whois.ripn.net
.tc whois.adamsnames.tc
.tf whois.adamsnames.tc
.th whois.thnic.net
.tj whois.nic.tj
.tn whois.ripe.net
.to whois.tonic.to
.tr whois.ripe.net
.tv whois.tv
.tw whois.twnic.net
.ua whois.ripe.net
.uk whois.nic.uk
.ac.uk whois.ja.net
.gov.uk whois.ja.net
.us whois.nic.us
.va whois.ripe.net
.vg whois.adamsnames.tc
.ws whois.nic.ws
bind8/conf_acls.cgi 0000755 0005671 0000012 00000001545 11137650373 014173 0 ustar jcameron wheel #!/usr/local/bin/perl
# conf_acls.cgi
# Display global ACLs
require './bind8-lib.pl';
$access{'defaults'} || &error($text{'acls_ecannot'});
&ui_print_header(undef, $text{'acls_title'}, "",
undef, undef, undef, undef, &restart_links());
$conf = &get_config();
@acls = ( &find("acl", $conf), { } );
print &ui_form_start("save_acls.cgi", "post");
print &ui_columns_start([ $text{'acls_name'}, $text{'acls_values'} ]);
for($i=0; $i<@acls; $i++) {
@cols = ( );
push(@cols, &ui_textbox("name_$i", $acls[$i]->{'value'}, 15));
@vals = map { join(" ", $_->{'name'}, @{$_->{'values'}}) }
@{$acls[$i]->{'members'}};
push(@cols, &ui_textarea("values_$i", join("\n", @vals), 5, 60, "off"));
print &ui_columns_row(\@cols, [ "valign=top" ]);
}
print &ui_columns_end();
print &ui_form_end([ [ undef, $text{'save'} ] ]);
&ui_print_footer("", $text{'index_return'});
bind8/config-irix 0000664 0005671 0000012 00000001250 11137650373 013711 0 ustar jcameron wheel soa_style=0
named_path=/usr/sbin/named
named_conf=/etc/named.conf
show_list=0
records_order=0
max_zones=50
rev_def=0
support_aaaa=0
allow_comments=0
allow_wild=1
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
checkzone=named-checkzone
keygen=dnssec-keygen
signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
bind8/forward_form.cgi 0000755 0005671 0000012 00000002222 11137650373 014724 0 ustar jcameron wheel #!/usr/local/bin/perl
# forward_form.cgi
# A form for creating a new forard zone
require './bind8-lib.pl';
$access{'forward'} || &error($text{'fcreate_ecannot'});
$access{'ro'} && &error($text{'master_ero'});
&ui_print_header(undef, $text{'fcreate_title'}, "",
undef, undef, undef, undef, &restart_links());
# Form start
print &ui_form_start("create_forward.cgi");
print &ui_table_start($text{'fcreate_opts'}, "width=100%", 4);
# Forward or reverse?
print &ui_table_row($text{'fcreate_type'},
&ui_radio("rev", 0, [ [ 0, $text{'fcreate_fwd'} ],
[ 1, $text{'fcreate_rev'} ] ]), 3);
# Domain name
print &ui_table_row($text{'fcreate_dom'},
&ui_textbox("zone", undef, 60), 3);
# In view
$conf = &get_config();
@views = &find("view", $conf);
if (@views) {
print &ui_table_row($text{'mcreate_view'},
&ui_select("view", undef,
[ map { [ $_->{'index'}, $_->{'values'}->[0] ] }
grep { &can_edit_view($_) } @views ]), 3);
}
# Master servers
print &ui_table_row($text{'fcreate_masters'},
&ui_textarea("masters", undef, 4, 30));
print &ui_table_end();
print &ui_form_end([ [ undef, $text{'create'} ] ]);
&ui_print_footer("", $text{'index_return'});
bind8/dns_boot.cgi 0000755 0005671 0000012 00000004641 11137650373 014053 0 ustar jcameron wheel #!/usr/local/bin/perl
# dns_boot.cgi
# Create an empty named.conf file and start the name server
require './bind8-lib.pl';
&error_setup($text{'boot_err'});
&ReadParse();
$config{'named_conf'} =~ /^(\S+)\/([^\/]+)$/;
$conf_directory = $1;
$pid_file = $config{'pid_file'} || "/var/run/named.pid";
&lock_file(&make_chroot($config{'named_conf'}));
&lock_file(&make_chroot("$conf_directory/db.cache"));
$conf_temp = &transname("webmin.named.conf");
open(BOOT, ">$conf_temp");
print BOOT "options {\n";
print BOOT "\tdirectory \"$conf_directory\";\n";
print BOOT "\tpid-file \"$pid_file\";\n";
print BOOT "\t};\n";
print BOOT "\n";
$chroot = &get_chroot();
if ($chroot && !-d $chroot) {
mkdir($chroot, 0755);
}
if (!-d &make_chroot($conf_directory)) {
mkdir(&make_chroot($conf_directory), 0755);
}
if ($config{'master_dir'} && !-d &make_chroot($config{'master_dir'})) {
mkdir(&make_chroot($config{'master_dir'}), 0755);
}
if ($config{'slave_dir'} && !-d &make_chroot($config{'slave_dir'})) {
mkdir(&make_chroot($config{'slave_dir'}), 0777);
}
if ($pid_file =~ /^(.*)\//) {
$pid_dir = $1;
if (!-d &make_chroot($pid_dir)) {
mkdir(&make_chroot($pid_dir), 0777);
}
}
if (!-r &make_chroot($pid_file)) {
&open_tempfile(PID, ">".&make_chroot($pid_file));
&close_tempfile(PID);
&set_ownership(&make_chroot($pid_file));
}
if ($in{real} == 0) {
# Create an empty root domain file... no need to do anything here
}
elsif ($in{real} == 1) {
# Try to download the root servers file from
# ftp://rs.internic.net/domain/named.root
$err = &download_root_zone("$conf_directory/db.cache");
&error($err) if ($err);
print BOOT "zone \".\" {\n";
print BOOT "\ttype hint;\n";
print BOOT "\tfile \"$conf_directory/db.cache\";\n";
print BOOT "\t};\n";
print BOOT "\n";
}
elsif ($in{real} == 2) {
# Use builtin db.cache
&execute_command("cp ./db.cache ".&make_chroot("$conf_directory/db.cache"));
print BOOT "zone \".\" {\n";
print BOOT "\ttype hint;\n";
print BOOT "\tfile \"$conf_directory/db.cache\";\n";
print BOOT "\t};\n";
print BOOT "\n";
}
close(BOOT);
©_source_dest($conf_temp, &make_chroot($config{'named_conf'}));
unlink($conf_temp);
&unlock_file(&make_chroot("$conf_directory/db.cache"));
&unlock_file(&make_chroot($config{'named_conf'}));
&set_ownership(&make_chroot("$conf_directory/db.cache"))
if ($in{'real'} == 2 || $in{'real'} == 1);
&set_ownership(&make_chroot($config{'named_conf'}));
&webmin_log("boot");
&redirect("start.cgi");
bind8/images/ 0000755 0005671 0000012 00000000000 11137650374 013016 5 ustar jcameron wheel bind8/images/MX.gif 0000644 0005671 0000012 00000000435 11137650373 014032 0 ustar jcameron wheel GIF89a0 0 !Created with The GIMP !
, 0 0 یڋC "cbA*~K>t3m~-qTo/{5VPV-嶊mXu"u3}ÑnC:gWaޓh7"axG8Ħ'x5w0i貉Y
i*JI9;S:+6Z'G |-l|ܩ<͌5Z(-=|mxΜ>=/?O_oOQ ; bind8/images/gen.gif 0000664 0005671 0000012 00000000477 11137650373 014267 0 ustar jcameron wheel GIF89a0 0 !Created with The GIMP !
, 0 0 ˽pq]3vWRi6+^nNj]bݐiZ[x
kF[P2k|\C*ZK7:ݸvcaG3DSSLjՇgքX
EZjhIzK)T'zyg<9%)
ܴ|N^.\2mB>{B?
4Lmf4ɫP 9،1 ; bind8/images/close.gif 0000644 0005671 0000012 00000000160 11137650373 014606 0 ustar jcameron wheel GIF89a ̙fff! , Aqbk"phyZ:V
SЙv05g<%|vh ; bind8/images/forwarding.gif 0000644 0005671 0000012 00000000473 11137650373 015652 0 ustar jcameron wheel GIF89a0 0 HMzfff !Made with GIMP ! , 0 0 I8ͻ`(dihlptm߷5ȤR@.J)R&5癜-sf[\M+Y~cec wZZ^PO{o}mXfC4 6BAn9"=!XzCa4Թֲؿڥ`5⤵2 ; bind8/images/master.gif 0000644 0005671 0000012 00000003626 11137650373 015006 0 ustar jcameron wheel GIF89a0 0 幏Ģ͒FyǺٮԤɉrhZԻxݶ~ZB|fh~F32rS\yў~^سϗʌň{½tudGҮg;4(ڬڪLjn[S 7֤֝d~ \
|DߢМ
".
&ui_textarea($_[1], join("\n", @av), 3, 15));
}
# save_addr_match(name, &parent, indent)
sub save_addr_match
{
local($addr, @vals, $dir);
if ($in{"$_[0]_def"}) { &save_directive($_[1], $_[0], [ ], $_[2]); }
else {
$in{$_[0]} =~ s/\r//g;
foreach $addr (split(/\n+/, $in{$_[0]})) {
local ($n, @v) = split(/\s+/, $addr);
push(@vals, { 'name' => $n, 'values' => \@v });
}
$dir = { 'name' => $_[0], 'type' => 1, 'members' => \@vals };
&save_directive($_[1], $_[0], [ $dir ], $_[2]);
}
}
# address_port_input(addresstext, portlabeltext, portnametext, defaulttext,
# addressname, portname, &config, size, type)
# Returns table fields for address and a port number
sub address_port_input
{
# Address, using existing function
my $rv = &address_input($_[0], $_[4], $_[6], $_[8]);
my $v = &find($_[4], $_[6]);
my $port;
for ($i = 0; $i < @{$v->{'values'}}; $i++) {
if ($v->{'values'}->[$i] eq $_[5]) {
$port = $v->{'values'}->[$i+1];
last;
}
}
# Port part
my $n;
($n = $_[5]) =~ s/[^A-Za-z0-9_]/_/g;
$rv .= &ui_table_row($_[1],
&ui_opt_textbox($n, $port, $_[7], $_[3], $_[2]));
return $rv;
}
# address_input(text, name, &config, type)
sub address_input
{
local($v, $av, @av);
$v = &find($_[1], $_[2]);
foreach $av (@{$v->{'members'}}) {
push(@av, join(" ", $av->{'name'}, @{$av->{'values'}}));
}
if ($_[3] == 0) {
# text area
return &ui_table_row($_[0],
&ui_textarea($_[1], join("\n", @av), 3, 15));
}
else {
# text row
return &ui_table_row($_[0],
&ui_textbox($_[1], join(' ',@av), 50));
}
}
# save_port_address(name, portname, &config, indent)
sub save_port_address {
local($addr, $port, @vals, $dir);
foreach $addr (split(/\s+/, $in{$_[0]})) {
$addr =~ /^\S+$/ || &error(&text('eipacl', $addr));
push(@vals, { 'name' => $addr });
}
$dir = { 'name' => $_[0], 'type' => 1, 'members' => \@vals };
($n = $_[1]) =~ s/[^A-Za-z0-9_]/_/g;
$dir->{'values'} = [ $_[1], $in{$_[1]} ] if (!$in{"${n}_def"});
&save_directive($_[2], $_[0], @vals ? [ $dir ] : [ ], $_[3]);
}
# save_address(name, &parent, indent, ips-only)
sub save_address
{
local ($addr, @vals, $dir, $i);
local @sp = split(/\s+/, $in{$_[0]});
for($i=0; $i<@sp; $i++) {
!$_[3] || &check_ipaddress($sp[$i]) || &error(&text('eip', $sp[$i]));
if (lc($sp[$i]) eq "key") {
push(@vals, { 'name' => $sp[$i],
'values' => [ $sp[++$i] ] });
}
else {
push(@vals, { 'name' => $sp[$i] });
}
}
$dir = { 'name' => $_[0], 'type' => 1, 'members' => \@vals };
&save_directive($_[1], $_[0], @vals ? [ $dir ] : [ ], $_[2]);
}
# forwarders_input(text, name, &config)
# Returns a form field containing a table of forwarding IPs and ports
sub forwarders_input
{
my $v = &find($_[1], $_[2]);
my (@ips, @prs);
foreach my $av (@{$v->{'members'}}) {
push(@ips, $av->{'name'});
if ($av->{'values'}->[0] eq 'port') {
push(@prs, $av->{'values'}->[1]);
}
else {
push(@prs, undef);
}
}
my @table;
for(my $i=0; $i<@ips+3; $i++) {
push(@table, [ &ui_textbox("$_[1]_ip_$i", $ips[$i], 20),
&ui_opt_textbox("$_[1]_pr_$i", $prs[$i], 5,
$text{'default'}),
]);
}
return &ui_table_row($_[0],
&ui_columns_table([ $text{'forwarding_ip'}, $text{'forwarding_port'} ],
undef, \@table, undef, 1), 3);
}
# save_forwarders(name, &parent, indent)
sub save_forwarders
{
local ($i, $ip, $pr, @vals);
for($i=0; defined($ip = $in{"$_[0]_ip_$i"}); $i++) {
next if (!$ip);
&check_ipaddress($ip) || &error(&text('eip', $ip));
$pr = $in{"$_[0]_pr_${i}_def"} ? undef : $in{"$_[0]_pr_$i"};
!$pr || $pr =~ /^\d+$/ || &error(&text('eport', $pr));
push(@vals, { 'name' => $ip,
'values' => $pr ? [ "port", $pr ] : [ ] });
}
local $dir = { 'name' => $_[0], 'type' => 1, 'members' => \@vals };
&save_directive($_[1], $_[0], @vals ? [ $dir ] : [ ], $_[2]);
}
# opt_input(text, name, &config, default, size, units)
# Returns a table row with an optional text field
sub opt_input
{
my $v = &find($_[1], $_[2]);
my $n;
($n = $_[1]) =~ s/[^A-Za-z0-9_]/_/g;
return &ui_table_row($_[0],
&ui_opt_textbox($n, $v ? $v->{'value'} : "", $_[4], $_[3])." ".$_[5],
$_[4] > 30 ? 3 : 1);
}
sub save_opt
{
local($dir, $n);
($n = $_[0]) =~ s/[^A-Za-z0-9_]/_/g;
if ($in{"${n}_def"}) { &save_directive($_[2], $_[0], [ ], $_[3]); }
elsif ($err = &{$_[1]}($in{$n})) {
&error($err);
}
else {
$dir = { 'name' => $_[0], 'values' => [ $in{$n} ] };
&save_directive($_[2], $_[0], [ $dir ], $_[3]);
}
}
# directives that need their value to be quoted
@need_quote = ( "file", "zone", "pid-file", "statistics-file",
"dump-file", "named-xfer", "secret" );
foreach $need (@need_quote) {
$need_quote{$need}++;
}
1;
# find_reverse(address, [view])
# Returns the zone and record structures for the PTR record for some address
sub find_reverse
{
local($conf, @zl, $rev, $z, $revconf, $revfile, $revrec, @revrecs, $addr, $rr,
@octs, $i, @hexs, $ipv6, @zero);
# find reverse domain
local @zl = grep { $_->{'type'} ne 'view' } &list_zone_names();
if ($_[1] ne '') {
@zl = grep { $_->{'view'} && $_->{'viewindex'} == $_[1] } @zl;
}
else {
@zl = grep { !$_->{'view'} } @zl;
}
$ipv6 = $config{'support_aaaa'} && &check_ip6address($_[0]);
if ($ipv6) {
@zero = (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
$addr = &expandall_ip6($_[0]);
$addr =~ s/://g;
@hexs = split('', $addr);
DOMAIN: for($i=30; $i>=0; $i--) {
$addr = join(':',split(/(.{4})/,join('', (@hexs[0..$i],@zero[$i..30]))));
$addr =~ s/::/:/g;
$addr =~ s/(^:|:$)//g;
$rev = &net_to_ip6int($addr, 4*($i+1));
$rev =~ s/\.$//g;
foreach $z (@zl) {
if (lc($z->{'name'}) eq $rev && $z->{'type'} eq 'master') {
# found the reverse master domain
$revconf = $z;
last DOMAIN;
}
}
}
}
else {
@octs = split(/\./, $_[0]);
DOMAIN: for($i=2; $i>=-1; $i--) {
$rev = $i<0 ? "in-addr.arpa"
: &ip_to_arpa(join('.', @octs[0..$i]));
$rev =~ s/\.$//g;
foreach $z (@zl) {
if ((lc($z->{'name'}) eq $rev ||
lc($z->{'name'}) eq "$rev.") &&
$z->{'type'} eq "master") {
# found the reverse master domain
$revconf = $z;
last DOMAIN;
}
}
}
}
# find reverse record
if ($revconf) {
$revfile = &absolute_path($revconf->{'file'});
@revrecs = &read_zone_file($revfile, $revconf->{'name'});
if ($ipv6) {
$addr = &net_to_ip6int($_[0], 128);
}
else {
$addr = &ip_to_arpa($_[0]);
}
foreach $rr (@revrecs) {
if ($rr->{'type'} eq "PTR" &&
lc($rr->{'name'}) eq lc($addr)) {
# found the reverse record
$revrec = $rr;
last;
}
}
}
return ($revconf, $revfile, $revrec);
}
# find_forward(address, [view])
# Returns the zone and record structures for the A record for some address
sub find_forward
{
local ($fwdconf, $i, $fwdfile, $fwdrec, $fr, $ipv6);
# find forward domain
local $host = $_[0]; $host =~ s/\.$//;
local @zl = grep { $_->{'type'} ne 'view' } &list_zone_names();
if ($_[1] ne '') {
@zl = grep { $_->{'view'} && $_->{'viewindex'} == $_[1] } @zl;
}
else {
@zl = grep { !$_->{'view'} } @zl;
}
local @parts = split(/\./, $host);
DOMAIN: for($i=1; $i<@parts; $i++) {
local $fwd = join(".", @parts[$i .. @parts-1]);
foreach $z (@zl) {
local $typed;
if ((lc($z->{'name'}) eq $fwd ||
lc($z->{'name'}) eq "$fwd.") &&
$z->{'type'} eq "master") {
# Found the forward master!
$fwdconf = $z;
last DOMAIN;
}
}
}
# find forward record
if ($fwdconf) {
$fwdfile = &absolute_path($fwdconf->{'file'});
local @fwdrecs = &read_zone_file($fwdfile, $fwdconf->{'name'});
foreach $fr (@fwdrecs) {
if ($ipv6 ? $fr->{'type'} eq "AAAA" : $fr->{'type'} eq "A" &&
$fr->{'name'} eq $_[0]) {
# found the forward record!
$fwdrec = $fr;
last;
}
}
}
return ($fwdconf, $fwdfile, $fwdrec);
}
# can_edit_zone(&zone, [&view] | &cachedzone)
# Returns 1 if some zone can be edited
sub can_edit_zone
{
local %zcan;
local ($zn, $vn, $file);
if ($_[0]->{'members'}) {
# A full zone structure
$zn = $_[0]->{'value'};
$vn = $_[1] ? 'view_'.$_[1]->{'value'} : undef;
$file = &find_value("file", $_[0]->{'members'});
}
else {
# A cached zone object
$zn = $_[0]->{'name'};
$vn = $_[0]->{'view'} eq '*' ? undef : $_[0]->{'view'};
$file = $_[0]->{'file'};
}
# Check zone name
if ($access{'zones'} eq '*') {
# Always can
}
elsif ($access{'zones'} =~ /^\!/) {
# List of denied zones
foreach (split(/\s+/, $access{'zones'})) {
return 0 if ($_ eq $zn || ($vn && $_ eq $vn));
}
}
else {
# List of allowed zones
local $ok;
foreach (split(/\s+/, $access{'zones'})) {
$ok++ if ($_ eq $zn || ($vn && $_ eq $vn));
}
return 0 if (!$ok);
}
if ($access{'dironly'}) {
# Check directory access control
return 1 if (!$file);
$file = &absolute_path($file);
return 0 if (!&allowed_zone_file(\%access, $file));
}
return 1;
}
# can_edit_reverse(&zone)
sub can_edit_reverse
{
return $access{'reverse'} || &can_edit_zone($_[0]);
}
# record_input(zoneindex, view, type, file, origin, [num], [record],
# [new-name, new-value])
# Display a form for editing or creating a DNS record
sub record_input
{
local(%rec, @recs, $ttl, $ttlunit);
local $type = $_[6] ? $_[6]->{'type'} : $_[2];
print &ui_form_start("save_record.cgi");
print &ui_hidden("index", $_[0]);
print &ui_hidden("view", $_[1]);
print &ui_hidden("file", $_[3]);
print &ui_hidden("origin", $_[4]);
print &ui_hidden("sort", $in{'sort'});
if (defined($_[5])) {
print &ui_hidden("num", $_[5]);
%rec = %{$_[6]};
}
else {
print &ui_hidden("new", 1);
$rec{'name'} = $_[7] if ($_[7]);
$rec{'values'} = [ $_[8] ] if ($_[8]);
}
print &ui_hidden("type", $type);
print &ui_hidden("redirtype", $_[2]);
print &ui_table_start(&text(defined($_[5]) ? 'edit_edit' : 'edit_add',
$text{"edit_".$type}));
# Record name field(s)
if ($type eq "PTR") {
print &ui_table_row($text{'edit_addr'},
&ui_textbox("name",
!%rec && $_[4] =~ /^(\d+)\.(\d+)\.(\d+)\.in-addr/ ?
"$3.$2.$1." :
&ip6int_to_net(&arpa_to_ip($rec{'name'})), 30));
}
elsif ($type eq "NS") {
print &ui_table_row($text{'edit_zonename'},
&ui_textbox("name", $rec{'name'}, 30));
}
elsif ($type eq "SRV") {
local ($serv, $proto, $name) =
$rec{'name'} =~ /^([^\.]+)\.([^\.]+)\.(\S+)/ ? ($1, $2, $3) :
(undef, undef, undef);
$serv =~ s/^_//;
$proto =~ s/^_//;
print &ui_table_row($text{'edit_name'},
&ui_textbox("name", $name, 30));
print &ui_table_row($text{'edit_proto'},
&ui_select("proto", $proto,
[ [ "tcp", "TCP" ],
[ "udp", "UDP" ],
[ "tls", "TLS" ] ], undef, undef, 1));
print &ui_table_row($text{'edit_serv'},
&ui_textbox("serv", $serv, 20));
}
else {
print &ui_table_row($text{'edit_name'},
&ui_textbox("name", $rec{'name'}, 30));
}
# Show canonical name too, if not auto-converted
if ($config{'short_names'} && defined($_[5])) {
print &ui_table_row($text{'edit_canon'}, "$rec{'canon'}");
}
# TTL field
if ($rec{'ttl'} =~ /^(\d+)([SMHDW]?)$/i) {
$ttl = $1; $ttlunit = $2;
}
else {
$ttl = $rec{'ttl'}; $ttlunit = "";
}
print &ui_table_row($text{'edit_ttl'},
&ui_opt_textbox("ttl", $ttl, 8, $text{'default'})." ".
&time_unit_choice("ttlunit", $ttlunit));
# Value(s) fields
@v = @{$rec{'values'}};
if ($type eq "A" || $type eq "AAAA") {
print &ui_table_row($text{'value_A1'},
&ui_textbox("value0", $v[0], 20)." ".
(!defined($_[5]) && $type eq "A" ?
&free_address_button("value0") : ""), 3);
if (defined($_[5])) {
print &ui_hidden("oldname", $rec{'name'});
print &ui_hidden("oldvalue0", $v[0]);
}
}
elsif ($type eq "NS") {
print &ui_table_row($text{'value_NS1'},
&ui_textbox("value0", $v[0], 30)." ($text{'edit_cnamemsg'})", 3);
}
elsif ($type eq "CNAME") {
print &ui_table_row($text{'value_CNAME1'},
&ui_textbox("value0", $v[0], 30)." ($text{'edit_cnamemsg'})", 3);
}
elsif ($type eq "MX") {
print &ui_table_row($text{'value_MX2'},
&ui_textbox("value1", $v[1], 30));
print &ui_table_row($text{'value_MX1'},
&ui_textbox("value0", $v[0], 8));
}
elsif ($type eq "HINFO") {
print &ui_table_row($text{'value_HINFO1'},
&ui_textbox("value0", $v[0], 20));
print &ui_table_row($text{'value_HINFO2'},
&ui_textbox("value1", $v[1], 20));
}
elsif ($type eq "TXT") {
print &ui_table_row($text{'value_TXT1'},
&ui_textbox("value0", $v[0], 40), 3);
}
elsif ($type eq "WKS") {
# Well known server
print &ui_table_row($text{'value_WKS1'},
&ui_textbox("value0", $v[0], 15));
print &ui_table_row($text{'value_WKS2'},
&ui_select("value1", lc($v[1]),
[ [ "tcp", "TCP" ], [ "udp", "UDP" ] ]));
print &ui_table_row($text{'value_WKS3'},
&ui_textarea("value2", join(' ', @v[2..$#v]), 3, 20));
}
elsif ($type eq "RP") {
# Responsible person
print &ui_table_row($text{'value_RP1'},
&ui_textbox("value0", &dotted_to_email($v[0]), 20));
print &ui_table_row($text{'value_RP2'},
&ui_textbox("value1", $v[1], 30));
}
elsif ($type eq "PTR") {
# Reverse address
print &ui_table_row($text{'value_PTR1'},
&ui_textbox("value0", $v[0], 30), 3);
if (defined($_[5])) {
print &ui_hidden("oldname", $rec{'name'});
print &ui_hidden("oldvalue0", $v[0]);
}
}
elsif ($type eq "SRV") {
print &ui_table_row($text{'value_SRV1'},
&ui_textbox("value0", $v[0], 8));
print &ui_table_row($text{'value_SRV2'},
&ui_textbox("value1", $v[1], 8));
print &ui_table_row($text{'value_SRV3'},
&ui_textbox("value2", $v[2], 8));
print &ui_table_row($text{'value_SRV4'},
&ui_textbox("value3", $v[3], 30));
}
elsif ($type eq "LOC") {
print &ui_table_row($text{'value_LOC1'},
&ui_textbox("value0", join(" ", @v), 40), 3);
}
elsif ($type eq "KEY") {
print &ui_table_row($text{'value_KEY1'},
&ui_textbox("value0", $v[0], 8));
print &ui_table_row($text{'value_KEY2'},
&ui_textbox("value1", $v[1], 8));
print &ui_table_row($text{'value_KEY3'},
&ui_textbox("value2", $v[2], 8));
print &ui_table_row($text{'value_KEY4'},
&ui_textarea("value3", join("\n", &wrap_lines($v[3], 80)),
5, 80), 3);
}
elsif ($type eq "SPF") {
# SPF records are complex, as they have several attributes encoded
# in the TXT value
local $spf = &parse_spf($v[0]);
print &ui_table_row($text{'value_spfa'},
&ui_yesno_radio("spfa", $spf->{'a'} ? 1 : 0), 3);
print &ui_table_row($text{'value_spfmx'},
&ui_yesno_radio("spfmx", $spf->{'mx'} ? 1 : 0), 3);
print &ui_table_row($text{'value_spfptr'},
&ui_yesno_radio("spfptr", $spf->{'ptr'} ? 1 : 0), 3);
print &ui_table_row($text{'value_spfas'},
&ui_textarea("spfas", join("\n", @{$spf->{'a:'}}), 3, 40), 3);
print &ui_table_row($text{'value_spfmxs'},
&ui_textarea("spfmxs", join("\n", @{$spf->{'mx:'}}), 3, 40), 3);
print &ui_table_row($text{'value_spfip4s'},
&ui_textarea("spfip4s", join("\n", @{$spf->{'ip4:'}}),
3, 40), 3);
print &ui_table_row($text{'value_spfincludes'},
&ui_textarea("spfincludes", join("\n", @{$spf->{'include:'}}),
3, 40), 3);
print &ui_table_row($text{'value_spfall'},
&ui_select("spfall", int($spf->{'all'}),
[ [ 3, $text{'value_spfall3'} ],
[ 2, $text{'value_spfall2'} ],
[ 1, $text{'value_spfall1'} ],
[ 0, $text{'value_spfall0'} ],
[ undef, $text{'value_spfalldef'} ] ]), 3);
}
else {
# All other types just have a text box
print &ui_table_row($text{'value_other'},
&ui_textarea("values", join("\n", @v), 3, 40), 3);
}
# Comment field
if ($type ne "WKS") {
if ($config{'allow_comments'}) {
print &ui_table_row($text{'edit_comment'},
&ui_textbox("comment", $rec{'comment'}, 40), 3);
}
else {
print &ui_hidden("comment", $rec{'comment'});
}
}
# Update reverse/forward option
if ($type eq "A" || $type eq "AAAA") {
print &ui_table_row($text{'edit_uprev'},
&ui_radio("rev", $config{'rev_def'} == 0 ? 1 :
$config{'rev_def'} == 2 ? 2 : 0,
[ [ 1, $text{'yes'} ],
defined($_[5]) ? ( ) : ( [ 2, $text{'edit_over'} ] ),
[ 0, $text{'no'} ] ]));
}
elsif ($type eq "PTR") {
print &ui_table_row($text{'edit_upfwd'},
&ui_radio("fwd", $config{'rev_def'} ? 0 : 1,
[ [ 1, $text{'yes'} ],
[ 0, $text{'no'} ] ]));
}
print &ui_table_end();
# End buttons
if (!$access{'ro'}) {
if (defined($_[5])) {
print &ui_form_end([ [ undef, $text{'save'} ],
[ "delete", $text{'delete'} ] ]);
}
else {
print &ui_form_end([ [ undef, $text{'create'} ] ]);
}
}
}
# zones_table(&links, &titles, &types, &deletes)
# Returns a table of zones, with checkboxes to delete
sub zones_table
{
local($i);
local @tds = ( "width=5" );
local $rv;
$rv .= &ui_columns_start([ "", $text{'index_zone'}, $text{'index_type'} ],
100, 0, \@tds);
for($i=0; $i<@{$_[0]}; $i++) {
local @cols = ( "[$i]\">$_[1]->[$i]",
$_[2]->[$i] );
if (defined($_[3]->[$i])) {
$rv .= &ui_checked_columns_row(\@cols, \@tds, "d", $_[3]->[$i]);
}
else {
$rv .= &ui_columns_row(\@cols, \@tds);
}
}
$rv .= &ui_columns_end();
return $rv;
}
# convert_illegal(text)
# Convert text containing special HTML characters to properly display it.
sub convert_illegal
{
$_[0] =~ s/&/&/g;
$_[0] =~ s/>/>/g;
$_[0] =~ s/</g;
$_[0] =~ s/"/"/g;
$_[0] =~ s/ / /g;
return $_[0];
}
sub check_net_ip
{
local($j, $arg = $_[0]);
if ($arg !~ /^(\d{1,3}\.){0,3}([0-9\-\/]+)$/) {
return 0;
}
foreach $j (split(/\./, $arg)) {
$j =~ /^(\d+)-(\d+)$/ && $1 < 255 && $2 < 255 ||
$j =~ /^(\d+)\/(\d+)$/ && $1 < 255 && $2 <= 32 ||
$j <= 255 || return 0;
}
return 1;
}
# expand_ip6(ip)
# Transform compact (with ::) IPv6 address to the unique expanded form
# (without :: and leading zeroes in all parts)
sub expand_ip6
{
local($n);
for($n = 6 - ($_[0] =~ s/([^:]):(?=[^:])/$1:/g); $n > 0; $n--) {
$_[0] =~ s/::/:0::/;
}
$_[0] =~ s/::/:/;
$_[0] =~ s/^:/0:/;
$_[0] =~ s/:$/:0/;
$_[0] =~ s/(:|^)0(?=\w)/$1/;
$_[0] =~ tr/[A-Z]/[a-z]/;
return $_[0];
}
# expandall_ip6(ip)
# Transform IPv6 address to the expanded form containing all internal 0's
sub expandall_ip6
{
&expand_ip6($_[0]);
$_[0] =~ s/(:|^)(\w{3})(?=:|$)/:0$2/g;
$_[0] =~ s/(:|^)(\w{2})(?=:|$)/:00$2/g;
$_[0] =~ s/(:|^)(\w)(?=:|$)/:000$2/g;
return $_[0];
}
# check_ip6address(ip)
# Check if some IPv6 address is properly formatted
sub check_ip6address
{
local($ip6);
$ip6 = $_[0];
$ip6 = &expand_ip6($ip6);
return ($ip6 =~ /^([\da-f]{1,4}:){7}([\da-f]{1,4})$/i);
}
sub time_unit_choice
{
local ($name, $value) = @_;
return &ui_select($name, $value =~ /^(S?)$/i ? "" :
$value =~ /M/i ? "M" :
$value =~ /H/i ? "H" :
$value =~ /D/i ? "D" :
$value =~ /W/i ? "W" : $value,
[ [ "", $text{'seconds'} ],
[ "M", $text{'minutes'} ],
[ "H", $text{'hours'} ],
[ "D", $text{'days'} ],
[ "W", $text{'weeks'} ] ], 1, 0, 1);
}
sub extract_time_units
{
local(@ret);
foreach $j (@_) {
if ($j =~ /^(\d+)([SMHDW]?)$/is) {
push(@ret, $2); $j = $1;
}
}
return @ret;
}
sub email_to_dotted
{
local $v = $_[0];
$v =~ s/\.$//;
if ($v =~ /^([^.]+)\@(.*)$/) {
return "$1.$2.";
}
elsif ($v =~ /^(.*)\@(.*)$/) {
local ($u, $d) = ($1, $2);
$u =~ s/\./\\\./g;
return "\"$u.$d.\"";
}
else {
return $v;
}
}
sub dotted_to_email
{
local $v = $_[0];
if ($v ne ".") {
$v =~ s/([^\\])\./$1\@/;
$v =~ s/\\\./\./g;
$v =~ s/\.$//;
}
return $v;
}
# set_ownership(file)
# Sets the BIND ownership and permissions on some file
sub set_ownership
{
local ($user, $group, $perms);
if ($config{'file_owner'}) {
($user, $group) = split(/:/, $config{'file_owner'});
}
if ($config{'file_perms'}) {
$perms = oct($config{'file_perms'});
}
&set_ownership_permissions($user, $group, $perms, $_[0]);
}
if ($bind_version >= 9) {
@cat_list = ( 'default', 'general', 'database', 'security', 'config',
'resolver', 'xfer-in', 'xfer-out', 'notify', 'client',
'unmatched', 'network', 'update', 'queries', 'dispatch',
'dnssec', 'lame-servers' );
}
else {
@cat_list = ( 'default', 'config', 'parser', 'queries',
'lame-servers', 'statistics', 'panic', 'update',
'ncache', 'xfer-in', 'xfer-out', 'db',
'eventlib', 'packet', 'notify', 'cname', 'security',
'os', 'insist', 'maintenance', 'load', 'response-checks');
}
@syslog_levels = ( 'kern', 'user', 'mail', 'daemon', 'auth', 'syslog',
'lpr', 'news', 'uucp', 'cron', 'authpriv', 'ftp',
'local0', 'local1', 'local2', 'local3',
'local4', 'local5', 'local6', 'local7' );
@severities = ( 'critical', 'error', 'warning', 'notice', 'info',
'debug', 'dynamic' );
# can_edit_view(&view | &viewcache)
# Returns 1 if some view can be edited
sub can_edit_view
{
local %vcan;
local $vn = $_[0]->{'members'} ? $_[0]->{'value'} : $_[0]->{'name'};
if ($access{'vlist'} eq '*') {
return 1;
}
elsif ($access{'vlist'} =~ /^\!/) {
foreach (split(/\s+/, $access{'vlist'})) {
return 0 if ($_ eq $vn);
}
return 1;
}
else {
foreach (split(/\s+/, $access{'vlist'})) {
return 1 if ($_ eq $vn);
}
return 0;
}
}
# wrap_lines(text, width)
# Given a multi-line string, return an array of lines wrapped to
# the given width
sub wrap_lines
{
local $rest = $_[0];
local @rv;
while(length($rest) > $_[1]) {
push(@rv, substr($rest, 0, $_[1]));
$rest = substr($rest, $_[1]);
}
push(@rv, $rest) if ($rest ne '');
return @rv;
}
# add_zone_access(domain)
# Add a new zone to the current user's access list
sub add_zone_access
{
if ($access{'zones'} ne '*' && $access{'zones'} !~ /^\!/) {
$access{'zones'} = join(" ", &unique(
split(/\s+/, $access{'zones'}), $_[0]));
&save_module_acl(\%access);
}
}
# is_config_valid()
sub is_config_valid
{
local $conf = &get_config();
local ($opts, $dir);
if (($opts = &find("options", $conf)) &&
($dir = &find("directory", $opts->{'members'})) &&
!(-d &make_chroot($dir->{'value'}))) {
return 0;
}
return 1;
}
# check_bind_8()
# Returns the --help output if non BIND 8/9, or undef if is
sub check_bind_8
{
local $fflag = $gconfig{'os_type'} eq 'windows' ? '-f' : '';
local $out = `$config{'named_path'} -help $fflag 2>&1`;
return $out !~ /\[-f\]/ && $out !~ /\[-f\|/ ? $out : undef;
}
# get_chroot()
# Returns the chroot directory BIND is running under
sub get_chroot
{
if (!defined($get_chroot_cache)) {
if ($config{'auto_chroot'}) {
local $out = `$config{'auto_chroot'} 2>/dev/null`;
if (!$?) {
$out =~ s/\r|\n//g;
$get_chroot_cache = $out || "";
}
}
if (!defined($get_chroot_cache)) {
$get_chroot_cache = $config{'chroot'};
}
}
return $get_chroot_cache;
}
# make_chroot(file, [is-pid])
# Given a path that is relative to the chroot directory, return the real path
sub make_chroot
{
local $chroot = &get_chroot();
return $_[0] if (!$chroot);
return $_[0] if ($_[0] eq $config{'named_conf'} && $config{'no_chroot'});
return $_[0] if ($_[0] eq $config{'rndc_conf'}); # don't chroot rndc.conf
if ($config{'no_pid_chroot'} && $_[1]) {
return $_[0];
}
return $chroot.$_[0];
}
# has_ndc(exclude-mode)
# Returns 2 if rndc is installed, 1 if ndc is instaled, or 0
sub has_ndc
{
if ($config{'rndc_cmd'} =~ /^(\S+)/ && &has_command("$1") && $_[0] != 2) {
return 2;
}
if ($config{'ndc_cmd'} =~ /^(\S+)/ && &has_command("$1") && $_[0] != 1) {
return 1;
}
return 0;
}
# get_pid_file([no-cache])
# Returns the BIND pid file path, relative to any chroot
sub get_pid_file
{
if ($_[0] || !-r $zone_names_cache) {
# Read real config
local $conf = &get_config();
local ($opts, $pidopt);
if (($opts = &find("options", $conf)) &&
($pidopt = &find("pid-file", $opts->{'members'}))) {
# read from PID file
local $pidfile = $pidopt->{'value'};
if ($pidfile !~ /^\//) {
local $dir = &find("directory", $opts->{'members'});
$pidfile = $dir->{'value'}."/".$pidfile;
}
return $pidfile;
}
# use default file
local $p;
foreach $p (split(/\s+/, $config{'pid_file'})) {
if (-r &make_chroot($p, 1)) {
return $p;
}
}
return "/var/run/named.pid";
}
else {
# Use cache if possible
local %znc;
&read_file_cached($zone_names_cache, \%znc);
if ($znc{'pidfile'} && -r $znc{'pidfile'}) {
return $znc{'pidfile'};
}
else {
return &get_pid_file(1);
}
}
}
# can_edit_type(record-type)
sub can_edit_type
{
return 1 if (!$access{'types'});
local $t;
foreach $t (split(/\s+/, $access{'types'})) {
return 1 if (lc($t) eq lc($_[0]));
}
return 0;
}
# add_to_file()
# Returns the filename to which new zones should be added (possibly relative to
# a chroot directory)
sub add_to_file
{
if ($config{'zones_file'}) {
local $conf = &get_config();
local $f;
foreach $f (&get_all_config_files($conf)) {
if (&same_file($f, $config{'zones_file'})) {
return $config{'zones_file'};
}
}
}
return $config{'named_conf'};
}
# get_all_config_files(&conf)
# Returns a list of all config files used by named.conf, including includes
sub get_all_config_files
{
local ($conf) = @_;
local @rv = ( $config{'named_conf'} );
foreach my $c (@$conf) {
push(@rv, $c->{'file'});
if ($c->{'type'} == 1) {
push(@rv, &get_all_config_files($c->{'members'}));
}
}
return &unique(@rv);
}
# free_address_button(name)
sub free_address_button
{
return &popup_window_button("free_chooser.cgi", 200, 500, 1,
[ [ "ifield", $_[0] ] ]);
}
# create_slave_zone(name, master-ip, [view], [file], [&other-ips])
# A convenience function for creating a new slave zone, if it doesn't exist
# yet. Mainly useful for Virtualmin, to avoid excessive transfer of BIND
# configuration data.
# Returns 0 on success, 1 if BIND is not setup, 2 if the zone already exists,
# or 3 if the view doesn't exist, or 4 if the slave file couldn't be created
sub create_slave_zone
{
local $parent = &get_config_parent();
local $conf = $parent->{'members'};
local $opts = &find("options", $conf);
if (!$opts) {
return 1;
}
# Check if exists in the view
if ($_[2]) {
local ($v) = grep { $_->{'value'} eq $_[2] } &find("view", $conf);
@zones = &find("zone", $v->{'members'});
}
else {
@zones = &find("zone", $conf);
}
local ($z) = grep { $_->{'value'} eq $_[0] } @zones;
return 2 if ($z);
# Create it
local @mips = ( $_[1], @{$_[4]} );
local $masters = { 'name' => 'masters',
'type' => 1,
'members' => [ map { { 'name' => $_ } } @mips ] };
local $dir = { 'name' => 'zone',
'values' => [ $_[0] ],
'type' => 1,
'members' => [ { 'name' => 'type',
'values' => [ 'slave' ] },
$masters
]
};
local $base = $config{'slave_dir'} || &base_directory();
if ($base !~ /^([a-z]:)?\//) {
# Slave dir is relative .. make absolute
$base = &base_directory()."/".$base;
}
local $file;
if (!$_[3]) {
# File has default name and is under default directory
$file = &automatic_filename($_[0], $_[0] =~ /in-addr/i ? 1 : 0, $base,
$_[2]);
push(@{$dir->{'members'}}, { 'name' => 'file',
'values' => [ $file ] } );
}
elsif ($_[3] ne "none") {
# File was specified
$file = $_[3] =~ /^\// ? $_[3] : $base."/".$_[3];
push(@{$dir->{'members'}}, { 'name' => 'file',
'values' => [ $file ] } );
}
# Create the slave file, so that BIND can write to it
if ($file) {
&open_tempfile(ZONE, ">".&make_chroot($file), 1, 1) || return 4;
&close_tempfile(ZONE);
&set_ownership(&make_chroot($file));
}
# Get and validate view(s)
local @views;
if ($_[2]) {
foreach my $vn (split(/\s+/, $_[2])) {
my ($view) = grep { $_->{'value'} eq $vn }
&find("view", $conf);
push(@views, $view);
}
return 3 if (!@views);
}
else {
# Top-level only
push(@views, undef);
}
# Create the zone in all views
foreach my $view (@views) {
&create_zone($dir, $conf, $view ? $view->{'index'} : undef);
}
return 0;
}
# delete_zone(name, [view], [file-too])
# Delete one zone from named.conf
# Returns 0 on success, 1 if the zone was not found, or 2 if the view was not found.
sub delete_zone
{
local $parent = &get_config_parent();
local $conf = $parent->{'members'};
local @zones;
if ($_[1]) {
# Look in one or more views
foreach my $vn (split(/\s+/, $_[1])) {
local ($v) = grep { $_->{'value'} eq $vn }
&find("view", $conf);
if ($v) {
push(@zones, &find("zone", $v->{'members'}));
}
}
return 2 if (!@zones);
$parent = $v;
}
else {
# Look in all views
push(@zones, &find("zone", $conf));
foreach my $v (&find("view", $conf)) {
push(@zones, &find("zone", $v->{'members'}));
}
}
# Delete all zones in the list
local $found = 0;
foreach my $z (grep { $_->{'value'} eq $_[0] } @zones) {
$found++;
# Remove from config file
&lock_file($z->{'file'});
&save_directive($z->{'parent'} || $parent, [ $z ], [ ]);
&unlock_file($z->{'file'});
&flush_file_lines();
if ($_[2]) {
# Remove file
local $f = &find("file", $z->{'members'});
if ($f) {
&unlink_logged(&make_chroot(
&absolute_path($f->{'value'})));
}
}
}
&flush_zone_names();
return $found ? 0 : 1;
}
# rename_zone(oldname, newname, [view])
# Changes the name of some zone, and perhaps it's file
# Returns 0 on success, 1 if the zone was not found, or 2 if the view was
# not found.
sub rename_zone
{
local $parent = &get_config_parent();
local $conf = $parent->{'members'};
local @zones;
if ($_[2]) {
# Look in one view
local ($v) = grep { $_->{'value'} eq $_[2] } &find("view", $conf);
return 2 if (!$v);
@zones = &find("zone", $v->{'members'});
$parent = $v;
}
else {
# Look in all views
@zones = &find("zone", $conf);
local $v;
foreach $v (&find("view", $conf)) {
push(@zones, &find("zone", $v->{'members'}));
}
}
local ($z) = grep { $_->{'value'} eq $_[0] } @zones;
return 1 if (!$z);
$z->{'values'} = [ $_[1] ];
local $file = &find("file", $z->{'members'});
if ($file) {
# Update the file too
local $newfile = $file->{'values'}->[0];
$newfile =~ s/$_[0]/$_[1]/g;
if ($newfile ne $file->{'values'}->[0]) {
rename(&make_chroot($file->{'values'}->[0]),
&make_chroot($newfile));
$file->{'values'}->[0] = $newfile;
}
}
&save_directive($parent, [ $z ], [ $z ]);
&flush_file_lines();
return 0;
}
# restart_bind()
# A convenience function for re-starting BIND. Returns undef on success, or
# an error message on failure.
sub restart_bind
{
if ($config{'restart_cmd'} eq 'restart') {
# Stop and start again
&stop_bind();
return &start_bind();
}
elsif ($config{'restart_cmd'}) {
# Custom command
local $out = &backquote_logged("$config{'restart_cmd'} 2>&1 $out");
}
}
else {
# Use signal
local $pidfile = &get_pid_file();
local $pid = &check_pid_file(&make_chroot($pidfile, 1));
if (!$pid) {
return &text('restart_epidfile', $pidfile);
}
elsif (!&kill_logged('HUP', $pid)) {
return &text('restart_esig', $pid, $!);
}
}
return undef;
}
# start_bind()
# Attempts to start the BIND DNS server, and returns undef on success or an
# error message on failure
sub start_bind
{
local $chroot = &get_chroot();
local $user;
local $cmd;
if ($config{'named_user'}) {
$user = "-u $config{'named_user'}";
if (&get_bind_version() < 9) {
# Only version 8 takes the -g flag
if ($config{'named_group'}) {
$user .= " -g $config{'named_group'}";
}
else {
local @u = getpwnam($config{'named_user'});
local @g = getgrgid($u[3]);
$user .= " -g $g[0]";
}
}
}
if ($config{'start_cmd'}) {
$cmd = $config{'start_cmd'};
}
elsif (!$chroot) {
$cmd = "$config{'named_path'} -c $config{'named_conf'} $user &1";
}
elsif (`$config{'named_path'} -help 2>&1` =~ /\[-t/) {
# use named's chroot option
$cmd = "$config{'named_path'} -c $config{'named_conf'} -t $chroot $user &1";
}
else {
# use the chroot command
$cmd = "chroot $chroot $config{'named_path'} -c $config{'named_conf'} $user &1";
}
local $temp = &transname();
local $rv = &system_logged("$cmd $temp 2>&1");
local $out = `cat $temp`;
unlink($temp);
if ($rv || $out =~ /chroot.*not available/i) {
return &text('start_error', $out ? "$out" : "Unknown error");
}
return undef;
}
# stop_bind()
# Kills the running DNS server, and returns undef on success or an error message
# upon failure
sub stop_bind
{
if ($config{'stop_cmd'}) {
# Just use a command
local $out = &backquote_logged("($config{'stop_cmd'}) 2>&1");
if ($?) {
return "$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();
local $rv = &check_pid_file(&make_chroot($pidfile, 1));
if (!$rv && $gconfig{'os_type'} eq 'windows') {
# Fall back to checking for process
$rv = &find_byname("named");
}
return $rv;
}
# 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 =
for use
# in ui_print_header
sub restart_links
{
local ($zone) = @_;
local @rv;
if (!$access{'ro'} && ($access{'apply'} == 1 || $access{'apply'} == 3)) {
local $r = $ENV{'REQUEST_METHOD'} eq 'POST' ? 0 : 1;
if (&is_bind_running()) {
if ($zone) {
push(@rv, "{'index'}'>".
"$text{'links_apply'}");
}
push(@rv, "".
"$text{'links_restart'}");
if ($access{'apply'} == 1) {
push(@rv, "".
"$text{'links_stop'}");
}
}
elsif ($access{'apply'} == 1) {
push(@rv, "".
"$text{'links_start'}");
}
}
return join('
', @rv);
}
# supports_dnssec()
# Returns 1 if zone signing is supported
sub supports_dnssec
{
return &has_command($config{'signzone'}) &&
&has_command($config{'keygen'});
}
# supports_dnssec_client()
# Returns 2 if this BIND can send and verify DNSSEC requests, 1 if the
# dnssec-validation directive is not supported, 0 otherwise
sub supports_dnssec_client
{
return $bind_version >= 9.4 ? 2 :
$bind_version >= 9 ? 1 : 0;
}
# dnssec_size_range(algorithm)
# Given an algorithm like DSA or DH, return the max and min allowed key sizes,
# and an optional forced divisor.
sub dnssec_size_range
{
local ($alg) = @_;
return $alg eq 'RSAMD5' || $alg eq 'RSASHA1' ? ( 512, 2048 ) :
$alg eq 'DH' ? ( 128, 4096 ) :
$alg eq 'DSA' ? ( 512, 1024, 64 ) :
$alg eq 'HMAC-MD5' ? ( 1, 512 ) : ( );
}
sub list_dnssec_algorithms
{
return ("DSA", "RSAMD5", "RSASHA1", "DH", "HMAC-MD5");
}
# create_dnssec_key(&zone|&zone-name, algorithm, size, single-key)
# Creates a new DNSSEC key for some zone, and places it in the same directory
# as the zone file. Returns undef on success or an error message on failure.
sub create_dnssec_key
{
local ($z, $alg, $size, $single) = @_;
local $fn = &get_zone_file($z, 2);
$fn || return "Could not work out records file!";
$fn =~ s/\/[^\/]+$//;
# Remove all keys for the same zone
opendir(ZONEDIR, $fn);
foreach my $f (readdir(ZONEDIR)) {
if ($f =~ /^K\Q$dom\E\.\+(\d+)\+(\d+)\.(key|private)$/) {
&unlink_file("$fn/$f");
}
}
closedir(ZONEDIR);
# Fork a background job to do lots of IO, to generate entropy
local $pid = fork();
if (!$pid) {
exec("find / -type f >/dev/null 2>&1");
exit(1);
}
# Work out zone key size
local $zonesize;
if ($single) {
(undef, $zonesize) = &compute_dnssec_key_size($alg, 1);
}
else {
$zonesize = $size;
}
# Create the zone key
local $dom = $z->{'members'} ? $z->{'values'}->[0] : $z->{'name'};
local $out = &backquote_logged(
"cd ".quotemeta($fn)." && ".
"$config{'keygen'} -a ".quotemeta($alg)." -b ".quotemeta($zonesize).
" -n ZONE $dom 2>&1");
if ($?) {
kill('KILL', $pid);
return $out;
}
# Create the key signing key, if needed
if (!$single) {
$out = &backquote_logged(
"cd ".quotemeta($fn)." && ".
"$config{'keygen'} -a ".quotemeta($alg)." -b ".quotemeta($size).
" -n ZONE -f KSK $dom 2>&1");
kill('KILL', $pid);
if ($?) {
return $out;
}
}
else {
kill('KILL', $pid);
}
# Get the new keys
local @keys = &get_dnssec_key($z);
@keys || return "No new keys found for zone : $out";
foreach my $key (@keys) {
ref($key) || return "Failed to get new key for zone : $key";
}
if (!$single) {
@keys == 2 || return "Expected 2 keys for zone, but found ".
scalar(@keys);
}
# Add the new DNSKEY record(s) to the zone
local $chrootfn = &get_zone_file($z);
local @recs = &read_zone_file($chrootfn, $dom);
for(my $i=$#recs; $i>=0; $i--) {
if ($recs[$i]->{'type'} eq 'DNSKEY') {
&delete_record($chrootfn, $recs[$i]);
}
}
foreach my $key (@keys) {
&create_record($chrootfn, $dom.".", undef, "IN", "DNSKEY",
join(" ", @{$key->{'values'}}));
}
&bump_soa_record($chrootfn, \@recs);
return undef;
}
# resign_dnssec_key(&zone|&zone-name)
# Re-generate the zone key, and re-sign everything. Returns undef on success or
# an error message on failure.
sub resign_dnssec_key
{
local ($z) = @_;
local $fn = &get_zone_file($z);
$fn || return "Could not work out records file!";
local $dir = $fn;
$dir =~ s/\/[^\/]+$//;
local $dom = $z->{'members'} ? $z->{'values'}->[0] : $z->{'name'};
# Get the old zone key record
local @recs = &read_zone_file($fn, $dom);
local $zonerec;
foreach my $r (@recs) {
if ($r->{'type'} eq 'DNSKEY' && $r->{'values'}->[0] % 2 == 0) {
$zonerec = $r;
}
}
$zonerec || return "Could not find DNSSEC zone key record";
local @keys = &get_dnssec_key($z);
@keys == 2 || return "Expected to find 2 keys, but found ".scalar(@keys);
local ($zonekey) = grep { !$_->{'ksk'} } @keys;
$zonekey || return "Could not find DNSSEC zone key";
# Fork a background job to do lots of IO, to generate entropy
local $pid = fork();
if (!$pid) {
exec("find / -type f >/dev/null 2>&1");
exit(1);
}
# Work out zone key size
local $zonesize;
local $alg = $zonekey->{'algorithm'};
(undef, $zonesize) = &compute_dnssec_key_size($alg, 1);
# Generate a new zone key
local $out = &backquote_logged(
"cd ".quotemeta($dir)." && ".
"$config{'keygen'} -a ".quotemeta($alg)." -b ".quotemeta($zonesize).
" -n ZONE $dom 2>&1");
kill('KILL', $pid);
if ($?) {
return "Failed to generate new zone key : $out";
}
# Delete the old key file
&unlink_file($zonekey->{'privatefile'});
&unlink_file($zonekey->{'publicfile'});
# Update the zone file with the new key
@keys = &get_dnssec_key($z);
local ($newzonekey) = grep { !$_->{'ksk'} } @keys;
$newzonekey || return "Could not find new DNSSEC zone key";
&modify_record($fn, $zonerec, $dom.".", undef, "IN", "DNSKEY",
join(" ", @{$newzonekey->{'values'}}));
&bump_soa_record($fn, \@recs);
# Re-sign everything
local $err = &sign_dnssec_zone($z);
return "Re-signing failed : $err" if ($err);
return undef;
}
# delete_dnssec_key(&zone|&zone-name)
# Deletes the key for a zone, and all DNSSEC records
sub delete_dnssec_key
{
local ($z) = @_;
local $fn = &get_zone_file($z);
$fn || return "Could not work out records file!";
local $dom = $z->{'members'} ? $z->{'values'}->[0] : $z->{'name'};
# Remove the key
local @keys = &get_dnssec_key($z);
foreach my $key (@keys) {
foreach my $f ('publicfile', 'privatefile') {
&unlink_file($key->{$f}) if ($key->{$f});
}
}
# Remove records
local @recs = &read_zone_file($fn, $dom);
for(my $i=$#recs; $i>=0; $i--) {
if ($recs[$i]->{'type'} eq 'NSEC' ||
$recs[$i]->{'type'} eq 'RRSIG' ||
$recs[$i]->{'type'} eq 'DNSKEY') {
&delete_record($fn, $recs[$i]);
}
}
&bump_soa_record($fn, \@recs);
}
# sign_dnssec_zone(&zone|&zone-name, [bump-soa])
# Replaces a zone's file with one containing signed records.
sub sign_dnssec_zone
{
local ($z, $bump) = @_;
local $chrootfn = &get_zone_file($z, 2);
$chrootfn || return "Could not work out records file!";
$chrootfn =~ /^(.*)\/([^\/]+$)/;
local ($dir, $zf) = ($1, $2);
local $dom = $z->{'members'} ? $z->{'values'}->[0] : $z->{'name'};
local $signed = $chrootfn.".webmin-signed";
# Up the serial number, if requested
local $fn = &get_zone_file($z, 1);
$fn =~ /^(.*)\/([^\/]+$)/;
local @recs = &read_zone_file($fn, $dom);
if ($bump) {
&bump_soa_record($fn, \@recs);
}
# Create the signed file. Sometimes this fails with an error like :
# task.c:310: REQUIRE(task->references > 0) failed
# But re-trying works!?!
local $out;
local $tries = 0;
while($tries++ < 10) {
$out = &backquote_logged(
"cd ".quotemeta($dir)." && ".
"$config{'signzone'} -o ".quotemeta($dom).
" -f ".quotemeta($signed)." ".
quotemeta($zf)." 2>&1");
last if (!$?);
}
return $out if ($tries >= 10);
# Merge records back into original file, by deleting all NSEC and RRSIG records
# and then copying over
for(my $i=$#recs; $i>=0; $i--) {
if ($recs[$i]->{'type'} eq 'NSEC' ||
$recs[$i]->{'type'} eq 'RRSIG') {
&delete_record($fn, $recs[$i]);
}
}
local @signedrecs = &read_zone_file($fn.".webmin-signed", $dom);
foreach my $r (@signedrecs) {
if ($r->{'type'} eq 'NSEC' ||
$r->{'type'} eq 'RRSIG') {
&create_record($fn, $r->{'name'}, $r->{'ttl'}, $r->{'class'},
$r->{'type'}, join(" ", @{$r->{'values'}}),
$r->{'comment'});
}
}
&unlink_file($signed);
return undef;
}
# sign_dnssec_zone_if_key(&zone|&zone-name, &recs, [bump-soa])
# If a zone has a DNSSEC key, sign it. Calls error if signing fails
sub sign_dnssec_zone_if_key
{
local ($z, $recs, $bump) = @_;
local $keyrec = &get_dnskey_record($z, $recs);
if ($keyrec) {
local $err = &sign_dnssec_zone($z, $bump);
&error(&text('sign_emsg', $err)) if ($err);
}
}
# get_dnssec_key(&zone|&zone-name)
# Returns a list of hash containing details of a zone's keys, or an error
# message. The KSK is always returned first.
sub get_dnssec_key
{
local ($z) = @_;
local $fn = &get_zone_file($z, 1);
$fn || return ("Could not work out records file!");
$fn =~ /^(.*)\/([^\/]+$)/;
local ($chrootdir, $zf) = ($1, $2);
local $dir = &make_chroot($chrootdir);
local $dom = $z->{'members'} ? $z->{'values'}->[0] : $z->{'name'};
local %keymap;
opendir(ZONEDIR, $dir);
foreach my $f (readdir(ZONEDIR)) {
if ($f =~ /^K\Q$dom\E\.\+(\d+)\+(\d+)\.key$/) {
# Found the public key file .. read it
$keymap{$2} ||= { };
local $rv = $keymap{$2};
$rv->{'publicfile'} = "$dir/$f";
$rv->{'algorithmid'} = $1;
$rv->{'keyid'} = $2;
local $config{'short_names'} = 0; # Force canonicalization
local ($pub) = &read_zone_file("$chrootdir/$f", $dom);
$pub || return "Public key file $dir/$f does not contain ".
"any records";
$pub->{'name'} eq $dom."." ||
return "Public key file $dir/$f is not for zone $dom";
$pub->{'type'} eq "DNSKEY" ||
return "Public key file $dir/$f does not contain ".
"a DNSKEY record";
$rv->{'ksk'} = $pub->{'values'}->[0] % 2 ? 1 : 0;
$rv->{'public'} = $pub->{'values'}->[3];
$rv->{'values'} = $pub->{'values'};
$rv->{'publictext'} = &read_file_contents("$dir/$f");
}
elsif ($f =~ /^K\Q$dom\E\.\+(\d+)\+(\d+)\.private$/) {
# Found the private key file
$keymap{$2} ||= { };
local $rv = $keymap{$2};
$rv->{'privatefile'} = "$dir/$f";
local $lref = &read_file_lines("$dir/$f", 1);
foreach my $l (@$lref) {
if ($l =~ /^(\S+):\s*(.*)/) {
local ($n, $v) = ($1, $2);
$n =~ s/\(\S+\)$//;
$n = lc($n);
$rv->{$n} = $v;
}
}
$rv->{'algorithm'} =~ s/^\d+\s+\((\S+)\)$/$1/;
$rv->{'privatetext'} = join("\n", @$lref)."\n";
}
}
closedir(ZONEDIR);
# Sort to put KSK first
local @rv = values %keymap;
@rv = sort { $b->{'ksk'} <=> $a->{'ksk'} } @rv;
return wantarray ? @rv : $rv[0];
}
# compute_dnssec_key_size(algorithm, def-mode, size)
# Given an algorith and size mode (0=entered, 1=average, 2=big), returns either
# 0 and an error message or 1 and the corrected size
sub compute_dnssec_key_size
{
local ($alg, $def, $size) = @_;
local ($min, $max, $factor) = &dnssec_size_range($alg);
local $rv;
if ($def == 1) {
# Average
$rv = int(($max + $min) / 2);
if ($factor) {
$rv = int($rv / $factor) * $factor;
}
}
elsif ($def == 2) {
# Max allowed
$rv = $max;
}
else {
$size =~ /^\d+$/ && $size >= $min && $size <= $max ||
return (0, &text('zonekey_esize', $min, $max));
if ($factor && $size % $factor) {
return (0, &text('zonekey_efactor', $factor));
}
$rv = $size;
}
return (1, $rv);
}
# get_dnssec_cron_job()
# Returns the cron job object for re-signing DNSSEC domains
sub get_dnssec_cron_job
{
&foreign_require("cron", "cron-lib.pl");
local ($job) = grep { $_->{'user'} eq 'root' &&
$_->{'command'} =~ /^\Q$dnssec_cron_cmd\E/ }
&cron::list_cron_jobs();
return $job;
}
1;
bind8/config-slackware-linux-8.0-* 0000664 0005671 0000012 00000001312 11137650373 016500 0 ustar jcameron wheel soa_style=0
named_path=/usr/sbin/named
named_conf=/etc/named.conf
show_list=0
records_order=0
max_zones=50
rev_def=0
support_aaaa=0
allow_comments=0
allow_wild=1
allow_long=0
master_ttl=1
whois_cmd=whois
pid_file=/var/run/named/named.pid
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
checkzone=named-checkzone
keygen=dnssec-keygen
signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
bind8/save_master.cgi 0000755 0005671 0000012 00000002005 11137650373 014545 0 ustar jcameron wheel #!/usr/local/bin/perl
# save_master.cgi
# Save changes to master zone options in named.conf
require './bind8-lib.pl';
&ReadParse();
$conf = &get_config();
if ($in{'view'} ne '') {
$view = $conf->[$in{'view'}];
$conf = $view->{'members'};
$indent = 2;
}
else {
$indent = 1;
}
$zconf = $conf->[$in{'index'}];
&lock_file(&make_chroot($zconf->{'file'}));
&error_setup($text{'master_err'});
&can_edit_zone($zconf, $view) ||
&error($text{'master_ecannot'});
$access{'ro'} && &error($text{'master_ero'});
$access{'opts'} || &error($text{'master_eoptscannot'});
&save_choice("check-names", $zconf, $indent);
&save_choice("notify", $zconf, $indent);
&save_address("allow-update", $zconf, $indent);
&save_address("allow-transfer", $zconf, $indent);
&save_address("allow-query", $zconf, $indent);
&save_address("also-notify", $zconf, $indent);
&flush_file_lines();
&unlock_file(&make_chroot($zconf->{'file'}));
&webmin_log("opts", undef, $zconf->{'value'}, \%in);
&redirect("edit_master.cgi?index=$in{'index'}&view=$in{'view'}");
bind8/conf_ncheck.cgi 0000775 0005671 0000012 00000001257 11137650373 014506 0 ustar jcameron wheel #!/usr/local/bin/perl
# Check the whole BIND config and report problems
require './bind8-lib.pl';
&ReadParse();
$access{'defaults'} || &error($text{'ncheck_ecannot'});
&ui_print_header(undef, $text{'ncheck_title'}, "",
undef, undef, undef, undef, &restart_links());
$file = &make_chroot($config{'named_conf'});
@errs = &check_bind_config();
if (@errs) {
# Show list of errors
print "",&text('ncheck_errs', "$file"),"\n";
foreach my $e (@errs) {
print "
\n";
}
else {
# All OK!
print "",&text('ncheck_allok', "$file"),"
\n";
}
print &ui_form_start("save_trusted.cgi");
print &ui_table_start($text{'trusted_header'}, undef, 4);
# DNSSEC enabled?
print &choice_input($text{'trusted_dnssec'}, 'dnssec-enable', $mems,
$text{'yes'}, 'yes', $text{'no'}, 'no',
$text{'default'}, undef);
if (&supports_dnssec_client() == 2) {
print &choice_input($text{'trusted_validation'},
'dnssec-validation', $mems,
$text{'yes'}, 'yes', $text{'no'}, 'no',
$text{'default'}, undef);
}
print &ui_table_hr();
# Trusted DLVs
@dtable = ( );
$i = 0;
foreach $d (@dlv, { 'values' => [ '.' ] }) {
$dlv = $d->{'values'}->[0];
$dlv = "" if ($dlv eq ".");
push(@dtable, [ &ui_opt_textbox("anchor_$i", $d->{'values'}->[2],
30, $text{'trusted_none'}),
&ui_opt_textbox("dlv_$i", $dlv, 20,
$text{'trusted_root'}) ]);
$i++;
}
print &ui_table_row($text{'trusted_dlvs'},
&ui_columns_table([ $text{'trusted_anchor'}, $text{'trusted_dlv'} ],
undef,
\@dtable), 3);
# Trusted keys
@ktable = ( );
$i = 0;
foreach $k (@{$tkeys->{'members'}}, { }) {
@v = @{$k->{'values'}};
@wrapped = ( );
while(length($v[3]) > 30) {
push(@wrapped, substr($v[3], 0, 30));
$v[3] = substr($v[3], 30);
}
push(@wrapped, $v[3]);
push(@ktable, [ &ui_opt_textbox("zone_$i", $k->{'name'}, 20,
$text{'trusted_none'}),
&ui_textbox("flags_$i", $v[0], 6),
&ui_textbox("proto_$i", $v[1], 6),
&ui_textbox("alg_$i", $v[2], 6),
&ui_textarea("key_$i", join("\n", @wrapped), 4, 32) ]);
$i++;
}
print &ui_table_row($text{'trusted_keys'},
&ui_columns_table([ $text{'trusted_zone'}, $text{'trusted_flags'},
$text{'trusted_proto'}, $text{'trusted_alg'},
$text{'trusted_key'} ],
undef,
\@ktable), 3);
print &ui_table_end();
print &ui_form_end([ [ undef, $text{'save'} ] ]);
&ui_print_footer("", $text{'index_return'});
bind8/config.info.zh_TW.Big5 0000644 0005671 0000012 00000000446 11137650373 015515 0 ustar jcameron wheel named_conf= named.conf ɮת|,0
named_path= named ɪ|,0
show_list=ܤ覡,1,0-ϥ,1-C
soa_style=Ǹ˦,1,0-W,1-H¦ (YYYYMMDDnn)
records_order=ܬƦC,1,1-̾ڦW,2-̾ڼƭ,0-̾ڼW[ɶ
chroot=Chroot |H BIND,3,Default
bind8/edit_soa.cgi 0000755 0005671 0000012 00000004601 11137650373 014027 0 ustar jcameron wheel #!/usr/local/bin/perl
# edit_soa.cgi
# Display the SOA for an existing master zone
require './bind8-lib.pl';
&ReadParse();
$zone = &get_zone_name($in{'index'}, $in{'view'});
$dom = $zone->{'name'};
&can_edit_zone($zone) ||
&error($text{'master_ecannot'});
$access{'params'} || &error($text{'master_esoacannot'});
$desc = &ip6int_to_net(&arpa_to_ip($dom));
&ui_print_header($desc, $text{'master_params'}, "",
undef, undef, undef, undef, &restart_links($zone));
@recs = &read_zone_file($zone->{'file'}, $dom);
foreach $r (@recs) {
$soa = $r if ($r->{'type'} eq "SOA");
$defttl = $r if ($r->{'defttl'});
}
$v = $soa->{'values'};
# form for editing SOA record
print &ui_form_start("save_soa.cgi");
print &ui_hidden("num", $soa->{'num'});
print &ui_hidden("origin", $dom);
print &ui_hidden("index", $in{'index'});
print &ui_hidden("view", $in{'view'});
print &ui_table_start($text{'master_params'}, "width=100%", 4);
# Master nameserver
print &ui_table_row($text{'master_server'},
&ui_textbox("master", $v->[0], 30));
# Owner's email address
$v->[1] = &dotted_to_email($v->[1]);
print &ui_table_row($text{'master_email'},
&ui_textbox("email", $v->[1], 30));
# Refresh time
@u = &extract_time_units($v->[3], $v->[4], $v->[5], $v->[6]);
print &ui_table_row($text{'master_refresh'},
&ui_textbox("refresh", $v->[3], 10)." ".
&time_unit_choice("refunit", $u[0]));
# Retry time
print &ui_table_row($text{'master_retry'},
&ui_textbox("retry", $v->[4], 10)." ".
&time_unit_choice("retunit", $u[1]));
# Expiry time
print &ui_table_row($text{'master_expiry'},
&ui_textbox("expiry", $v->[5], 10)." ".
&time_unit_choice("expunit", $u[2]));
# Minimum TTL
print &ui_table_row($text{'master_minimum'},
&ui_textbox("minimum", $v->[6], 10)." ".
&time_unit_choice("minunit", $u[3]));
# Default TTL
$ttl = $defttl->{'defttl'} if ($defttl);
($ttlu) = &extract_time_units($ttl);
print &ui_table_row($text{'master_defttl'},
&ui_radio("defttl_def", $defttl ? 0 : 1,
[ [ 1, $text{'default'} ], [ 0, " " ] ])."\n".
&ui_textbox("defttl", $ttl, 10)." ".
&time_unit_choice("defttlunit", $ttlu), 3);
if (!$config{'updserial_on'}) {
# Serial number
print &ui_table_row($text{'master_serial'},
&ui_textbox("serial", $v->[2], 20));
}
print &ui_table_end();
print &ui_form_end($access{'ro'} ? [ ] : [ [ undef, $text{'save'} ] ]);
&ui_print_footer("edit_master.cgi?index=$in{'index'}&view=$in{'view'}",
$text{'master_return'});
bind8/create_forward.cgi 0000755 0005671 0000012 00000003633 11137650373 015233 0 ustar jcameron wheel #!/usr/local/bin/perl
# create_forward.cgi
# Create a new forward zone
require './bind8-lib.pl';
&ReadParse();
&error_setup($text{'fcreate_err'});
$access{'forward'} || &error($text{'fcreate_ecannot'});
$access{'ro'} && &error($text{'master_ero'});
$conf = &get_config();
if ($in{'view'} ne '') {
$view = $conf->[$in{'view'}];
&can_edit_view($view) || &error($text{'master_eviewcannot'});
$vconf = $view->{'members'};
}
else {
$vconf = $conf;
}
# validate inputs
if ($in{'rev'}) {
local($ipv4);
($ipv4 = &check_net_ip($in{'zone'})) ||
$config{'support_aaaa'} &&
(($in{'zone'} =~ /^([\w:]+)(\/\d+)$/) || &check_ip6address($1)) ||
&error(&text('create_enet', $in{'zone'}));
if ($ipv4) {
$in{'zone'} = &ip_to_arpa($in{'zone'});
}
else {
$in{'zone'} = &net_to_ip6int($1, ($2 ? substr($2, 1) : "" ));
}
}
else {
($in{'zone'} =~ /^[\d\.]+$/ || $in{'zone'} =~ /^[\d\:]+(\/[\d]+)?$/) &&
&error(&text('create_edom2', $in{'zone'}));
&valdnsname($in{'zone'}, 0, ".") ||
&error(&text('create_edom', $in{'zone'}));
}
$in{'zone'} =~ s/\.$//;
@masters = split(/\s+/, $in{'masters'});
foreach $m (@masters) {
&check_ipaddress($m) ||
&error(&text('create_emaster', $m));
}
#if (!@masters) {
# &error($text{'create_enone'});
# }
foreach $z (&find("zone", $vconf)) {
if ($z->{'value'} eq $in{'zone'}) {
&error($text{'master_etaken'});
}
}
# Create structure
@mdirs = map { { 'name' => $_ } } @masters;
$dir = { 'name' => 'zone',
'values' => [ $in{'zone'} ],
'type' => 1,
'members' => [ { 'name' => 'type',
'values' => [ 'forward' ] },
{ 'name' => 'forwarders',
'type' => 1,
'members' => \@mdirs }
]
};
# Create zone directive
&create_zone($dir, $conf, $in{'view'});
&webmin_log("create", "forward", $in{'zone'}, \%in);
# Get the new zone's index
$idx = &get_zone_index($in{'zone'}, $in{'view'});
&add_zone_access($in{'zone'});
&redirect("edit_forward.cgi?index=$idx&view=$in{'view'}");
bind8/records-lib.pl 0000755 0005671 0000012 00000046772 11137650373 014335 0 ustar jcameron wheel # Functions for managing BIND 4 and 8/9 records files
# read_zone_file(file, origin, [previous], [only-soa])
# Reads a DNS zone file and returns a data structure of records. The origin
# must be a domain without the trailing dot, or just .
sub read_zone_file
{
local($file, $lnum, $line, $t, @tok, @lnum, @coms,
$i, @rv, $origin, $num, $j, @inc, @oset, $comment);
$origin = $_[1];
if ($origin ne ".") {
# Remove trailing dots in origin name, as they are added automatically
# in the code below.
$origin =~ s/\.*$//;
}
$file = &absolute_path($_[0]);
local $rootfile = &make_chroot($file);
open(FILE, $rootfile);
$lnum = 0;
local ($gotsoa, $aftersoa);
while($line =
" ],
[ 2, $text{'hcreate_webmin'}."
" ],
[ 3, $text{'hcreate_keep'} ] ]));
# Create in view
@views = grep { &can_edit_view($_) && !$hashint{$_} } @views;
if (@views) {
print &ui_table_row($text{'mcreate_view'},
&ui_select("view", undef,
[ map { [ $_->{'index'}, $_->{'values'}->[0] ] }
@views ]), 3);
}
print &ui_table_end();
print &ui_form_end([ [ undef, $text{'create'} ] ]);
&ui_print_footer("", $text{'index_return'});
bind8/config.info.ru_RU 0000664 0005671 0000012 00000004030 11137650373 014724 0 ustar jcameron wheel named_path= named,0
named_conf= named.conf,0
soa_style= ,1,0- ,1- ()
show_list= ,1,0-,1-
records_order= ,1,1- ,2- ,3- IP,0-
updserial_on= ,1,1-,0-
ndc_cmd= ,0
reversezonefilename_format= ,0
forwardzonefilename_format= forward,0
allow_long= ,1,0-,1-
default_master= () slave,0
default_slave= ,0
named_group=, BIND,3,
master_ttl= $ttl ,1,1-,0-
file_owner= (:),3,
slave_dir= slave/stub,3,
allow_wild= ( ),1,0-,1-
max_zones= ,0
start_cmd= BIND,3,
by_view= ?,1,1-,0-
whois_cmd= whois,0
short_names= ?,1,0-,1-
line0= BIND,11
file_perms= ( ),3,
line1= ,11
allow_comments= ,1,0-,1-
line2= ,11
master_dir= master,3,
chroot= chroot, BIND,3,
line3= ,11
support_aaaa= DNS IPv6,1,0-,1-
rev_def= ,1,0- ,1- ,2-
pid_file= PID ,3,/var/run/named.pid
zones_file= ,3,named.conf
named_user=, BIND,3,
bind8/config-open-linux 0000664 0005671 0000012 00000001364 11137650373 015042 0 ustar jcameron wheel soa_style=0
named_path=/usr/sbin/named
named_conf=/etc/named.conf
show_list=0
records_order=0
start_cmd=/etc/rc.d/init.d/named start
stop_cmd=/etc/rc.d/init.d/named stop
max_zones=50
rev_def=0
support_aaaa=0
allow_comments=0
allow_wild=1
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
checkzone=named-checkzone
keygen=dnssec-keygen
signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
bind8/config-debian-linux 0000664 0005671 0000012 00000001250 11137650373 015315 0 ustar jcameron wheel soa_style=0
named_path=/usr/sbin/named
named_conf=/etc/named.conf
show_list=0
records_order=0
max_zones=50
rev_def=0
support_aaaa=0
allow_comments=0
allow_wild=1
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
checkzone=named-checkzone
keygen=dnssec-keygen
signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
bind8/config.info.bg 0000664 0005671 0000012 00000004515 11137650373 014270 0 ustar jcameron wheel line0=BIND ,11
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-Overwrite by default
rev_must= ?,1,1-,0-
support_aaaa= DNS IPv6 ,1,1-,0-
allow_comments= ,1,1-,0-
allow_wild= wildcards ( ),1,1-,0-
allow_long= ,1,1-,0-
allow_underscore= underscores in record names?,1,1-,0-
short_names= ?,1,0-,1-
by_view= ?,1,1-,0-
line2= ,11
soa_style= ,1,0-Running number,1-Date based (YYYYMMDDnn)
master_ttl= $ttl ,1,1-,0-
master_dir= ,3,
slave_dir= /stub ,3,
forwardzonefilename_format= ,0
reversezonefilename_format= ,0
file_owner= (:),3,
file_perms= (in octal),3,
default_master= (s) ,0
default_slave= ,0
updserial_on= ,1,1-,0-
ipv6_mode= IPv6 ,1,1-ip6.arpa,0-ip6.int
line3= ,11
named_conf= named.conf,0
named_path= named,0
whois_cmd= whois,0
ndc_cmd= zone,0
pid_file= PID ,3,/var/run/named.pid
start_cmd= BIND,3,
stop_cmd= BIND,3,
bind8/edit_zonekey.cgi 0000775 0005671 0000012 00000006124 11137650373 014735 0 ustar jcameron wheel #!/usr/local/bin/perl
# Display the signing key for a zone, or offer to set one up
require './bind8-lib.pl';
&ReadParse();
$zone = &get_zone_name($in{'index'}, $in{'view'});
$dom = $zone->{'name'};
&can_edit_zone($zone) ||
&error($text{'master_ecannot'});
$desc = &ip6int_to_net(&arpa_to_ip($dom));
&ui_print_header($desc, $text{'zonekey_title'}, "",
undef, undef, undef, undef, &restart_links($zone));
# Check if the zone already has a key, from a DNSKEY record
$keyrec = &get_dnskey_record($zone);
if ($keyrec) {
# Tell the user we already have it
$keyline = join(" ", $keyrec->{'name'}, $keyrec->{'class'},
$keyrec->{'type'}, @{$keyrec->{'values'}});
print &text('zonekey_already'),"\n";
print $text{'zonekey_webmin'},"\n";
print "
\n";
print &ui_textarea("keyline", $keyline, 2, 80, "off", 0,
"readonly style='width:90%'"),"
\n";
print &ui_textarea(
"private", $key->{'privatetext'}, 8, 80,
"off", 0, "readonly style='width:90%'");
print &ui_hidden_end();
}
if (!@keys) {
print &text('zonekey_noprivate'),"
" ],
[ 2, $text{'zonekey_strong'}."
"],
[ 0, $text{'zonekey_other'} ] ]).
" ".&ui_textbox("size", undef, 6));
# Number of keys
print &ui_table_row($text{'zonedef_single'},
&ui_radio("single", 0, [ [ 0, $text{'zonedef_two'} ],
[ 1, $text{'zonedef_one'} ] ]));
print &ui_table_end();
print &ui_form_end([ [ undef, $text{'zonekey_enable'} ] ]);
}
&ui_print_footer("edit_master.cgi?index=$in{'index'}&view=$in{'view'}",
$text{'master_return'});
bind8/stub_form.cgi 0000755 0005671 0000012 00000003634 11137650373 014245 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'});
$conf = &get_config();
&ui_print_header(undef, $type ? $text{'screate_title1'}
: $text{'screate_title2'}, "",
undef, undef, undef, undef, &restart_links());
# Start of the form
print &ui_form_start("create_slave.cgi");
print &ui_hidden("type", $type);
print &ui_table_start($type ? $text{'screate_header1'}
: $text{'screate_header2'}, "width=100%", 4);
# Forward or reverse?
print &ui_table_row($text{'screate_type'},
&ui_radio("rev", 0, [ [ 0, $text{'screate_fwd'} ],
[ 1, $text{'screate_rev'} ] ]), 3);
# Domain name
print &ui_table_row($text{'screate_dom'},
&ui_textbox("zone", undef, 60), 3);
# Create in view
@views = &find("view", $conf);
if (@views) {
print &ui_table_row($text{'mcreate_view'},
&ui_select("view", undef,
[ map { [ $_->{'index'}, $_->{'values'}->[0] ] }
grep { &can_edit_view($_) } @views ]), 3);
}
# Zone file
print &ui_table_row($text{'slave_file'},
&ui_radio("file_def", 2, [ [ 1, $text{'slave_none'} ],
[ 2, $text{'slave_auto'} ],
[ 0, &ui_filebox("file", undef, 30) ] ]), 3);
# Master servers
print &ui_table_row($text{'slave_masters'},
&ui_textarea("masters",
join("\n", split(/\s+/, $config{'default_master'})),
4, 30));
# Master port
print &ui_table_row($text{'slave_masterport'},
&ui_opt_textbox("port", undef, 5, $text{'default'},
$text{'slave_master_port'}));
# Create on slave servers?
@servers = grep { $_->{'sec'} } &list_slave_servers();
if (@servers && $access{'remote'}) {
print &ui_table_row($text{'master_onslave'},
&ui_yesno_radio("onslave", 1));
}
print &ui_table_end();
print &ui_form_end([ [ undef, $text{'create'} ] ]);
&ui_print_footer("", $text{'index_return'});
bind8/config.info.ja_JP.UTF-8 0000664 0005671 0000012 00000007751 11137650373 015472 0 ustar jcameron wheel line0=BINDパス,11
chroot=BINDを実行するchrootディレクトリ,3,デフォルト
no_chroot=named.confはchrootディレクトリにありますか,1,0-はい,1-いいえ
auto_chroot=chrootディレクトリを検索するコマンド,3,上記のディレクトリを使用
named_user=BINDを実行するユーザ,3,デフォルト
named_group=BINDを実行するグループ,3,デフォルト
zones_file=新規作成したゾーンを追加するファイル,3,named.conf
relative_paths=named.conf内でゾーンファイルを相対パスで指定する,1,1-はい,0-いいえ
line1=表示オプション,11
show_list=ドメインの表示,1,0-アイコン,1-リスト,2-階層構造
by_view=ゾーンをビューで分類する,1,1-はい,0-いいえ
records_order=レコードの表示順,1,1-名前順,2-量,3-IP,0-作成順
max_zones=表示するゾーンの最大数,0
rev_def=逆引(リバース)の更新,1,0-デフォルトで有効,1-デフォルトで無効,2-デフォルトで上書き
rev_must=逆引ゾーンがありますか?,1,1-はい,0-いいえ
support_aaaa=IPv6アドレスのためのDNSを提供しますか?,1,1-はい,0-いいえ
allow_comments=レコードのコメントを許可する,1,1-はい,0-いいえ
allow_wild=ワイルドカードを許可する(推奨されていません),1,1-はい,0-いいえ
allow_underscore=レコード名にアンダースコア(_)を許可しますか?,1,1-はい,0-いいえ
short_names=レコード名をカノニカルフォームに変換する,1,0-はい,1-いいえ
extra_forward=フォワードゾーン用の特別なレコードタイプ,0
extra_reverse=逆引(リバース)ゾーン用の特別なレコードタイプ,0
largezones=ゾーンにレコードを表示しますか?,1,0-はい,1-いいえ (大きなゾーン用)
line2=ゾーンファイルオプション,11
soa_style=シリアルナンバーの形式,1,0-実行回数,1-日付ベース(YYYYMMDDnn)
soa_start=日付ベースのシリアルナンバの開始番号,0,3
master_ttl=新しいゾーンファイルに $ttl を追加する,1,1-はい,0-いいえ
master_dir=マスタゾーンファイル用のディレクトリ,3,デフォルト
slave_dir=スレーブ/スタブゾーンファイル用のディレクトリ,3,デフォルト
forwardzonefilename_format=フォワードゾーンファイルの命名規則,0
reversezonefilename_format=逆引(リバース)ゾーンファイルの命名規則,0
file_owner=ゾーンファイルの所有者(ユーザ名:グループ名),3,デフォルト
file_perms=ゾーンファイルのパーミッション(8進数),3,デフォルト
default_prins=マスタゾーンのデフォルトマスタサーバ,0,システムのホスト名
default_master=スレーブゾーンのデフォルトマスタサーバ,0
this_ip=リモートスレーブゾーンのためのデフォルトのマスタサーバのIP,3,ホスト名のIPアドレス
updserial_on=自動的にシリアルナンバーを更新する,1,1-はい,0-いいえ
ipv6_mode=逆引IPv6アドレス用のドメイン,1,1-ip6.arpa,0-ip6.int
confirm_zone=ゾーンを削除する前に確認する,1,1-はい,0-いいえ
confirm_rec=レコードを削除する前に確認する,1-はい,0-いいえ
free_nets=フリーアドレスのIPネットワーク,3,自動
line3=システム設定,11
named_conf=named.confへのフルパス,0
named_path=named実行ファイルへのフルパス,0
whois_cmd=whoisコマンドへのフルパス,0
ndc_cmd=ndcコマンドへのフルパス,0
rndc_cmd=rndcコマンドへのフルパス,0
rndcconf_cmd=rndc-confgenコマンドへのフルパス,0
rndc_conf=rndc.confファイルへのフルパス,0
pid_file=デフォルトのPIDファイルの場所,3,/var/run/named.pid
no_pid_chroot=PIDファイルはchrootディレクトリの下にありますか?,1,0-はい,1-いいえ
start_cmd=BINDの起動コマンド,3,デフォルト
stop_cmd=BINDの停止コマンド,3,Killコマンド
restart_cmd=BINDの設定変更を適用するコマンド,3,HUPシグナルを送る
bind8/delete_view.cgi 0000755 0005671 0000012 00000004276 11137650373 014544 0 ustar jcameron wheel #!/usr/local/bin/perl
# delete_zone.cgi
# Delete an existing view and all its zones
require './bind8-lib.pl';
&ReadParse();
$parent = &get_config_parent();
$conf = $parent->{'members'};
$vconf = $conf->[$in{'index'}];
$access{'views'} || &error($text{'view_ecannot'});
if (!$in{'confirm'}) {
# Ask the user if he is sure ..
&ui_print_header(undef, $text{'vdelete_title'}, "");
# Build input for moving zones to another view
@zones = &find("zone", $vconf->{'members'});
if (@zones) {
@moveopts = ( [ 0, $text{'vdelete_delete'} ],
[ 1, $text{'vdelete_root'} ] );
@views = &find("view", $conf);
if (@views > 1) {
push(@moveopts, [ 2, $text{'vdelete_move'}." ".
&ui_select("newview", undef,
[ map { [ $_->{'index'}, $_->{'value'} ] }
grep { $_->{'index'} != $in{'index'} }
@views ]) ]);
}
$movefield = "$text{'vdelete_newview'} ".
&ui_radio("mode", 1, \@moveopts);
}
# Show confirm form
print &ui_confirmation_form("delete_view.cgi",
&text(@zones ? 'vdelete_mesg' : 'vdelete_mesg2',
"$vconf->{'value'}"),
[ [ 'index', $in{'index'} ] ],
[ [ 'confirm', $text{'view_delete'} ] ],
$movefield);
&ui_print_footer("", $text{'index_return'});
exit;
}
# deal with the zones in this view
@zones = &find("zone", $vconf->{'members'});
if ($in{'mode'} == 1) {
# Adding to top level
$dest = &get_config_parent(&add_to_file());
}
else {
# Adding to some other view
$dest = $conf->[$in{'newview'}];
}
&lock_file(&make_chroot($dest->{'file'}));
foreach $z (@zones) {
local $type = &find_value("type", $z->{'members'});
next if (!$type || $type eq 'hint');
if ($in{'mode'} == 0) {
# Delete the records file, and perhaps journal
local $f = &find_value("file", $z->{'members'});
if ($f) {
&delete_records_file($f->{'value'});
}
}
else {
# Move to another view or the top level.
# File may change
delete($z->{'file'});
&save_directive($dest, undef, [ $z ], $in{'mode'} == 2 ? 1 : 0);
}
}
# remove the view directive
&lock_file(&make_chroot($vconf->{'file'}));
&save_directive($parent, [ $vconf ], [ ]);
&flush_file_lines();
&unlock_all_files();
&webmin_log("delete", "view", $vconf->{'value'}, \%in);
&redirect("");
bind8/module.info 0000644 0005671 0000012 00000002213 11137650374 013711 0 ustar jcameron wheel desc_ko_KR.euc=BIND DNS
risk=low medium high
desc_ru_SU= DNS BIND
desc_zh_TW.Big5=BIND 8 DNS A
desc_pl=Serwer DNS BIND
desc_de=BIND DNS-Server
name=BIND
desc_zh_CN=BIND 8 DNS
desc_pt=Servidor de DNS BIND
desc_pt_BR=Servidor de DNS BIND
category=servers
desc_tr=BIND DNS Sunucusu
os_support=slackware-linux redhat-linux mandrake-linux solaris debian-linux suse-linux united-linux hpux freebsd osf1 irix unixware openserver macos open-linux turbo-linux openbsd corel-linux cobalt-linux/5.0-* aix netbsd msc-linux generic-linux gentoo-linux trustix-linux sol-linux coherent-linux openmamba-linux windows
desc=BIND DNS Server
desc_es=Servidor de DNS BIND
desc_sv=BIND DNS-server
desc_fr=Serveur de noms de domaines BIND
desc_ja_JP.euc=BIND DNS
desc_ru_RU= DNS BIND
desc_ca=Servidor DNS BIND
depends=servers
longdesc=Create and edit domains, DNS records, BIND options and views.
desc_bg=BIND DNS
readonly=1
syslog=1
desc_zh_TW.UTF-8=BIND 8 DNS 伺服器
desc_zh_CN.UTF-8=BIND 8 DNS 服务器
desc_ja_JP.UTF-8=BIND DNS サーバ
desc_ko_KR.UTF-8=BIND DNS 서버
desc_cz=DNS BIND Server
desc_nl=BIND DNS-server
version=1.451
bind8/conf_logging.cgi 0000755 0005671 0000012 00000011232 11137650373 014671 0 ustar jcameron wheel #!/usr/local/bin/perl
# conf_logging.cgi
# Display global logging options
require './bind8-lib.pl';
$access{'defaults'} || &error($text{'logging_ecannot'});
&ui_print_header(undef, $text{'logging_title'}, "",
undef, undef, undef, undef, &restart_links());
&ReadParse();
$conf = &get_config();
$logging = &find("logging", $conf);
$mems = $logging ? $logging->{'members'} : [ ];
# Start of tabs for channels and categories
@tabs = ( [ "chans", $text{'logging_chans'}, "conf_logging.cgi?mode=chans" ],
[ "cats", $text{'logging_cats'}, "conf_logging.cgi?mode=cats" ] );
print &ui_tabs_start(\@tabs, "mode", $in{'mode'} || "chans", 1);
print &ui_tabs_start_tab("mode", "chans");
print $text{'logging_chansdesc'},"