Chris PeBenito da3ed0
## <summary>Linux infared remote control daemon</summary>
Chris PeBenito da3ed0
Chris PeBenito da3ed0
########################################
Chris PeBenito da3ed0
## <summary>
Chris PeBenito da3ed0
##	Execute a domain transition to run lircd.
Chris PeBenito da3ed0
## </summary>
Chris PeBenito da3ed0
## <param name="domain">
Chris PeBenito da3ed0
## <summary>
Chris PeBenito da3ed0
##	Domain allowed to transition.
Chris PeBenito da3ed0
## </summary>
Chris PeBenito da3ed0
## </param>
Chris PeBenito da3ed0
#
Chris PeBenito da3ed0
interface(`lircd_domtrans',`
Chris PeBenito da3ed0
	gen_require(`
Chris PeBenito da3ed0
		type lircd_t, lircd_exec_t;
Chris PeBenito da3ed0
	')
Chris PeBenito da3ed0
Chris PeBenito da3ed0
	domain_auto_trans($1, lircd_exec_t, lircd_t)
Chris PeBenito da3ed0
Chris PeBenito da3ed0
')
Chris PeBenito da3ed0
Chris PeBenito da3ed0
######################################
Chris PeBenito da3ed0
## <summary>
Chris PeBenito 3f67f7
##	Connect to lircd over a unix domain
Chris PeBenito 3f67f7
##	stream socket.
Chris PeBenito da3ed0
## </summary>
Chris PeBenito da3ed0
## <param name="domain">
Chris PeBenito 3f67f7
##	<summary>
Chris PeBenito 3f67f7
##	Domain allowed access.
Chris PeBenito 3f67f7
##	</summary>
Chris PeBenito da3ed0
## </param>
Chris PeBenito da3ed0
#
Chris PeBenito da3ed0
interface(`lircd_stream_connect',`
Chris PeBenito 3f67f7
	gen_require(`
Chris PeBenito 3f67f7
		type lircd_sock_t, lircd_t;
Chris PeBenito 3f67f7
	')
Chris PeBenito da3ed0
Chris PeBenito 3f67f7
	allow $1 lircd_t:unix_stream_socket connectto;
Chris PeBenito 3f67f7
	allow $1 lircd_sock_t:sock_file write_sock_file_perms;
Chris PeBenito 3f67f7
	files_search_pids($1)
Chris PeBenito da3ed0
')
Chris PeBenito da3ed0
Chris PeBenito da3ed0
#######################################
Chris PeBenito da3ed0
## <summary>
Chris PeBenito 3f67f7
##	Read lircd etc file
Chris PeBenito da3ed0
## </summary>
Chris PeBenito da3ed0
## <param name="domain">
Chris PeBenito da3ed0
## <summary>
Chris PeBenito 3f67f7
##	The type of the process performing this action.
Chris PeBenito da3ed0
## </summary>
Chris PeBenito da3ed0
## </param>
Chris PeBenito da3ed0
#
Chris PeBenito da3ed0
interface(`lircd_read_config',`
Chris PeBenito da3ed0
	gen_require(`
Chris PeBenito da3ed0
		type lircd_etc_t;
Chris PeBenito 3f67f7
	')
Chris PeBenito da3ed0
Chris PeBenito da3ed0
	read_files_pattern($1, lircd_etc_t, lircd_etc_t)
Chris PeBenito da3ed0
')
Chris PeBenito da3ed0
Chris PeBenito da3ed0
########################################
Chris PeBenito da3ed0
## <summary>
Chris PeBenito da3ed0
##	All of the rules required to administrate 
Chris PeBenito da3ed0
##	a lircd environment
Chris PeBenito da3ed0
## </summary>
Chris PeBenito da3ed0
## <param name="domain">
Chris PeBenito da3ed0
##	<summary>
Chris PeBenito da3ed0
##	Domain allowed access.
Chris PeBenito da3ed0
##	</summary>
Chris PeBenito da3ed0
## </param>
Chris PeBenito da3ed0
## <param name="role">
Chris PeBenito da3ed0
##	<summary>
Chris PeBenito da3ed0
##	The role to be allowed to manage the syslog domain.
Chris PeBenito da3ed0
##	</summary>
Chris PeBenito da3ed0
## </param>
Chris PeBenito da3ed0
## <rolecap/>
Chris PeBenito da3ed0
#
Chris PeBenito da3ed0
interface(`lircd_admin',`
Chris PeBenito da3ed0
	gen_require(`
Chris PeBenito da3ed0
		type lircd_t, lircd_var_run_t, lircd_sock_t;
Chris PeBenito da3ed0
		type lircd_initrc_exec_t, lircd_etc_t;
Chris PeBenito da3ed0
	')
Chris PeBenito da3ed0
Chris PeBenito da3ed0
	allow $1 lircd_t:process { ptrace signal_perms };
Chris PeBenito da3ed0
	ps_process_pattern($1, lircd_t)
Chris PeBenito da3ed0
Chris PeBenito da3ed0
	init_labeled_script_domtrans($1, lircd_initrc_exec_t)
Chris PeBenito da3ed0
	domain_system_change_exemption($1)
Chris PeBenito da3ed0
	role_transition $2 lircd_initrc_exec_t system_r;
Chris PeBenito da3ed0
	allow $2 system_r;
Chris PeBenito da3ed0
Chris PeBenito da3ed0
	files_search_etc($1)
Chris PeBenito da3ed0
	admin_pattern($1, lircd_etc_t)
Chris PeBenito da3ed0
Chris PeBenito da3ed0
	files_search_pids($1)
Chris PeBenito da3ed0
	admin_pattern($1, lircd_var_run_t)
Chris PeBenito da3ed0
Chris PeBenito da3ed0
	admin_pattern($1, lircd_sock_t)
Chris PeBenito da3ed0
')