Opened 9 years ago

Closed 6 years ago

#50238 closed defect (worksforme)

gpg2 can't connect to the agent specified in GPG_AGENT_INFO

Reported by: neil_mayhew@… Owned by: Ionic (Mihai Moldovan)
Priority: Normal Milestone:
Component: ports Version: 2.3.4
Keywords: Cc: kajh
Port: gnupg2

Description

I have a running gpg-agent:

$ ps x | grep gpg
44980   ??  Ss     0:00.09 gpg-agent --daemon --write-env-file

The environment is set correctly:

$ env | grep GPG
GPG_AGENT_INFO=/tmp/gpg-qIkaon/S.gpg-agent:44980:1

The socket exists:

$ ls -l ${GPG_AGENT_INFO%%:*}
srwxr-xr-x  1 mayhewn  wheel  0 Jan  5 16:11 /tmp/gpg-qIkaon/S.gpg-agent

The environment file also exists:

$ cat ~/.gpg-agent-info 
GPG_AGENT_INFO=/tmp/gpg-qIkaon/S.gpg-agent:44980:1

However, when I run gpg2 it can't find the agent:

$ touch foo
$ gpg2 --sign foo

You need a passphrase to unlock the secret key for
user: "Neil Mayhew <...>"
1024-bit DSA key, ID XXXXXXXX, created 2005-11-21

gpg: can't connect to the agent - trying fall back

At this point, it manages to find the agent that was started by launchd, and a pinentry dialog pops up on the screen. This is unfortunate, since I'm using ssh and not sitting in front of the computer.

I've tried using dtruss -f, and as far as I can tell gpg2 and its children never stat or open the socket, and in fact never refer to it at all. They do, however, try to stat ~/.gnupg/S.gpg-agent which normally doesn't exist, but even if I symlink the actual socket to this location, gpg2 still can't find the agent.

Change History (3)

comment:1 Changed 9 years ago by mf2k (Frank Schima)

Keywords: gnupg2 removed
Owner: changed from macports-tickets@… to ionic@…
Port: gnupg2 added

In the future, please fill in the Port field and Cc the port maintainers (port info --maintainers gnupg2), if any.

comment:2 Changed 8 years ago by kajh

Cc: kajh added

comment:3 Changed 6 years ago by roederja

Resolution: worksforme
Status: newclosed

In recent versions the agent starts automatically and doesn't need to be started by launchd anymore. So I assume your issue is resolved. Please re-open if not.

Note: See TracTickets for help on using tickets.