From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: sql-mode password display Date: Wed, 02 Mar 2005 11:31:50 -0700 Message-ID: <38mf4qF5q3gudU1@individual.net> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1109788492 1163 80.91.229.2 (2 Mar 2005 18:34:52 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 2 Mar 2005 18:34:52 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Mar 02 19:34:52 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1D6Yce-0006uK-5f for geh-help-gnu-emacs@m.gmane.org; Wed, 02 Mar 2005 19:31:00 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D6YvS-0006yU-AJ for geh-help-gnu-emacs@m.gmane.org; Wed, 02 Mar 2005 13:50:26 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 91 Original-X-Trace: individual.net 52JncQwxwsbBcPaA4dyXoAp8E+hW7HCM0NkBtxvpvUzl1YxYA= User-Agent: Mozilla Thunderbird 0.9 (X11/20041105) X-Accept-Language: en-us, en In-Reply-To: Original-Xref: shelby.stanford.edu gnu.emacs.help:128933 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org X-MailScanner-To: geh-help-gnu-emacs@m.gmane.org Xref: main.gmane.org gmane.emacs.help:24476 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:24476 rb wrote: > When I use sql mode: > > M-x sql-mysql, then follow prompts, > > I get the interactive sql buffer which works very well for me. The only > problem is that when I list the processes, the mysql process shows my > password, and I would like to know if there is something I can do to > conceal it? > > rb@antonio 102% ps -ef | grep sql > rb 29562 29372 0 08:44:27 pts/4 0:00 grep sql > rb 29717 15897 0 08:43:34 pts/8 0:00 > /usr/freeware/bin/mysql --user=rb --password=my_password > --host=sanmarco test What happens if you don't enter your password when prompted by M-x sql-mysql, i.e. just type RET? > I was trying to find wheter there was a customizable variable to > conceal/display password and with M-x customize-apropos, I discovered > that the password was displayed in the customization buffer as well: > > Sql Password: Hide my_password > State: this option has been changed outside the customize buffer. > Default password. More > Parent groups: Sql ,----[ C-h v sql-password RET ] | sql-password's value is "" | | Documentation: | *Default password. | | Storing your password in a textfile such as ~/.emacs could be dangerous. | Customizing your password will store it in your ~/.emacs file. | | You can customize this variable. | | Defined in `sql'. `---- sql-password was changed outside of Customize by sql-get-login. But if you just respond with RET it will remain "". > If I start an ineractive mysql session at the command line in an xwsh > shell, I get the following (password not displayed): > > rb@antonio 101% ps -ef | grep sql > rb 29598 29535 0 08:31:14 pts/6 0:00 mysql -h > sanmarco -u rb -p test > > Also, working in shell-mode within emacs, to process a batch file, my > password is displayed in the *shell* buffer, and is retained in the > command history list. > > From Emacs shell buffer: > > rb@antonio 98% mysql -vv -h sanmarco -u rb -p < dbs.sql > dbs.out0222 > mysql -vv -h sanmarco -u rb -p < dbs.sql > dbs.out0222 > Enter password: my_password > > Within the shell, any other commands requiring a password (ssh, rlogin, > su, etc), the password is properly not displayed. ,----[ C-h v comint-password-prompt-regexp RET ] | comint-password-prompt-regexp's value is | "\\(\\([Oo]ld \\|[Nn]ew \\|'s \\|login \\|Kerberos \\|CVS \\|UNIX \\| SMB \\|^\\)[Pp]assword\\( (again)\\)?\\|pass phrase\\|\\(Enter\\|Repeat\\) passphrase\\)\\( for [^:]+\\)?:\\s *\\'" | | Documentation: | *Regexp matching prompts for passwords in the inferior process. | This is used by `comint-watch-for-password-prompt'. | | You can customize this variable. | | Defined in `comint'. `---- M-: (string-match comint-password-prompt-regexp "Enter password: ") RET returns nil, so I would try (setq comint-password-prompt-regexp "\\(\\([Oo]ld \\|[Nn]ew \\|'s \\|login \\|Kerberos \\|CVS \\|UNIX \\| SMB \\|^\\)[Pp]assword\\( (again)\\)?\\|pass phrase\\|\\(Enter\\|Repeat\\) pass ?\\(word\\|phrase\\)\\)\\( for [^:]+\\)?:\\s *\\'") -- Kevin Rodgers