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">
Dominick Grift 1976dd
##	<summary>
Chris PeBenito da3ed0
##	Domain allowed to transition.
Dominick Grift 1976dd
##	</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
## <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 8a8b24
		type lircd_var_run_t, lircd_t;
Chris PeBenito 3f67f7
	')
Chris PeBenito da3ed0
Chris PeBenito 3f67f7
	files_search_pids($1)
Chris PeBenito 8a8b24
	stream_connect_pattern($1, lircd_var_run_t, lircd_var_run_t, lircd_t)
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">
Dominick Grift 1976dd
##	<summary>
Chris PeBenito a72e42
##	Domain allowed access.
Dominick Grift 1976dd
##	</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 8a8b24
##	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(`
Dominick Grift 8f0b74
		type lircd_t, lircd_var_run_t, lircd_etc_t;
Dominick Grift 8f0b74
		type lircd_initrc_exec_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
Dominick Grift 61f406
	files_list_etc($1)
Chris PeBenito da3ed0
	admin_pattern($1, lircd_etc_t)
Chris PeBenito da3ed0
Dominick Grift 61f406
	files_list_pids($1)
Chris PeBenito da3ed0
	admin_pattern($1, lircd_var_run_t)
Chris PeBenito da3ed0
')