unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefan@marxist.se>
To: Toby Ferguson <toby.h.ferguson@gmail.com>
Cc: 37636@debbugs.gnu.org
Subject: bug#37636: 26.1; comint password prompt regexp doesn't handle python twine prompting for password
Date: Sun, 6 Oct 2019 03:16:40 +0200	[thread overview]
Message-ID: <CADwFkmmTNuijaX6SfUEi72WSBLXcMuru1K=3HSCDog57ZTmFjw@mail.gmail.com> (raw)
In-Reply-To: <CAJEgBPbpzHzMGaG-LxzVBuE_WV841j1F62Y-xFsqyvMf3SzfeA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1388 bytes --]

Toby Ferguson <toby.h.ferguson@gmail.com> writes:

> When I attempt to execute a command in a bash shell using python the python command prompts for a password and that password prompt isn't hidden. In what follows I'll replace my real password with the string FARGLE. Here's the offending interaction in a bash shell buffer:
>
> (cdp_validator) bash-4.4$ python3 -m twine upload  dist/*
> Enter your usErname: toby.h.ferguson
> Enter your password: FARGLE
>
> As you can see, the password isn't hidden at all :-(
>
> Executing the following elisp fixed the problem:
>
> (setq comint-password-prompt-regexp
>       (concat comint-password-prompt-regexp
>               "\\|^Enter your password:.*"))
>
> The general task here that the python is executing is pretty common: uploading a package to PyPi.  So I would ask that you add that string as a default to the comint-password-prompt-regexp

Thank you for the bug report.

I believe that this has already been fixed on the current master
branch.  When I added the string "Enter your password: " to the test
suite for comint-password-prompt-regexp, the test passed with no
further changes.

You could try building the current master branch to verify that this
works for you.  I've attached a patch containing an addition to the
test suite which I'll push to the master branch.

Best regards,
Stefan Kangas

[-- Attachment #2: 0001-Add-new-example-to-comint-password-prompt-tests.patch --]
[-- Type: text/x-patch, Size: 1001 bytes --]

From 3f6c81ca36b99e444bc6fc49b2736852840557ce Mon Sep 17 00:00:00 2001
From: Stefan Kangas <stefankangas@gmail.com>
Date: Sun, 6 Oct 2019 03:08:27 +0200
Subject: [PATCH] Add new example to comint-password-prompt tests

* test/lisp/comint-tests.el (comint-testsuite-password-strings):
Add new example to test suite.  (Bug#37636)
---
 test/lisp/comint-tests.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/test/lisp/comint-tests.el b/test/lisp/comint-tests.el
index 09f10879f9..9f23967fee 100644
--- a/test/lisp/comint-tests.el
+++ b/test/lisp/comint-tests.el
@@ -34,6 +34,7 @@ comint-testsuite-password-strings
     "Enter passphrase: " ; ssh-add
     "Enter passphrase (empty for no passphrase): " ; ssh-keygen
     "Enter same passphrase again: "     ; ssh-keygen
+    "Enter your password: "             ; python3 -m twine upload Bug#37636
     "Passphrase for key root@GNU.ORG: " ; plink
     "[sudo] password for user:" ; Ubuntu sudo
     "[sudo] user 的密码:" ; localized
-- 
2.20.1


  reply	other threads:[~2019-10-06  1:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-06  0:47 bug#37636: 26.1; comint password prompt regexp doesn't handle python twine prompting for password Toby Ferguson
2019-10-06  1:16 ` Stefan Kangas [this message]
2019-10-07 18:54   ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADwFkmmTNuijaX6SfUEi72WSBLXcMuru1K=3HSCDog57ZTmFjw@mail.gmail.com' \
    --to=stefan@marxist.se \
    --cc=37636@debbugs.gnu.org \
    --cc=toby.h.ferguson@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).