[Pkg-gnupg-maint] Bug#657093: gnupg-agent: pinentry program shouldn't be told to use Emacs' TTY

Eric Dorland eric at debian.org
Sun Jan 4 23:30:02 UTC 2015


* Samuel Bronson (naesten at gmail.com) wrote:
> Package: gnupg-agent
> Version: 2.0.18-2
> Severity: important
> 
> (This bug should perhaps be filed against both gnupg and gnupg2, but
> debbug doesn't really have a clean way to do this, so...)
> 
> I expect you're aware that when gpg or gpg2 is invoked under Emacs, the
> DISPLAY environment variable is unset, and gpg-agent needs to prompt for
> a passphrase, the pinentry program makes a mess on the terminal.
> 
> It might not be fair to blame this on pinentry or gpg-agent, though
> gpg-agent could perhaps discard any "ttyname" values accompanied by a
> "ttytype" of "dumb", if the following excerpt from an strace of
> gpg-connect-agent run using Emacs' `shell-command' is any indication:
> 
> ,----
> | socket(PF_FILE, SOCK_STREAM, 0)         = 4
> | connect(4, {sa_family=AF_FILE, path="/home/naesten/.gnupg/S.gpg-agent"}, 34) = 0
> | read(4, "OK Pleased to meet you, process "..., 1002) = 38
> | write(4, "RESET", 5)                    = 5
> | write(4, "\n", 1)                       = 1
> | read(4, "OK\n", 1002)                   = 3
> | write(4, "OPTION ttyname=/dev/pts/38", 26) = 26
> | write(4, "\n", 1)                       = 1
> | read(4, "OK\n", 1002)                   = 3
> | write(4, "OPTION ttytype=dumb", 19)     = 19
> | write(4, "\n", 1)                       = 1
> | read(4, "OK\n", 1002)                   = 3
> | write(4, "OPTION lc-ctype=en_US.UTF-8", 27) = 27
> | write(4, "\n", 1)                       = 1
> | read(4, "OK\n", 1002)                   = 3
> | write(4, "OPTION lc-messages=en_US.UTF-8", 30) = 30
> | write(4, "\n", 1)                       = 1
> | read(4, "OK\n", 1002)                   = 3
> `----
> 
> Alternatively, gnupg/gnupg2/et al could refrain from sending the tty at
> all in such cases. I believe most of these programs use a library to
> communicate with gpg-agent; perhaps the logic could be added there?

You're aware you can redirect which tty gets used with GPG_TTY?

This sounds like a bug in pinentry, in that it can't handle dumb
consoles gracefully. Is that a fair characterization?

-- 
Eric Dorland <eric at kuroneko.ca>
43CF 1228 F726 FD5B 474C  E962 C256 FBD5 0022 1E93
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-gnupg-maint/attachments/20150104/aae466ba/attachment.sig>


More information about the Pkg-gnupg-maint mailing list