Created
March 14, 2011 04:19
-
-
Save riywo/868772 to your computer and use it in GitHub Desktop.
innobackupexでログにパスワードを生で吐かない様に
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# diff -u /usr/bin/innobackupex-1.5.1 innobackupex-1.5.1 | |
--- /usr/bin/innobackupex-1.5.1 2010-11-12 16:13:38.000000000 +0900 | |
+++ innobackupex-1.5.1 2011-03-14 13:17:24.000000000 +0900 | |
@@ -1134,7 +1134,8 @@ | |
my $options = get_mysql_options(); | |
# run mysql as a child process with a pipe connection | |
$now = current_time(); | |
- print STDERR "$now $prefix Starting mysql with options: $options\n"; | |
+ (my $prt_options = $options) =~ s/--password=[^ ]+ /--password=xxxxxxxx /g; | |
+ print STDERR "$now $prefix Starting mysql with options: $prt_options\n"; | |
$mysql_pid = open(*MYSQL_WRITER, "| mysql $options >$mysql_stdout 2>$mysql_stderr ") or Die "Failed to spawn mysql child process: $!"; | |
MYSQL_WRITER->autoflush(1); | |
$now = current_time(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment