gpgme+gpgsm bug: fails when stdout redirected

Marcus Brinkmann Marcus.Brinkmann at
Tue Jan 27 22:58:33 CET 2004

On Tue, Jan 27, 2004 at 10:01:00PM +0100, Albrecht Dreß wrote:
> When I redirect the output, it ejects with the following error message:
> [albrecht at antares Balsa]$ ./gpgsm-test ../smime.p7s ../ >  
> GPGME: signature verification failed: Inappropriate ioctl for device

The problem is that for some operations, GPGSM will use gpg-agent, which
might use pinentry to get a PIN to unlock a secret key.  pinentry will want
to either pop up a window or do some curses magic to create some ASCII art
dialog window.

We do not have the code in there to only prepare for this situation when it
can occur, or at least fail gracefully if we end up in a situation where we
can't do the right thing.  That's sort of an unexplored corner of the whole
setup.  We might need to pass the information that no tty is available down
to gpgsm->gpg-agent->pinentry, but expect some operations to fail then
because the passphrase can't be received (unless you setup everything to
ensure that pinentry pops up on some other tty/X or gpg-agent has the
passphrase cached, etc).


`Rhubarb is no Egyptian god.' GNU    marcus at
Marcus Brinkmann              The Hurd
Marcus.Brinkmann at

More information about the Gnupg-devel mailing list