Handle hostnames with upper-case letters
[webmin.git] / bind8 / convert_slave.cgi
1 #!/usr/local/bin/perl
2 # convert_slave.cgi
3 # Convert a slave/stub zone into a master
4
5 require './bind8-lib.pl';
6 &ReadParse();
7 $conf = &get_config();
8 if ($in{'view'} ne '') {
9         $conf = $conf->[$in{'view'}]->{'members'};
10         }
11 $zconf = $conf->[$in{'index'}];
12 &error_setup($text{'convert_err'});
13 $access{'master'} || &error($text{'mcreate_ecannot'});
14
15 $file = &find("file", $zconf->{'members'});
16 if (!$file) {
17         &error($text{'convert_efile'});
18         }
19 &lock_file(&make_chroot($zconf->{'file'}));
20
21 # Change the type directive
22 &save_directive($zconf, 'type', [ { 'name' => 'type',
23                                     'values' => [ 'master' ] } ], 1);
24
25 # Take out directives not allowed in masters
26 &save_directive($zconf, 'masters', [ ], 1);
27 &save_directive($zconf, 'max-transfer-time-in', [ ], 1);
28
29 &flush_file_lines();
30 &unlock_file(&make_chroot($zconf->{'file'}));
31 &redirect("");
32