freedesktop location support
Introduce various freedesktop locations, based on the base directory
specification [1]. The new locations are introduced as a separate module
to keep the rules related to these specifications isolated from the main
user domain (which is already one of the biggest modules code-wise).
Right now, two distinct location groups are provided, one being the set
of locations that will have domain-specific types, and one that remains
generic for end users.
The first set of types are:
- XDG Cache location, meant for non-essential cached data. The base type
here is xdg_cache_t, which is generally at $HOME/.cache
- XDG Data location, for user-specific data. The base type here is
xdg_data_t, which is generally at $HOME/.local
- XDG Config location, for user-specific configuration files. The base
type here is xdg_config_t, which is generally at $HOME/.config
The idea here is to provide support for domain-specific files as well.
For instance, Chromium has its user-specific configuration files in
~/.config/chromium, which is then marked as chromium_xdg_config_t.
This allows for isolation of potentially sensitive information from
regular user application domains. Firefox for instance should not be
able to read user configuration data from unrelated applications.
The second set of types are:
- User documents, with xdg_documents_t as the type. This is
generally for the ~/Documents location.
- User downloads, with xdg_downloads_t as the type. This is
generally for the ~/Downloads location.
- User music, with xdg_music_t as the type. This is generally for
the ~/Music location.
- User pictures, with xdg_pictures_t as the type. This is generally
for the ~/Pictures location.
- User videos, with xdg_videos_t as the type. This is generally for
the ~/Videos location.
Alongside the type definitions, a number of access interfaces are
defined to support the use of these types, and for the first set to
enable the necessary file transitions.
[1] https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2018-03-25 11:56:38 +00:00
|
|
|
HOME_DIR/\.cache(/.*)? gen_context(system_u:object_r:xdg_cache_t,s0)
|
|
|
|
HOME_DIR/\.config(/.*)? gen_context(system_u:object_r:xdg_config_t,s0)
|
|
|
|
HOME_DIR/\.local(/.*)? gen_context(system_u:object_r:xdg_data_t,s0)
|
|
|
|
HOME_DIR/Documents(/.*)? gen_context(system_u:object_r:xdg_documents_t,s0)
|
|
|
|
HOME_DIR/Downloads(/.*)? gen_context(system_u:object_r:xdg_downloads_t,s0)
|
|
|
|
HOME_DIR/Music(/.*)? gen_context(system_u:object_r:xdg_music_t,s0)
|
|
|
|
HOME_DIR/Pictures(/.*)? gen_context(system_u:object_r:xdg_pictures_t,s0)
|
|
|
|
HOME_DIR/Videos(/.*)? gen_context(system_u:object_r:xdg_videos_t,s0)
|