[pkg-gnupg-maint] Bug#839115: gpg and "sudo -E gpg" use different agent sockets and can't talk to each other

Josh Triplett josh at joshtriplett.org
Thu Sep 29 03:30:27 UTC 2016


Package: gnupg2
Version: 2.1.15-3
Severity: normal

Ran into this when trying to restore from a backup, as root to handle
file ownership correctly.  gpg when run as my user account launched a
gpg-agent listening on /run/user/1000/gnupg/S.gpg-agent .  "sudo -E gpg"
didn't even try to look for that gpg-agent, and instead launched its own
gpg-agent running as root and listening on
/home/josh/.gnupg/S.gpg-agent.  As far as I can tell, in both cases gpg
didn't even provide an option to fix that, so neither gpg could talk to
each other.  I ended up working around this by temporarily symlinking
/home/josh/.gnupg/S.gpg-agent to /run/user/1000/gnupg/S.gpg-agent ,
which allowed "sudo -E gpg" to use the right gpg-agent.

One possible fix for this would involve using $XDG_RUNTIME_DIR from the
environment than hardcoding /run/user/$UID.

-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.7.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages gnupg2 depends on:
ii  gnupg  2.1.15-3

gnupg2 recommends no packages.

gnupg2 suggests no packages.

-- no debconf information



More information about the pkg-gnupg-maint mailing list