Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 133046

Summary: pinentry fails when used within emacs shell buffers
Product: Gentoo Linux Reporter: Matthew Kennedy (RETIRED) <mkennedy>
Component: New packagesAssignee: Sven Wegener <swegener>
Status: RESOLVED INVALID    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Matthew Kennedy (RETIRED) gentoo-dev 2006-05-11 10:22:19 UTC
If pinentry-ncurses is invoked while in an emacs buffer then the results are as follows:

   1.  the screen is garbled
   2.  text entered into pinentry shows up as plain text
   3.  a kind of "denial of service"

More on point 3: The entire buffer must be killed, but pinentry does not die (from process list).  You cannot start another login session if you're possibly invoking pinentry from your .bash* (eg. from keychain).  I had to kill pinentry from another emacs shell buffer (emacs shell buffers are not login shells).

I think the problem might be inherent to pinentry.

It might also be related to Bug 119356.

Ideally, if the environment contains "EMACS=t", then pinentry should instead send the string "Pass phrase: " (or anything that matches the regexp in emacs's comint-password-prompt-regexp variable (eg.  \\(\\([Oo]ld \\|[Nn]ew \\|'s \\|login \\|Kerberos \\|CVS \\|UNIX \\| SMB \\|^\\)[Pp]assword\\( (again)\\)?\\|pass phrase\\|\\(Enter\\|Repeat\\|Bad\\) passphrase\\)\\(?:, try again\\
\)?\\(?: for [^:]+\\)?:\\s *\\'").

When Emacs sees text matching comint-password-prompt-regexp in the shell buffer, it switches to read unechoed characters from the minibuffer (printed with *'s etc.), which is great.  Then it sends the string it collected to the sub process but without echoing it.
Comment 1 Matthew Kennedy (RETIRED) gentoo-dev 2006-05-11 11:09:08 UTC
Where I wrote:

  More on point 3: The entire buffer must be killed, but pinentry does not die
  (from process list).  

That part is actually incorrect.  Sending ^C does actually kill it in the emacs buffer.  The rest of the problems described are still accurate though.
Comment 2 Matthew Kennedy (RETIRED) gentoo-dev 2006-06-08 17:43:43 UTC
Looking at the source for pinentry, looks like this would be resolves with significant work upstream, so perhaps this bug should be closed here since it isn't really our problem
Comment 3 Matthew Kennedy (RETIRED) gentoo-dev 2006-07-22 16:12:59 UTC
invalidating own bug.