Chris PeBenito 17de1b
## <summary>Policy for reading and setting the hardware clock.</summary>
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Execute hwclock in the clock domain.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The type of the process performing this action.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`clock_domtrans',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type hwclock_t, hwclock_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	domain_auto_trans($1,hwclock_exec_t,hwclock_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $1 hwclock_t:fd use;
Chris PeBenito 17de1b
	allow hwclock_t $1:fd use;
Chris PeBenito 17de1b
	allow hwclock_t $1:fifo_file rw_file_perms;
Chris PeBenito 17de1b
	allow hwclock_t $1:process sigchld;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Execute hwclock in the clock domain, and
Chris PeBenito 17de1b
##	allow the specified role the hwclock domain.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The type of the process performing this action.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
## <param name="role">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The role to be allowed the clock domain.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
## <param name="terminal">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The type of the terminal allow the clock domain to use.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`clock_run',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type hwclock_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	clock_domtrans($1)
Chris PeBenito 17de1b
	role $2 types hwclock_t;
Chris PeBenito 17de1b
	allow hwclock_t $3:chr_file { getattr read write ioctl };
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
##     <summary>
Chris PeBenito 17de1b
##             Execute hwclock in the caller domain.
Chris PeBenito 17de1b
##     </summary>
Chris PeBenito 17de1b
##     <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##             The type of the process performing this action.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
##     </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`clock_exec',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type hwclock_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	can_exec($1,hwclock_exec_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
##     <summary>
Chris PeBenito 17de1b
##             Allow executing domain to modify clock drift
Chris PeBenito 17de1b
##     </summary>
Chris PeBenito 17de1b
##     <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##             The type of the process performing this action.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
##     </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`clock_rw_adjtime',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type adjtime_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $1 adjtime_t:file rw_file_perms;
Chris PeBenito 17de1b
	files_list_etc($1)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b