[RFC PATCH 0/2] Scute: Fix connection to a running agent.

Damien Goutte-Gattat dgouttegattat at incenp.org
Mon Jan 16 13:26:58 CET 2017


Hi,

The following patch set implements a new way for Scute to find the
socket of the GnuPG Agent.

The current code still uses a logic that was adapted to GnuPG 2.0,
based on the GPG_AGENT_INFO variable with a fallback to a standard
socket that is expected to be under $GNUPGHOME. GnuPG 2.1 no longer
uses the GPG_AGENT_INFO variable, and since 2.1.13 the standard
socket may be located under [/var]/run instead of GnuPG's home
directory. Scute may thus be unable to find the socket, and will
end up starting the GnuPG Agent itself in "pipe" mode even though
there is already an agent running.

There are several ways to fix that. The patches in that series
proposes a somewhat "radical" but, I believe, elegant solution,
which is to rely completely on the gpg-connect-agent binary to
send a 'GETINFO socket_name' to the agent.

This way, we can be sure to always use the correct logic to find
the socket, without having to duplicate any code between GnuPG
and Scute.

Comments are wellcome.

(Note, in particular, that I am not sure whether this method is
appropriate for Windows systems. I don't have a Windows machine
to do any test. Can we even rely on popen always being available
on Windows?)

Damien Goutte-Gattat (2):
  Get GPG Agent's socket directly from the agent.
  Cleanup now unused code.

 configure.ac   |  36 +++----
 src/agent.c    | 321 +++++++--------------------------------------------------
 src/get-path.c | 190 +---------------------------------
 src/support.h  |  10 +-
 4 files changed, 63 insertions(+), 494 deletions(-)

-- 
2.9.0




More information about the Gnupg-devel mailing list