XDG_SESSION_TMPDIR
Dan Winship
danw at gnome.org
Mon Apr 26 06:22:38 PDT 2010
On 04/23/2010 05:19 PM, Ryan Lortie wrote:
> Applications should follow reasonable namespacing in order to avoid
> stomping on other users of the directory. Specifically, applications
> should prefix any created file or subdirectory with their own name
The ".lock" file in your implementation does not obey that rule, though
you should probably just say that the implementation owns all dotfiles
and users should only create non-dot files.
> If no local filesystems suitable for session temporary directories exist
> then the implementation must deal with this by not setting the
> XDG_SESSION_TMPDIR environment variable.
What will dconf do in this case? Fail completely? If not, then why can't
the XDG_SESSION_TMPDIR implementation do something like what dconf does?
> One possible method is to have a small program that runs as part of the
> session.
BOOOO! We have plenty of session daemons already. There is no reason
this couldn't be added to gnome-session, and possibly no reason it
couldn't be added to dbus-daemon either.
> I'm attaching a quick hacked up proof of concept
You need to check that /dev and /dev/shm have correct ownership and
permissions, and realpath() them if they're symlinks. (You might want to
put something about "correct ownership and permissions" in the spec too.)
> I used /dev/shm since that's a world-writable tmpfs that's available on
> most Linux boxes these days. I don't know if that's a good idea, but it
> works.
The default implementation ought to have some sort of minimal dumb
fallback (eg, to /tmp) for non-Linux.
-- Dan
More information about the xdg
mailing list