Commit bcc9c6fd authored by unknown's avatar unknown

Fix quoting of options passed to external commands by mysqld_multi. (Bug #11280)


scripts/mysqld_multi.sh:
  Fix quoting of options passed to mysqld and mysqladmin
parent 88dedca2
...@@ -289,8 +289,10 @@ sub start_mysqlds() ...@@ -289,8 +289,10 @@ sub start_mysqlds()
} }
else else
{ {
$options[$j]=~ s/;/\\;/g; # we single-quote the argument, but first convert single-quotes to
$tmp.= " $options[$j]"; # '"'"' so they are passed through correctly
$options[$j]=~ s/'/'"'"'/g;
$tmp.= " '$options[$j]'";
} }
} }
if ($opt_verbose && $com =~ m/\/safe_mysqld$/ && !$info_sent) if ($opt_verbose && $com =~ m/\/safe_mysqld$/ && !$info_sent)
...@@ -374,7 +376,12 @@ sub get_mysqladmin_options ...@@ -374,7 +376,12 @@ sub get_mysqladmin_options
$mysqladmin_found= 0 if (!length($mysqladmin)); $mysqladmin_found= 0 if (!length($mysqladmin));
$com = "$mysqladmin"; $com = "$mysqladmin";
$tmp = " -u $opt_user"; $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" : ""; $tmp.= $opt_tcp_ip ? " -h 127.0.0.1" : "";
for ($j = 0; defined($options[$j]); $j++) for ($j = 0; defined($options[$j]); $j++)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment