Description of problem:
Our (ci-dnf-stack) test suite is frequently nested in many subdirs and we have only a little control over the path length. We frequently hit gpg2 path length issues.
Version-Release number of selected component (if applicable):
gnupg2-2.2.18-2.fc31
How reproducible:
Always
Steps to Reproduce:
export HOME=/tmp/very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-path; mkdir -p $HOME; gpg2 --batch --passphrase '' --quick-gen-key key-name default default 0
Actual results:
gpg: directory '/tmp/very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-path/.gnupg' created
gpg: keybox '/tmp/very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-path/.gnupg/pubring.kbx' created
gpg: can't connect to the agent: File name too long
gpg: agent_genkey failed: No agent running
gpg: key generation failed: No agent running
Expected results:
gpg: directory '/tmp/short-path/.gnupg' created
gpg: keybox '/tmp/short-path/.gnupg/pubring.kbx' created
gpg: /tmp/short-path/.gnupg/trustdb.gpg: trustdb created
gpg: key 4B4DACD10E5B0939 marked as ultimately trusted
gpg: directory '/tmp/short-path/.gnupg/openpgp-revocs.d' created
gpg: revocation certificate stored as '/tmp/short-path/.gnupg/openpgp-revocs.d/C058F09DC507F4396C8C4E754B4DACD10E5B0939.rev'
As far as I know this limitation is coming from the very deep assumptions of gnupg2 being able to create an UNIX socket in the .gnupg directory and refer to it with absolute path when connecting to it.