selinux-policy/refpolicy/policy/modules/system/clock.if

96 lines
2.2 KiB
Plaintext
Raw Normal View History

2005-06-07 22:36:07 +00:00
## <module name="clock" layer="system">
2005-06-01 14:17:43 +00:00
## <summary>Policy for reading and setting the hardware clock.</summary>
2005-05-05 21:40:32 +00:00
########################################
2005-06-13 17:35:46 +00:00
## <interface name="clock_domtrans">
## <description>
## Execute hwclock in the clock domain.
## </description>
## <parameter name="domain">
## The type of the process performing this action.
## </parameter>
## </interface>
2005-05-12 20:50:09 +00:00
#
2005-06-13 17:35:46 +00:00
define(`clock_domtrans',`
2005-06-17 17:59:26 +00:00
gen_require(`
type hwclock_t, hwclock_exec_t;
class fd use;
class fifo_file rw_file_perms;
')
2005-06-08 13:41:05 +00:00
domain_auto_trans($1,hwclock_exec_t,hwclock_t)
allow $1 hwclock_t:fd use;
allow hwclock_t $1:fd use;
allow hwclock_t $1:fifo_file rw_file_perms;
allow hwclock_t $1:process sigchld;
2005-05-12 20:50:09 +00:00
')
########################################
2005-06-13 17:35:46 +00:00
## <interface name="clock_run">
## <description>
## Execute hwclock in the clock domain, and
## allow the specified role the hwclock domain.
## </description>
## <parameter name="domain">
## The type of the process performing this action.
## </parameter>
## <parameter name="role">
## The role to be allowed the clock domain.
## </parameter>
## <parameter name="terminal">
## The type of the terminal allow the clock domain to use.
## </parameter>
## </interface>
#
2005-06-13 17:35:46 +00:00
define(`clock_run',`
2005-06-17 17:59:26 +00:00
gen_require(`
type hwclock_t;
class chr_file { getattr read write ioctl };
')
2005-06-13 17:35:46 +00:00
clock_domtrans($1)
role $2 types hwclock_t;
allow hwclock_t $3:chr_file { getattr read write ioctl };
')
2005-06-07 22:36:07 +00:00
########################################
2005-06-13 17:35:46 +00:00
## <interface name="clock_exec">
2005-06-07 22:36:07 +00:00
## <description>
## Execute hwclock
## </description>
## <parameter name="domain">
## The type of the process performing this action.
## </parameter>
## </interface>
2005-05-12 20:50:09 +00:00
#
2005-06-13 17:35:46 +00:00
define(`clock_exec',`
2005-06-17 17:59:26 +00:00
gen_require(`
type hwclock_exec_t;
')
2005-06-08 13:41:05 +00:00
can_exec($1,hwclock_exec_t)
2005-05-12 20:50:09 +00:00
')
2005-06-07 22:36:07 +00:00
########################################
2005-06-13 17:35:46 +00:00
## <interface name="clock_rw_adjtime">
2005-06-07 22:36:07 +00:00
## <description>
## Allow executing domain to modify clock drift
## </description>
## <parameter name="domain">
## The type of the process performing this action.
## </parameter>
## </interface>
2005-05-05 21:40:32 +00:00
#
2005-06-13 17:35:46 +00:00
define(`clock_rw_adjtime',`
2005-06-17 17:59:26 +00:00
gen_require(`
type adjtime_t;
class file rw_file_perms;
')
2005-06-08 13:41:05 +00:00
allow $1 adjtime_t:file rw_file_perms;
2005-06-17 17:59:26 +00:00
files_list_etc($1)
2005-05-05 21:40:32 +00:00
')
2005-06-01 14:17:43 +00:00
## </module>