profiles: ssh: allow gpgagent socket for custom homedir (#6419)

If a custom GPG homedir is used, a hash of its path is used in the path
of the gpg agent socket[1].

For example, when running:

    gpgconf --list-dirs agent-ssh-socket

With a custom homedir it returns:

    /run/user/1000/gnupg/<hashed homedir>/S.gpg-agent.ssh

Environment: gnupg 2.4.5-4 on Arch Linux.

[1] 91532dc3f4/common/homedir.c (L1342)
This commit is contained in:
ayham 2024-08-07 21:10:05 +00:00 committed by GitHub
parent 7299f832fb
commit ebd4b3eea6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -19,7 +19,8 @@ include disable-exec.inc
include disable-programs.inc
whitelist ${RUNUSER}/gcr/ssh
whitelist ${RUNUSER}/gnupg/S.gpg-agent.ssh
whitelist ${RUNUSER}/gnupg/S.gpg-agent.ssh # default gpg homedir setup
whitelist ${RUNUSER}/gnupg/*/S.gpg-agent.ssh # custom gpg homedir setup
whitelist ${RUNUSER}/keyring/ssh
include whitelist-usr-share-common.inc
include whitelist-runuser-common.inc