pt-stalk handles mysql user password in awkward way

Bug #1348679 reported by Przemek
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Toolkit moved to https://jira.percona.com/projects/PT
Fix Released
Medium
Frank Cizmich

Bug Description

You can pass the mysql user password to pt-stalk in various ways: using --pasword option, placing password in .my.cnf, in /etc/percona-toolkit/pt-stalk.conf, etc. But each this method requires to enter the password in clear text form.
There is also the " -- -p " option that works for other tools in Percona Toolkit, but for pt-stalk, the effect is that it asks the pass in a loop making this one unusable:

[root@localhost ~]# pt-stalk --version
[root@localhost ~]# pt-stalk 2.2.9

[root@localhost ~]# pt-stalk --dest=out/ -- -p
Enter password:
2014_07_25_16_46_25 Starting /usr/bin/pt-stalk --function=status --variable=Threads_running --threshold=25 --match= --cycles=1 --interval=2 --iterations= --run-time=30 --sleep=20 --dest=dupa/ --prefix= --notify-by-email= --log=/var/log/pt-stalk.log --pid=/var/run/pt-stalk.pid --plugin=
Enter password:
Enter password:
Enter password:
Enter password:
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: YES)'
2014_07_25_16_46_44 Detected value is empty; something failed? Trigger exit status: 0
Enter password:
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: YES)'
2014_07_25_16_46_47 Detected value is empty; something failed? Trigger exit status: 0
^C2014_07_25_16_46_48 Caught signal, exiting
2014_07_25_16_46_48 All subprocesses have finished
2014_07_25_16_46_48 Exiting because OKTORUN is false
2014_07_25_16_46_48 /usr/bin/pt-stalk exit status 1

Plase allow the pt-stalk with --password option to read the password securely, once, from the terminal.

Changed in percona-toolkit:
status: New → Confirmed
tags: added: pt-stalk
Changed in percona-toolkit:
status: Confirmed → Triaged
assignee: nobody → Frank Cizmich (frank-cizmich)
importance: Undecided → Medium
Changed in percona-toolkit:
status: Triaged → In Progress
Changed in percona-toolkit:
milestone: none → 2.2.11
status: In Progress → Fix Committed
Revision history for this message
Frank Cizmich (frank-cizmich) wrote :

Fixed adding --ask-pass option. This overrides --password

note:
using "-- -p" makes pt-stalk ask for password in a loop because the options after "--" are passed to mysql each time pt-stalk connects to retrieve info.

Changed in percona-toolkit:
status: Fix Committed → In Progress
Changed in percona-toolkit:
status: In Progress → Fix Committed
Changed in percona-toolkit:
status: Fix Committed → Fix Released
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PT-655

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.