3 # Convert a slave/stub zone into a master
5 require './bind8-lib.pl';
8 if ($in{'view'} ne '') {
9 $conf = $conf->[$in{'view'}]->{'members'};
11 $zconf = $conf->[$in{'index'}];
12 &error_setup($text{'convert_err'});
13 $access{'master'} || &error($text{'mcreate_ecannot'});
15 $file = &find("file", $zconf->{'members'});
17 &error($text{'convert_efile'});
19 &lock_file(&make_chroot($zconf->{'file'}));
21 # Change the type directive
22 &save_directive($zconf, 'type', [ { 'name' => 'type',
23 'values' => [ 'master' ] } ], 1);
25 # Take out directives not allowed in masters
26 &save_directive($zconf, 'masters', [ ], 1);
27 &save_directive($zconf, 'max-transfer-time-in', [ ], 1);
30 &unlock_file(&make_chroot($zconf->{'file'}));