3 # Save changes to slave zone options in named.boot
5 require './dns-lib.pl';
7 &lock_file($config{'named_boot_file'});
8 $zconf = &get_config()->[$in{'index'}];
9 $whatfailed = "Failed to save slave zone";
10 %access = &get_module_acl();
11 &can_edit_zone(\%access, $zconf->{'values'}->[0]) ||
12 &error("You are not allowed to edit this zone");
14 @mast = split(/\s+/, $in{'masters'});
16 &check_ipaddress($m) ||
17 &error("'$m' is not a valid master server IP address");
19 if (!@mast) { &error("You must enter at least one master server address"); }
20 $in{'file_def'} || $in{'file'} =~ /^\S+$/ ||
21 &error("'$in{'file'}' is not a valid records filename");
23 push(@vals, $zconf->{'values'}->[0]);
25 if (!$in{'file_def'}) {
27 $file = &base_directory($conf)."/".$file if ($file !~ /^\//);
28 &allowed_zone_file(\%access, $file) ||
29 &error("'$in{'file'}' is not an allowable records file");
30 push(@vals, $in{'file'});
32 &modify_zone($zconf, { 'name' => 'secondary', 'values' => \@vals });
33 &unlock_file($config{'named_boot_file'});
34 &webmin_log("opts", undef, $zconf->{'values'}->[0], \%in);