From 32f43be5739c702c1ef451602fafededd670acf5 Mon Sep 17 00:00:00 2001 From: Pratham Patel Date: Tue, 20 Jan 2026 23:08:57 +0530 Subject: [PATCH] start-cosmic: set SSH_AUTH_SOCK only if the correct value can be determined --- data/start-cosmic | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/data/start-cosmic b/data/start-cosmic index a0ea0d0..47e9292 100755 --- a/data/start-cosmic +++ b/data/start-cosmic @@ -49,8 +49,14 @@ if [ -d "/run/user/$(id -u)/keyring" ]; then echo "gnome-keyring-daemon not found in PATH" >&2 fi - # Set SSH_AUTH_SOCK to the standard gnome-keyring socket - export SSH_AUTH_SOCK="/run/user/$(id -u)/keyring/ssh" + # Only set SSH_AUTH_SOCK if the socket actually exists. Either + # set the correct one, or don't set one at all. Don't set the + # wrong value. + if [ -S "/run/user/$(id -u)/gcr/ssh" ]; then + export SSH_AUTH_SOCK="/run/user/$(id -u)/gcr/ssh" + elif [ -S "/run/user/$(id -u)/keyring/ssh" ]; then + export SSH_AUTH_SOCK="/run/user/$(id -u)/keyring/ssh" + fi fi if command -v systemctl >/dev/null; then