3 # Save a manually edit zone file
5 require './bind8-lib.pl';
7 $zone = &get_zone_name($in{'index'}, $in{'view'});
8 $file = &absolute_path($zone->{'file'});
10 &can_edit_zone($zone) ||
11 &error($text{'master_ecannot'});
12 $access{'file'} || &error($text{'text_ecannot'});
13 $access{'ro'} && &error($text{'master_ero'});
16 &lock_file(&make_chroot($file));
17 $in{'text'} =~ s/\r//g;
18 $in{'text'} .= "\n" if ($in{'text'} !~ /\n$/);
19 &open_tempfile(FILE, ">".&make_chroot($file));
20 &print_tempfile(FILE, $in{'text'});
21 &close_tempfile(FILE);
24 @recs = &read_zone_file($file, $zone->{'name'});
26 &bump_soa_record($file, \@recs);
30 &sign_dnssec_zone_if_key($zone, \@recs);
32 &unlock_file(&make_chroot($file));
33 &webmin_log("text", undef, $zone->{'name'},
35 &redirect("edit_master.cgi?index=$in{'index'}&view=$in{'view'}");