1 |
On Wed, Dec 14, 2016 at 7:56 AM, Mart Raudsepp <leio@g.o> wrote: |
2 |
> Ühel kenal päeval, K, 14.12.2016 kell 15:35, kirjutas Andrew Savchenko: |
3 |
>> On Wed, 14 Dec 2016 11:16:58 +0200 Mart Raudsepp wrote: |
4 |
>> > |
5 |
>> > Ühel kenal päeval, K, 14.12.2016 kell 13:08, kirjutas Sam Jorna: |
6 |
>> > > |
7 |
>> > > On Mon, Dec 12, 2016 at 02:35:28PM +1100, Sam Jorna wrote: |
8 |
>> > > > |
9 |
>> > > > |
10 |
>> > > > On Mon, Dec 12, 2016 at 09:34:21AM +0700, grozin@g.o |
11 |
>> > > > wrote: |
12 |
>> > > > > |
13 |
>> > > > > |
14 |
>> > > > > On Sun, 11 Dec 2016, Kristian Fiskerstrand wrote: |
15 |
>> > > > > > |
16 |
>> > > > > > |
17 |
>> > > > > > On 12/11/2016 03:13 PM, grozin@g.o wrote: |
18 |
>> > > > > > > |
19 |
>> > > > > > > |
20 |
>> > > > > > > gpg: signing failed: Inappropriate ioctl for device |
21 |
>> > > > > > this might indicate a want for export GPG_TTY=$(tty) |
22 |
>> > > > > I don't understand what has really happened. I removed my |
23 |
>> > > > > last |
24 |
>> > > > > commit, an |
25 |
>> > > > > attempt to commit it again failed with gpg: signing failed. |
26 |
>> > > > > Then |
27 |
>> > > > > I logged |
28 |
>> > > > > out of the box on which I have the git tree (I log in this |
29 |
>> > > > > box |
30 |
>> > > > > via ssh), |
31 |
>> > > > > and logged in again. After that the commit succeeded. |
32 |
>> > > > |
33 |
>> > > > I was also getting some odd issues with commit signing, though |
34 |
>> > > > it |
35 |
>> > > > seemed |
36 |
>> > > > to settle for me when I switched to pinentry-curses (since I |
37 |
>> > > > use |
38 |
>> > > > awesome), so I figured it was probably a local issue. Perhaps |
39 |
>> > > > there's a |
40 |
>> > > > wider problem here? |
41 |
>> > > |
42 |
>> > > If anyone else is getting this, it seems to be resolved by |
43 |
>> > > exporting |
44 |
>> > > GPG_TTY=$(tty) either immediately before attempting to sign or in |
45 |
>> > > your |
46 |
>> > > shell ~/.*rc file. |
47 |
>> > |
48 |
>> > I'd consider this a temporary workaround. The real issue would just |
49 |
>> > be |
50 |
>> > workarounded with this, which is nice to get something committed, |
51 |
>> > but |
52 |
>> > not so nice longterm. |
53 |
>> > I had similar issues, but it turned out some pinentry issues for me |
54 |
>> > iirc, so properly fixed by now and not needing such hackery |
55 |
>> > anymore. |
56 |
>> |
57 |
>> This is not a workaround, but officially recommended practice, from |
58 |
>> man gpg-agent: |
59 |
>> |
60 |
>> You should always add the following lines to your .bashrc or |
61 |
>> whatever initialization file is used for all shell invocations: |
62 |
>> |
63 |
>> GPG_TTY=$(tty) |
64 |
>> export GPG_TTY |
65 |
> |
66 |
> Then the packages or eselect pinentry or whatever should be taking care |
67 |
> of it, not have users have to mess with .bashrc to have stuff work. |
68 |
|
69 |
This is not practical. |
70 |
|
71 |
Adding it to the global /etc/bashrc is a bad idea. It would slow down |
72 |
every shell startup (fork/exec), even for users who do not actively |
73 |
use gpg (like root). |
74 |
|
75 |
Also, there is no way to know what shell each gpg user will be using. |