After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 725801 - Use a predictable $XDG_RUNTIME_DIR location for daemon
Use a predictable $XDG_RUNTIME_DIR location for daemon
Status: RESOLVED FIXED
Product: gnome-keyring
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GNOME keyring maintainer(s)
GNOME keyring maintainer(s)
: 711222 (view as bug list)
Depends on:
Blocks: 711810
 
 
Reported: 2014-03-06 07:41 UTC by Stef Walter
Modified: 2014-09-01 14:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
daemon: Use $XDG_RUNTIME_DIR to create keyring socket directory (5.65 KB, patch)
2014-03-06 17:42 UTC, Stef Walter
committed Details | Review
daemon: Stop exporting the $GNOME_KEYRING_CONTROL env variable (28.22 KB, patch)
2014-03-06 17:42 UTC, Stef Walter
committed Details | Review
daemon: Stop exposing a GNOME_KEYRING_PID variable (7.36 KB, patch)
2014-03-06 20:20 UTC, Stef Walter
committed Details | Review

Description Stef Walter 2014-03-06 07:41:02 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.
Comment 1 Stef Walter 2014-03-06 17:42:01 UTC
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.
Comment 2 Stef Walter 2014-03-06 17:42:27 UTC
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.
Comment 3 Dmitry Shachnev 2014-03-06 17:48:38 UTC
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).
Comment 4 Stef Walter 2014-03-06 20:20:32 UTC
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.
Comment 5 Stef Walter 2014-03-06 20:34:21 UTC
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
Comment 6 Stef Walter 2014-03-12 14:58:28 UTC
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
Comment 7 Stef Walter 2014-09-01 14:00:03 UTC
*** Bug 711222 has been marked as a duplicate of this bug. ***