Page MenuHome GnuPG

pinentry-curses fails with ERR 83886343 Line passed to IPC too long <Pinentry> when --ttytype is unusable
Closed, ResolvedPublic

Description

when pinentry-curses doesn't know the tty type, it fails with:

ERR 83886343 Line passed to IPC too long <Pinentry>

here's an example, using "env -i" to clean the environment.

$ THIS_TTY=$(tty)
$ echo getpin | env -i pinentry-curses --ttyname $THIS_TTY
OK Pleased to meet you
pinentry-curses: no LC_CTYPE known - assuming UTF-8
ERR 83886343 Line passed to IPC too long <Pinentry>
$

if i provide --ttytype=$TERM then things are fine.

This is an unintelligible error, and it probably doesn't even need to be an error.

If pinentry doesn't know the --ttytype, and $TERM is unset, to just guess at a
sensible terminal type like "vt100" or even "dumb" rather than failing with an
uninterpretable error message. even an error like GPG_ERR_ENOTTY would probably
be better (though "inappropriate ioctl for device" isn't particularly clear either).

Details

Version
0.9.7

Event Timeline

dkg added projects: pinentry, Bug Report.
dkg added a subscriber: dkg.

curses can't figure out the window size and thus it returns -1 for the size.
Pinentry's test for the required window size thus returns an error.

I have added new error codes to libgpg-error to either return
ERR 83886383 Screen or window too small <Pinentry>
or in our case:
ERR 83886383 Required environment variable not set <Pinentry>

That does not directly point to a problem with the TTY but it shows the cause
for the error (COLUMNS, LINES etc not set).

werner claimed this task.
werner removed a project: Restricted Project.