mirror of
https://github.com/webmin/webmin.git
synced 2026-10-29 22:50:58 +00:00
This fixes missing permission checks in the MySQL manual configuration editor, with both read and write endpoints now require full configuration permissions to match the existing checks used by the configuration editor.
24 lines
587 B
Perl
Executable File
24 lines
587 B
Perl
Executable File
#!/usr/local/bin/perl
|
|
# Save a manually edited config file
|
|
|
|
require './mysql-lib.pl';
|
|
$access{'perms'} == 1 || &error($text{'cnf_ecannot'});
|
|
&ReadParseMime();
|
|
&error_setup($text{'manual_err'});
|
|
|
|
# Validate the filename
|
|
$conf = &get_mysql_config();
|
|
@files = &unique(map { $_->{'file'} } @$conf);
|
|
$in{'manual'} ||= $files[0];
|
|
&indexof($in{'manual'}, @files) >= 0 ||
|
|
&error($text{'manual_efile'});
|
|
|
|
# Write the file
|
|
$in{'data'} =~ s/\r//g;
|
|
&open_lock_tempfile(MANUAL, ">$in{'manual'}");
|
|
&print_tempfile(MANUAL, $in{'data'});
|
|
&close_tempfile(MANUAL);
|
|
|
|
&webmin_log("manual");
|
|
&redirect("");
|