Merge lp:~akopytov/percona-xtrabackup/bug729843 into lp:percona-xtrabackup/1.6

Proposed by Alexey Kopytov
Status: Merged
Approved by: Stewart Smith
Approved revision: no longer in the source branch.
Merged at revision: 308
Proposed branch: lp:~akopytov/percona-xtrabackup/bug729843
Merge into: lp:percona-xtrabackup/1.6
Diff against target: 39 lines (+23/-1)
2 files modified
innobackupex (+2/-1)
test/t/bug729843.sh (+21/-0)
To merge this branch: bzr merge lp:~akopytov/percona-xtrabackup/bug729843
Reviewer Review Type Date Requested Status
Stewart Smith (community) Approve
Review via email: mp+83435@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Alexey Kopytov (akopytov) wrote :
Revision history for this message
Stewart Smith (stewart) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'innobackupex'
2--- innobackupex 2011-10-21 17:06:33 +0000
3+++ innobackupex 2011-11-25 19:00:29 +0000
4@@ -990,7 +990,8 @@
5 my $options = get_mysql_options();
6 # run mysql as a child process with a pipe connection
7 $now = current_time();
8- print STDERR "$now $prefix Starting mysql with options: $options\n";
9+ (my $prt_options = $options) =~ s/--password=[^ ]+ /--password=xxxxxxxx /g;
10+ print STDERR "$now $prefix Starting mysql with options: $prt_options\n";
11 $mysql_pid = open(*MYSQL_WRITER, "| mysql $options >$mysql_stdout 2>$mysql_stderr ") or Die "Failed to spawn mysql child process: $!";
12 MYSQL_WRITER->autoflush(1);
13 $now = current_time();
14
15=== added file 'test/t/bug729843.sh'
16--- test/t/bug729843.sh 1970-01-01 00:00:00 +0000
17+++ test/t/bug729843.sh 2011-11-25 19:00:29 +0000
18@@ -0,0 +1,21 @@
19+########################################################################
20+# Bug #729843: innobackupex logs plaintext password
21+########################################################################
22+
23+. inc/common.sh
24+
25+init
26+run_mysqld
27+
28+mkdir $topdir/backup
29+logfile=$topdir/backup/innobackupex_log
30+
31+# Don't use run_cmd_* or innobackupex functions here to avoid logging
32+# the full command line (including the password in plaintext)
33+set +e
34+$IB_BIN $IB_ARGS --password=secret $topdir/backup 2>&1 | tee $logfile
35+set -e
36+
37+# Check that the password was not logged in plaintext
38+run_cmd grep -- "--password=xxxxxxxx" $logfile
39+run_cmd_expect_failure grep -- "--password=secret" $logfile

Subscribers

People subscribed via source and target branches