Comment 15 for bug 1867417

Revision history for this message
James Henstridge (jamesh) wrote :

Some notes from a conversation on this issue:

Rather than adding /var/lib/snapd/hostfs/usr/share to XDG_DATA_DIRS, it would be better to add some other directory the snap controls to XDG_DATA_DIRS, and symlink in the data directories from hostfs that we are actually interested in (probably metainfo and maybe applications?). This would prevent unexpected data changing the behaviour of the snap.

While the symlinks are likely to be static, we probably can't bake it into the snap since Snapcraft and/or review-tools will complain about dangling symlinks pointing outside of the snap. Instead, a command-chain script could set up the directory and symlinks under $SNAP_USER_DATA or $SNAP_USER_COMMON. The command chain script could even do the $XDG_DATA_DIRS modification before chaining to the real executable.