Chris PeBenito e32d52
## <summary>Policy for reading and setting the hardware clock.</summary>
Chris PeBenito b2b38c
Chris PeBenito daa0e0
########################################
Chris PeBenito f7ebea
## <summary>
Chris PeBenito 414e41
##	Execute hwclock in the clock domain.
Chris PeBenito f7ebea
## </summary>
Chris PeBenito 414e41
## <param name="domain">
Chris PeBenito 414e41
##	The type of the process performing this action.
Chris PeBenito 414e41
## </param>
Chris PeBenito 075c4f
#
Chris PeBenito 199895
interface(`clock_domtrans',`
Chris PeBenito 139520
	gen_require(`
Chris PeBenito 139520
		type hwclock_t, hwclock_exec_t;
Chris PeBenito 139520
		class fd use;
Chris PeBenito 139520
		class fifo_file rw_file_perms;
Chris PeBenito 139520
	')
Chris PeBenito 0c73cd
Chris PeBenito a71972
	domain_auto_trans($1,hwclock_exec_t,hwclock_t)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 hwclock_t:fd use;
Chris PeBenito 0c73cd
	allow hwclock_t $1:fd use;
Chris PeBenito 0c73cd
	allow hwclock_t $1:fifo_file rw_file_perms;
Chris PeBenito 0c73cd
	allow hwclock_t $1:process sigchld;
Chris PeBenito 075c4f
')
Chris PeBenito 075c4f
Chris PeBenito daa0e0
########################################
Chris PeBenito f7ebea
## <summary>
Chris PeBenito 414e41
##	Execute hwclock in the clock domain, and
Chris PeBenito 414e41
##	allow the specified role the hwclock domain.
Chris PeBenito f7ebea
## </summary>
Chris PeBenito 414e41
## <param name="domain">
Chris PeBenito 414e41
##	The type of the process performing this action.
Chris PeBenito 414e41
## </param>
Chris PeBenito 414e41
## <param name="role">
Chris PeBenito 414e41
##	The role to be allowed the clock domain.
Chris PeBenito 414e41
## </param>
Chris PeBenito 414e41
## <param name="terminal">
Chris PeBenito 414e41
##	The type of the terminal allow the clock domain to use.
Chris PeBenito 414e41
## </param>
Chris PeBenito daa0e0
#
Chris PeBenito 199895
interface(`clock_run',`
Chris PeBenito 139520
	gen_require(`
Chris PeBenito 139520
		type hwclock_t;
Chris PeBenito 139520
		class chr_file { getattr read write ioctl };
Chris PeBenito 139520
	')
Chris PeBenito 0c73cd
Chris PeBenito c9428d
	clock_domtrans($1)
Chris PeBenito 0c73cd
	role $2 types hwclock_t;
Chris PeBenito 0c73cd
	allow hwclock_t $3:chr_file { getattr read write ioctl };
Chris PeBenito daa0e0
')
Chris PeBenito daa0e0
Chris PeBenito 3865d6
########################################
Chris PeBenito f7ebea
##     <summary>
Chris PeBenito 58c3da
##             Execute hwclock in the caller domain.
Chris PeBenito f7ebea
##     </summary>
Chris PeBenito 261e0e
##     <param name="domain">
Chris PeBenito 3865d6
##             The type of the process performing this action.
Chris PeBenito 261e0e
##     </param>
Chris PeBenito 075c4f
#
Chris PeBenito 199895
interface(`clock_exec',`
Chris PeBenito 139520
	gen_require(`
Chris PeBenito 139520
		type hwclock_exec_t;
Chris PeBenito 139520
	')
Chris PeBenito 0c73cd
Chris PeBenito a71972
	can_exec($1,hwclock_exec_t)
Chris PeBenito 075c4f
')
Chris PeBenito 075c4f
Chris PeBenito 3865d6
########################################
Chris PeBenito f7ebea
##     <summary>
Chris PeBenito 3865d6
##             Allow executing domain to modify clock drift
Chris PeBenito f7ebea
##     </summary>
Chris PeBenito 261e0e
##     <param name="domain">
Chris PeBenito 3865d6
##             The type of the process performing this action.
Chris PeBenito 261e0e
##     </param>
Chris PeBenito b2b38c
#
Chris PeBenito 199895
interface(`clock_rw_adjtime',`
Chris PeBenito 139520
	gen_require(`
Chris PeBenito 139520
		type adjtime_t;
Chris PeBenito 139520
		class file rw_file_perms;
Chris PeBenito 139520
	')
Chris PeBenito 0c73cd
Chris PeBenito a71972
	allow $1 adjtime_t:file rw_file_perms;
Chris PeBenito 139520
	files_list_etc($1)
Chris PeBenito b2b38c
')
Chris PeBenito e32d52