Gentoo Archives: gentoo-dev

From: Andrew Savchenko <bircoph@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] gpg: signing failed: Inappropriate ioctl for device
Date: Wed, 14 Dec 2016 12:35:38
Message-Id: 20161214153522.f47b16e6b50f5fa25de5f543@gentoo.org
In Reply to: Re: [gentoo-dev] gpg: signing failed: Inappropriate ioctl for device by Mart Raudsepp
1 On Wed, 14 Dec 2016 11:16:58 +0200 Mart Raudsepp wrote:
2 > Ühel kenal päeval, K, 14.12.2016 kell 13:08, kirjutas Sam Jorna:
3 > > On Mon, Dec 12, 2016 at 02:35:28PM +1100, Sam Jorna wrote:
4 > > >
5 > > > On Mon, Dec 12, 2016 at 09:34:21AM +0700, grozin@g.o wrote:
6 > > > >
7 > > > > On Sun, 11 Dec 2016, Kristian Fiskerstrand wrote:
8 > > > > >
9 > > > > > On 12/11/2016 03:13 PM, grozin@g.o wrote:
10 > > > > > >
11 > > > > > > gpg: signing failed: Inappropriate ioctl for device
12 > > > > > this might indicate a want for export GPG_TTY=$(tty)
13 > > > > I don't understand what has really happened. I removed my last
14 > > > > commit, an 
15 > > > > attempt to commit it again failed with gpg: signing failed. Then
16 > > > > I logged 
17 > > > > out of the box on which I have the git tree (I log in this box
18 > > > > via ssh), 
19 > > > > and logged in again. After that the commit succeeded.
20 > > >
21 > > > I was also getting some odd issues with commit signing, though it
22 > > > seemed 
23 > > > to settle for me when I switched to pinentry-curses (since I use 
24 > > > awesome), so I figured it was probably a local issue. Perhaps
25 > > > there's a 
26 > > > wider problem here?
27 > >
28 > > If anyone else is getting this, it seems to be resolved by exporting 
29 > > GPG_TTY=$(tty) either immediately before attempting to sign or in
30 > > your 
31 > > shell ~/.*rc file.
32 >
33 > I'd consider this a temporary workaround. The real issue would just be
34 > workarounded with this, which is nice to get something committed, but
35 > not so nice longterm.
36 > I had similar issues, but it turned out some pinentry issues for me
37 > iirc, so properly fixed by now and not needing such hackery anymore.
38
39 This is not a workaround, but officially recommended practice, from
40 man gpg-agent:
41
42 You should always add the following lines to your .bashrc or
43 whatever initialization file is used for all shell invocations:
44
45 GPG_TTY=$(tty)
46 export GPG_TTY
47
48
49 Best regards,
50 Andrew Savchenko

Replies