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