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 724412 - GLib mappedfile.c test uses g_get_user_runtime_dir instead of a temporary directory
GLib mappedfile.c test uses g_get_user_runtime_dir instead of a temporary dir...
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
: 744273 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2014-02-15 10:59 UTC by Luca Bruno
Modified: 2017-11-21 12:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
mappedfile test: use temp dir instead of user runtime dir (1.39 KB, patch)
2014-02-16 18:59 UTC, Luca Bruno
committed Details | Review

Description Luca Bruno 2014-02-15 10:59:13 UTC
Looking at https://git.gnome.org/browse/glib/tree/glib/tests/mappedfile.c#n87
it creates temporary files into the user runtime directory (usually $HOME/.cache).
This breaks in case .cache does not exist.
Why not using the temporary directory instead instead of polluting and never cleaning up the user .cache?
Comment 1 Allison Karlitskaya (desrt) 2014-02-16 14:52:43 UTC
The runtime directory is not usually ~/.cache/ -- that's only the fallback for if XDG_RUNTIME_DIR has not been properly set.

That said, I sort of agree -- creating these sorts of temp files, even in XDG_RUNTIME_DIR, is a bit weird.
Comment 2 Luca Bruno 2014-02-16 18:59:52 UTC
Created attachment 269322 [details] [review]
mappedfile test: use temp dir instead of user runtime dir
Comment 3 Luca Bruno 2014-02-17 08:14:43 UTC
There are more of these, will update the patch.
Comment 4 Luca Bruno 2014-02-18 00:00:03 UTC
Some tests use dbus, and apparently dbus creates a .dbus-keyring in $HOME which defeats the purpose of the patch.
Comment 5 Philip Withnall 2017-11-16 11:20:11 UTC
Review of attachment 269322 [details] [review]:

Looks good to me, thanks.
Comment 6 Philip Withnall 2017-11-21 12:01:20 UTC
*** Bug 744273 has been marked as a duplicate of this bug. ***