Chris PeBenito a5ef55
## <summary>Reserve well-known ports in the RPC port range.</summary>
Chris PeBenito a5ef55
Chris PeBenito a5ef55
########################################
Chris PeBenito a5ef55
## <summary>
Chris PeBenito a5ef55
##	Execute a domain transition to run portreserve.
Chris PeBenito a5ef55
## </summary>
Chris PeBenito a5ef55
## <param name="domain">
Chris PeBenito a5ef55
##	<summary>
Chris PeBenito a5ef55
##	Domain allowed to transition.
Chris PeBenito a5ef55
##	</summary>
Chris PeBenito a5ef55
## </param>
Chris PeBenito a5ef55
#
Chris PeBenito a5ef55
interface(`portreserve_domtrans',`
Chris PeBenito a5ef55
	gen_require(`
Chris PeBenito a5ef55
		type portreserve_t, portreserve_exec_t;
Chris PeBenito a5ef55
	')
Chris PeBenito a5ef55
Chris PeBenito a5ef55
	domtrans_pattern($1, portreserve_exec_t, portreserve_t)
Chris PeBenito a5ef55
')
Chris PeBenito a5ef55
Dan Walsh 3eaa99
########################################
Dan Walsh 3eaa99
## <summary>
Dan Walsh 3eaa99
##	Execute portreserve in the portreserve domain.
Dan Walsh 3eaa99
## </summary>
Dan Walsh 3eaa99
## <param name="domain">
Dan Walsh 3eaa99
##	<summary>
Dominick Grift 8ab34f
##	Domain allowed to transition.
Dan Walsh 3eaa99
##	</summary>
Dan Walsh 3eaa99
## </param>
Dan Walsh 3eaa99
#
Dominick Grift 624f2f
interface(`portreserve_initrc_domtrans',`
Dan Walsh 3eaa99
	gen_require(`
Dan Walsh 3eaa99
		type portreserve_initrc_exec_t;
Dan Walsh 3eaa99
	')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	init_labeled_script_domtrans($1, portreserve_initrc_exec_t)
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
Chris PeBenito a5ef55
#######################################
Chris PeBenito a5ef55
## <summary>
Chris PeBenito a5ef55
##	Allow the specified domain to read
Chris PeBenito a5ef55
##	portreserve etcuration files.
Chris PeBenito a5ef55
## </summary>
Chris PeBenito a5ef55
## <param name="domain">
Chris PeBenito a5ef55
##	<summary>
Chris PeBenito a5ef55
##	Domain allowed access.
Chris PeBenito a5ef55
##	</summary>
Chris PeBenito a5ef55
## </param>
Chris PeBenito a5ef55
## <rolecap/>
Chris PeBenito a5ef55
#
Chris PeBenito a5ef55
interface(`portreserve_read_config',`
Chris PeBenito a5ef55
	gen_require(`
Chris PeBenito a5ef55
		type portreserve_etc_t;
Chris PeBenito a5ef55
	')
Chris PeBenito a5ef55
Chris PeBenito a5ef55
	files_search_etc($1)
Chris PeBenito a5ef55
	allow $1 portreserve_etc_t:dir list_dir_perms;
Chris PeBenito a5ef55
	read_files_pattern($1, portreserve_etc_t, portreserve_etc_t)
Chris PeBenito a5ef55
	read_lnk_files_pattern($1, portreserve_etc_t, portreserve_etc_t)
Chris PeBenito a5ef55
')
Chris PeBenito a5ef55
Chris PeBenito a5ef55
#######################################
Chris PeBenito a5ef55
## <summary>
Chris PeBenito a5ef55
##	Allow the specified domain to manage
Chris PeBenito a5ef55
##	portreserve etcuration files.
Chris PeBenito a5ef55
## </summary>
Chris PeBenito a5ef55
## <param name="domain">
Chris PeBenito a5ef55
##	<summary>
Chris PeBenito a5ef55
##	Domain allowed access.
Chris PeBenito a5ef55
##	</summary>
Chris PeBenito a5ef55
## </param>
Chris PeBenito a5ef55
#
Chris PeBenito a5ef55
interface(`portreserve_manage_config',`
Chris PeBenito a5ef55
	gen_require(`
Chris PeBenito a5ef55
		type portreserve_etc_t;
Chris PeBenito a5ef55
	')
Chris PeBenito a5ef55
Chris PeBenito a5ef55
	files_search_etc($1)
Chris PeBenito a5ef55
	manage_dirs_pattern($1, portreserve_etc_t, portreserve_etc_t)
Chris PeBenito a5ef55
	manage_files_pattern($1, portreserve_etc_t, portreserve_etc_t)
Chris PeBenito a5ef55
	read_lnk_files_pattern($1, portreserve_etc_t, portreserve_etc_t)
Chris PeBenito a5ef55
')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
########################################
Dan Walsh 3eaa99
## <summary>
Dan Walsh 3eaa99
##	All of the rules required to administrate
Dan Walsh 3eaa99
##	an portreserve environment.
Dan Walsh 3eaa99
## </summary>
Dan Walsh 3eaa99
## <param name="domain">
Dan Walsh 3eaa99
##	<summary>
Dan Walsh 3eaa99
##	Domain allowed access.
Dan Walsh 3eaa99
##	</summary>
Dan Walsh 3eaa99
## </param>
Dan Walsh 3eaa99
## <param name="role">
Dan Walsh 3eaa99
##	<summary>
Dan Walsh 3eaa99
##	Role allowed access.
Dan Walsh 3eaa99
##	</summary>
Dan Walsh 3eaa99
## </param>
Dominick Grift 55c2e0
## <rolecap/>
Dan Walsh 3eaa99
#
Dominick Grift 624f2f
interface(`portreserve_admin',`
Dan Walsh 3eaa99
	gen_require(`
Dominick Grift 8f0b74
		type portreserve_t, portreserve_etc_t, portreserve_var_run_t;
Dominick Grift 8f0b74
		type portreserve_initrc_exec_t;
Dan Walsh 3eaa99
	')
Dan Walsh 3eaa99
Dominick Grift 39e118
	allow $1 portreserve_t:process { ptrace signal_perms };
Dominick Grift 39e118
	ps_process_pattern($1, portreserve_t)
Dominick Grift 624f2f
Dan Walsh 3eaa99
	portreserve_initrc_domtrans($1)
Dan Walsh 3eaa99
	domain_system_change_exemption($1)
Dan Walsh 3eaa99
	role_transition $2 portreserve_initrc_exec_t system_r;
Dan Walsh 3eaa99
	allow $2 system_r;
Dan Walsh 3eaa99
Dominick Grift 61f406
	files_list_etc($1)
Dan Walsh 3eaa99
	admin_pattern($1, portreserve_etc_t)
Dan Walsh 3eaa99
Dominick Grift 61f406
	files_list_pids($1)
Dan Walsh 3eaa99
	admin_pattern($1, portreserve_var_run_t)
Dan Walsh 3eaa99
')