Page MenuHome GnuPG

Sockets created in GNUPGHOME instead of /run/user/UID/gnupg if specified.
Closed, ResolvedPublic

Description

If the GNUPGHOME environment variable (or the --homedir flag is passed),
gpg-agent puts the control sockets in GNUPGHOME instead of /run/user/UID/gnupg.

  1. This conflicts with the release notes.
  2. This makes it impossible to specify a custom GNUPGHOME without putting the

sockets in it.

I assume it was unintentional (if it's not, it's really confusing).

Details

Version
2.1.13

Event Timeline

stebalien set Version to 2.1.13.
stebalien added a subscriber: stebalien.

If you want to use a different home directory and a /run/user based socket, you
need to create a directory for that socket first. We don't do this on-the-fly
to avoid cluttering the /run/user with directories.

With GNUPGHOME set, you only need to run

gpgconf --create-socketdir

man gpgconf

werner claimed this task.

Sorry, I thought I would receive an email when this was updated.

We don't do this on-the-fly to avoid cluttering the /run/user with directories.

So, I was expecting gnupg to use /run/user/$UID/gnupg/. However, if GNUPGHOME is
set, it uses /run/user/$UID/gnupg/d.$GNUPGHOME_HASH/. Therefore, by "littering",
I assume you mean littering /run/user/$UID/gnupg/ (otherwise this argument makes
no sense).

I'm leaving this here for future readers as I can't find *any* documentation of
this behavior (the use of d.$GNUPGHOME_HASH).

---

Regardless, my actual goal is to move the homedir to ~/.local/share/gnupg (not
have multiple homedirs) as described in (T1456)
so I really do want sockets to go in /run/user/$UID/gnupg/. However, I'm
guessing that's not going to be possible.