2012-01-04 18:33:27 +01:00
|
|
|
# gpsd - GPS daemon
|
|
|
|
type gpsd, domain;
|
|
|
|
type gpsd_exec, exec_type, file_type;
|
|
|
|
|
|
|
|
init_daemon_domain(gpsd)
|
|
|
|
net_domain(gpsd)
|
2013-10-29 19:42:36 +01:00
|
|
|
allow gpsd gps_data_file:dir rw_dir_perms;
|
|
|
|
allow gpsd gps_data_file:notdevfile_class_set create_file_perms;
|
2012-01-04 18:33:27 +01:00
|
|
|
# Socket is created by the daemon, not by init, and under /data/gps,
|
|
|
|
# not under /dev/socket.
|
|
|
|
type_transition gpsd gps_data_file:sock_file gps_socket;
|
2013-10-29 19:42:36 +01:00
|
|
|
allow gpsd gps_socket:sock_file create_file_perms;
|
|
|
|
# XXX Label sysfs files with a specific type?
|
|
|
|
allow gpsd sysfs:file rw_file_perms;
|
2012-08-13 12:09:39 +02:00
|
|
|
|
2013-10-29 19:42:36 +01:00
|
|
|
allow gpsd gps_device:chr_file rw_file_perms;
|
|
|
|
|
|
|
|
# Execute the shell or system commands.
|
|
|
|
allow gpsd shell_exec:file rx_file_perms;
|
|
|
|
allow gpsd system_file:file rx_file_perms;
|
2015-03-24 18:32:42 +01:00
|
|
|
|
|
|
|
###
|
|
|
|
### neverallow
|
|
|
|
###
|
|
|
|
|
|
|
|
# gpsd can never have capabilities other than block_suspend
|
|
|
|
neverallow gpsd self:capability *;
|
|
|
|
neverallow gpsd self:capability2 ~block_suspend;
|