From: Date: August 31 2005 7:23pm Subject: bk commit into 4.1 tree (jimw:1.2402) BUG#11280 List-Archive: http://lists.mysql.com/internals/29121 X-Bug: 11280 Message-Id: <20050831172334.5B07CA84E1@rama.trainedmonkey.com> Below is the list of changes that have just been committed into a local 4.1 repository of jimw. When jimw does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet 1.2402 05/08/31 10:23:29 jimw@stripped +1 -0 Fix quoting of options passed to external commands by mysqld_multi. (Bug #11280) scripts/mysqld_multi.sh 1.22 05/08/31 10:23:25 jimw@stripped +10 -3 Fix quoting of options passed to mysqld and mysqladmin # This is a BitKeeper patch. What follows are the unified diffs for the # set of deltas contained in the patch. The rest of the patch, the part # that BitKeeper cares about, is below these diffs. # User: jimw # Host: rama.(none) # Root: /home/jimw/my/mysql-4.1-11280 --- 1.21/scripts/mysqld_multi.sh 2004-10-11 12:38:57 -07:00 +++ 1.22/scripts/mysqld_multi.sh 2005-08-31 10:23:25 -07:00 @@ -289,8 +289,10 @@ } 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 @@ $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++) {