Handle hostnames with upper-case letters
[webmin.git] / bind8 / save_manual.cgi
1 #!/usr/local/bin/perl
2 # Update a manually edited config file
3
4 require './bind8-lib.pl';
5 &error_setup($text{'manual_err'});
6 $access{'defaults'} || &error($text{'manual_ecannot'});
7 &ReadParseMime();
8
9 # Work out the file
10 $conf = &get_config();
11 @files = &get_all_config_files($conf);
12 &indexof($in{'file'}, @files) >= 0 || &error($text{'manual_efile'});
13 $in{'data'} =~ s/\r//g;
14 if ($in{'file'} eq $files[0]) {
15         $in{'data'} =~ /\S/ || &error($text{'manual_edata'});
16         }
17
18 # Write to it
19 &open_lock_tempfile(DATA, ">".&make_chroot($in{'file'}));
20 &print_tempfile(DATA, $in{'data'});
21 &close_tempfile(DATA);
22
23 &webmin_log("manual", undef, $in{'file'});
24 &redirect("");
25