GNOME Bugzilla – Bug 725801
Use a predictable $XDG_RUNTIME_DIR location for daemon
Last modified: 2014-09-01 14:00:03 UTC
gnome-keyring-daemon should use a predictable subdirectory of $XDG_RUNTIME_DIR. This way we can avoid the need for setting the $GNOME_KEYRING_CONTROL environment variable.
Created attachment 271124 [details] [review] daemon: Use $XDG_RUNTIME_DIR to create keyring socket directory We create a predictable location under $XDG_RUNTIME_DIR. GNOME does not support multiple GUI sessions per user, so using a predictable directory works well for us. If someone somewhere still wants an alternate location use the --control-directory argument.
Created attachment 271125 [details] [review] daemon: Stop exporting the $GNOME_KEYRING_CONTROL env variable In cases where we're using $XDG_RUNTIME_DIR to create a predictable control socket directory, stop setting the $GNOME_KEYRING_CONTROL environment variable. Note that we don't use the $XDG_RUNTIME_DIR fallback. This is because two of our clients don't link in GLib, both the pam and pkcs11 modules. Getting involved in the whole tree of fallback possibilities for how to resolve $XDG_RUNTIME_DIR is not something I'm interested in duplicating. So instead what we do is if $XDG_RUNTIME_DIR is not set, we fall back to using the old $GNOME_KEYRING_CONTROL environment variable. We use the GLib logic when looking for XDG_RUNTIME_DIR. The variable is considered present even when empty.
This can potentially break some code, e.g. https://bitbucket.org/kang/python-keyring-lib/src/c68392688f366d84114ef9efebcdc89075228596/keyring/backends/Gnome.py?at=default#cl-23 (I will fix that one).
Created attachment 271142 [details] [review] daemon: Stop exposing a GNOME_KEYRING_PID variable We exit with the DBus session bus. Remove this clutter from the environment. PAM module no longer cares about the lifetime of the deamon, except in one case: where it started the daemon in order to change a password and the auto_start argument wasn't set.
Thanks for the heads up Dmitry ... just in case it's useful here's a pull request to fix python-keyring-lib ... https://bitbucket.org/kang/python-keyring-lib/pull-request/42/gnome-keyring-no-longer-sets-a/diff
Attachment 271124 [details] pushed as 275a696 - daemon: Use $XDG_RUNTIME_DIR to create keyring socket directory Attachment 271125 [details] pushed as 2ca51a0 - daemon: Stop exporting the $GNOME_KEYRING_CONTROL env variable Attachment 271142 [details] pushed as 90a3ae6 - daemon: Stop exposing a GNOME_KEYRING_PID variable
*** Bug 711222 has been marked as a duplicate of this bug. ***