Comment 235 for bug 1575053

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

Hey, a fellow snapd developer here. We do not use XDG locations for the following reasons:

1) They are configurable, per user, which would require per-user confinement that we currently do not support.

2) Ignoring that, the standard locations are not followed by *all* software uniformly so we need a location for things that do not fit XDG anyway. As an example, a snap of something like vim would use ~/.vim and ~/.vimrc outside of confinement. That would need mapping to _a_ path inside the confinement. We would have to have some form of ~/snap/vim/current/.vim anyway. Where would that go?

3) In addition to that, snapd manages application data and creates two distinct locations, the per-revision data set ~/snap/$SNAP_NAME/$SNAP_REVISION and ~/snap/$SNAP_NAME/common. This is essential to handle "snap revert" which rolls back both the application code and application data. There's no clear mapping of that to any of the XDG documented locations.

There may be additional reasons, I'd have to go back to my notes from the original design of this location many years ago. As a person who implements the lower-level parts of snapd, I can really say that doing anything about 1) is extremely hard and security sensitive.