systemd: introduce an interface for services using PrivateDevices=yes
When a service is configured with PrivateDevices=yes, its /dev directory has label tmpfs_t. This requires allowing more accesses in order for the service to use /dev. This is related to https://github.com/SELinuxProject/refpolicy/pull/61 Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
This commit is contained in:
parent
0b2ab72127
commit
a7e3407606
|
@ -76,6 +76,24 @@ interface(`systemd_log_parse_environment',`
|
|||
typeattribute $1 systemd_log_parse_env_type;
|
||||
')
|
||||
|
||||
######################################
|
||||
## <summary>
|
||||
## Allow domain to be used as a systemd service with a unit
|
||||
## that uses PrivateDevices=yes in section [Service].
|
||||
## </summary>
|
||||
## <param name="domain">
|
||||
## <summary>
|
||||
## Domain allowed access
|
||||
## </summary>
|
||||
## </param>
|
||||
#
|
||||
interface(`systemd_PrivateDevices',`
|
||||
# For services using PrivateDevices, systemd mounts a dedicated
|
||||
# tmpfs filesystem for the /dev, which gets label tmpfs_t.
|
||||
# Allow to traverse /dev and to read symlinks in /dev (for example /dev/log)
|
||||
fs_read_tmpfs_symlinks($1)
|
||||
')
|
||||
|
||||
#######################################
|
||||
## <summary>
|
||||
## Allow domain to read udev hwdb file
|
||||
|
|
Loading…
Reference in New Issue