1##########
2# sensors_config: load calibration files.
3##########
4type sensors_config, domain;
5type sensors_config_exec, exec_type, file_type;
6type sensors_data_file, file_type, data_file_type;
7init_daemon_domain(sensors_config)
8file_type_auto_trans(sensors_config, system_data_file, sensors_data_file)
9
10# Execute toolbox commands
11allow sensors_config shell_exec:file rx_file_perms;
12allow sensors_config system_file:file execute_no_trans;
13
14# Mount /dev/block/platform/sdhci-tegra.3/by-name/PER
15allow sensors_config sensors_data_file:dir mounton;
16allow sensors_config sdcard_external:filesystem { mount unmount };
17allow sensors_config { sdcard_external block_device }:dir search;
18
19# Read from the mounted PER partition
20allow sensors_config sdcard_external:file r_file_perms;
21
22# Need to chmod and chown files (/data/lightsensor, /data/sensors)
23allow sensors_config self:capability { chown fowner };
24
25# Checked as a side effect on the chmod (don't allow)
26dontaudit sensors_config self:capability { fsetid };
27
28# Needed for mount/umount
29allow sensors_config self:capability sys_admin;
30
31# Tries to delete /data/calibration (don't allow)
32dontaudit sensors_config system_data_file:dir remove_name;
33dontaudit sensors_config self:capability dac_override;
34