commit:     a77da040470ef0f03c446240c68c51472685e85a
Author:     Lucio Sauer <watermanpaint <AT> posteo <DOT> net>
AuthorDate: Thu Mar  5 00:33:35 2026 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Mar  5 22:02:18 2026 +0000
URL:        https://gitweb.gentoo.org/proj/kde.git/commit/?id=a77da040

kde-plasma/plasma-workspace: fix setting SSH_AUTH_SOCK

The previous script didn't account for non-standard socket locations
when the GNUPGHOME environment variable is set.  Guarantee that the
right socket path is used by querying gpgconf.  This option was first
introduced with version 2.1.14 in upstream commit 7732b3328 ("gpgconf:
Enhance --list-dirs.").

See-also: https://www.gnupg.org/documentation/manuals/gnupg/Agent-Examples.html
Closes: https://bugs.gentoo.org/970911
Signed-off-by: Lucio Sauer <watermanpaint <AT> posteo.net>
Part-of: https://codeberg.org/gentoo/gentoo/pulls/217
Merges: https://codeberg.org/gentoo/gentoo/pulls/217
Signed-off-by: Sam James <sam <AT> gentoo.org>

 kde-plasma/plasma-workspace/files/10-agent-startup.sh | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/kde-plasma/plasma-workspace/files/10-agent-startup.sh 
b/kde-plasma/plasma-workspace/files/10-agent-startup.sh
index 104822c240..0cbe0e187e 100644
--- a/kde-plasma/plasma-workspace/files/10-agent-startup.sh
+++ b/kde-plasma/plasma-workspace/files/10-agent-startup.sh
@@ -40,11 +40,8 @@ if [ "${SSH_AGENT}" = true ]; then
                eval "$(/usr/bin/ssh-agent -s)"
        fi
 elif [ "${SSH_AGENT}" = gpg ] && [ "${GPG_AGENT}" = true ]; then
-       if [ -e /run/user/$(id -ru)/gnupg/S.gpg-agent.ssh ]; then
-               export SSH_AUTH_SOCK=/run/user/$(id -ru)/gnupg/S.gpg-agent.ssh
-       elif [ -e "${HOME}/.gnupg/S.gpg-agent.ssh" ]; then
-               export SSH_AUTH_SOCK=${HOME}/.gnupg/S.gpg-agent.ssh
-       fi
+       unset SSH_AGENT_PID
+       export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
 fi
 
 # Uncomment the following lines to start rxvt-unicode which has the ability to

Reply via email to