Public bug reported:

Hello, I'm using ubuntu v14 with unity. The problem I'm having is with
SSH_AUTH_SOCK. I want to create an X-session and have my unix socket set
in SSH_AUTH_SOCK. The session is created successfully but if I open
terminal into that session and see the content of SSH_AUTH_SOCK, its
different from what I've set.

I investigated this issue and found that gnome-keyring checks if
SSH_AUTH_SOCK is empty in /usr/share/upstart/sessions/gnome-keyring-
ssh.conf and if it is, then it creates the socket and sets
SSH_AUTH_SOCK. I've even added logs in this file and it clearly exits in
[ -z "$SSH_AUTH_SOCK" ] || { stop; exit 0; }. Then I set the X-GNOME-
Autostart-enabled=false in ~/.config/autostart/gnome-keyring-ssh.desktop
and for some reason the value in SSH_AUTH_SOCK was correct(the one that
I've set in init).

I deleted X-GNOME-Autostart-enabled=false and then manually checked and
some of the proccesses in this session had my value in SSH_AUTH_SOCK and
some of them didn't. I checked with lsof and the other SSH_AUTH_SOCK was
listen by gnome-keyring, so I assumed that when gnome-keyring is
launched, it creates its own SSH_AUTH_SOCK and overwrites the env

I downloaded the source code of gnome-keyring and found that it creates
a SSH_AUTH_SOCK and sets it in it's environment(but for some reason when
I check /proc/<pid_of_gnome-keyring>/environ there is my path in
SSH_AUTH_SOCK). I also checked if X-GNOME-Autostart-enabled was
hardcoded in gnome-keyring but it wasn't.

I've searched in internet and found that gnome-session might be involved
in this. Downloaded the source code of gnome-sesison and it clearly has
hardcoded X-GNOME-Autostart-enabled. Then I found this interesting
comment in it:

capture output from gnome-keyring-daemon and set SSH_AUTH_SOCK and
        GNOME_KEYRING_PID env variables properly.

and as I understand(please correct me if I'm wrong) those two procceses
(gnome-keyring and gnome-session) communicate with each other. gnome-
session process checks if X-GNOME-Autostart-enabled is set and if it
isn't it asks gnome-keyring to create new SSH_AUTH_SOCK.

So it appears that gnome-keyring doesn't care what is in
/usr/share/upstart/sessions/gnome-keyring-ssh.conf. Plus it doesn't care
if SSH_AUTH_SOCK is set or not. The only option to disable gnome-keyring
from creating one, is to set the X-GNOME-Autostart-enabled.

P.S. On ubuntu v16 when I create session and open terminal in it, there
is my path set in SSH_ATUH_SOCK.

My info ->

** Affects: gnome-keyring (Ubuntu)
     Importance: Undecided
         Status: New

You received this bug notification because you are a member of Ubuntu
Desktop Bugs, which is subscribed to gnome-keyring in Ubuntu.

  SSH_AUTH_SOCK is overwritten by gnome-keyring

To manage notifications about this bug go to:

desktop-bugs mailing list

Reply via email to