mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 13:02:28 +01:00
Fix quoting of options passed to external commands by mysqld_multi. (Bug #11280)
This commit is contained in:
parent
298af8ccb9
commit
2ef8b1e7de
1 changed files with 10 additions and 3 deletions
|
@ -289,8 +289,10 @@ sub start_mysqlds()
|
|||
}
|
||||
else
|
||||
{
|
||||
$options[$j]=~ s/;/\\;/g;
|
||||
$tmp.= " $options[$j]";
|
||||
# we single-quote the argument, but first convert single-quotes to
|
||||
# '"'"' so they are passed through correctly
|
||||
$options[$j]=~ s/'/'"'"'/g;
|
||||
$tmp.= " '$options[$j]'";
|
||||
}
|
||||
}
|
||||
if ($opt_verbose && $com =~ m/\/safe_mysqld$/ && !$info_sent)
|
||||
|
@ -374,7 +376,12 @@ sub get_mysqladmin_options
|
|||
$mysqladmin_found= 0 if (!length($mysqladmin));
|
||||
$com = "$mysqladmin";
|
||||
$tmp = " -u $opt_user";
|
||||
$tmp.= defined($opt_password) ? " -p$opt_password" : "";
|
||||
if (defined($opt_password)) {
|
||||
my $pw= $opt_password;
|
||||
# Protect single quotes in password
|
||||
$pw =~ s/'/'"'"'/g;
|
||||
$tmp.= " -p'$pw'";
|
||||
}
|
||||
$tmp.= $opt_tcp_ip ? " -h 127.0.0.1" : "";
|
||||
for ($j = 0; defined($options[$j]); $j++)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue