GNOME Bugzilla – Bug 686934
Keyring ignores XDG_DATA_HOME environment variable
Last modified: 2021-06-18 10:40:07 UTC
Even tough I have set XDG_DATA_HOME to ~/local/share, keyring insists on keeping its files in ~/.local/share. `GLib.get_user_data_dir()` returns `~/local/share` both in Python and Looking Glass. Environment variable is set by /etc/profile.d/xorg.sh
Good point. I think that GKD_UTIL_IN_ENVIRONMENT[] in daemon/gkd-util.c needs patching for that variable. Are you interested in and able to make a patch?
I could make it, but before that I'd need to get to know GNOME build and testing systems so I could test/build my patch. If there's anyone who's willing to make a patch and has needed tools already set up, I'd be grateful.
Created attachment 227367 [details] [review] Waits for XDG_DATA_HOME environment variable Oh, I did it old style – by recompiling system package and restarting to see if it's working. Seems to work correctly – deleted .local directory doesn't appear again.
Thanks. Pushed to gnome-keyring 3.6.x branch, so this will be included in 3.6.2. Will also make its way to git master eventually.
As best I can tell, this is still a bug as of version 3.10.1. $ pacman -Q gnome-keyring gnome-keyring 3.10.1-2 $ echo ${XDG_DATA_HOME} /home/carl/.xdg/data $ ll /home/carl/.xdg/data/keyrings ls: cannot access /home/carl/.xdg/data/keyrings: No such file or directory $ ll /home/carl/.local/share/keyrings total 8.0K drwx------ 1 carl carl 52 Mar 19 07:54 ./ drwx------ 1 carl carl 16 Feb 27 07:31 ../ -rw------- 1 carl carl 1.3K Mar 18 08:12 login.keyring -rw------- 1 carl carl 207 Feb 27 07:31 user.keystore
Related bug: https://bugzilla.gnome.org/show_bug.cgi?id=613644 This has been fixed. The trick is that gnome-keyring is started by PAM before the files in /etc/profile.d/ are sourced. I resolved the issue by setting full paths for XDG variables in my user's pam environment file. $ cat ~/.pam_environment XDG_CONFIG_HOME=/home/carl/.xdg/config XDG_CACHE_HOME=/home/carl/.xdg/cache XDG_DATA_HOME=/home/carl/.xdg/data
This is still bugged in version 3.18.3 on Ubuntu 16.04. The workaround suggested in comment #6 does not work.
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/gnome-keyring/-/issues/ Thank you for your understanding and your help.