Closed GoogleCodeExporter closed 9 years ago
Original comment by Yoshinor...@gmail.com
on 11 Dec 2012 at 6:41
Thanks for the bug report. This is a regression by introducing escaped user and
password in 0.54. MHA get errors if empty or undefined user/password are passed.
escaped_user and escaped_password are internal parameters and are set in
Config.pm. Here is a tentative patch. I'll run existing and new test cases and
will release a fixed version (0.55) soon.
--- a/lib/MHA/Config.pm
+++ b/lib/MHA/Config.pm
@@ -280,14 +280,18 @@ sub parse_server {
foreach my $key ( keys(%PARAM) ) {
if ( $value{$key} ) {
$value{$key} =~ s/^['"]?(.*)['"]$/$1/;
- if ( $key eq "user" || $key eq "password" ) {
- my $new_key = "escaped_" . $key;
- $server->{$new_key} = MHA::NodeUtil::escape_for_shell( $value{$key} );
- }
}
$server->{$key} = $value{$key};
}
-
+ # set escaped_user and escaped_password
+ foreach my $key ('user', 'password') {
+ my $new_key = "escaped_" . $key;
+ if($server->{$key}) {
+ $server->{$new_key} = MHA::NodeUtil::escape_for_shell( $value{$key} );
+ }else {
+ $server->{$new_key} = "";
+ }
+ }
return $server;
}
Original comment by Yoshinor...@gmail.com
on 11 Dec 2012 at 8:56
Fix committed to GitHub branch. https://github.com/yoshinorim/mha4mysql-manager
Original comment by Yoshinor...@gmail.com
on 12 Dec 2012 at 9:33
Original comment by Yoshinor...@gmail.com
on 12 Dec 2012 at 8:39
Original issue reported on code.google.com by
jay.jans...@percona.com
on 11 Dec 2012 at 4:22