Chris PeBenito 7b61fe
## <summary>Universal Addresses to RPC Program Number Mapper</summary>
Chris PeBenito 7b61fe
Chris PeBenito 7b61fe
########################################
Chris PeBenito 7b61fe
## <summary>
Chris PeBenito 7b61fe
##	Execute a domain transition to run rpcbind.
Chris PeBenito 7b61fe
## </summary>
Chris PeBenito 7b61fe
## <param name="domain">
Chris PeBenito 7b61fe
## <summary>
Chris PeBenito 7b61fe
##	Domain allowed to transition.
Chris PeBenito 7b61fe
## </summary>
Chris PeBenito 7b61fe
## </param>
Chris PeBenito 7b61fe
#
Chris PeBenito 7b61fe
interface(`rpcbind_domtrans',`
Chris PeBenito 7b61fe
	gen_require(`
Chris PeBenito 7b61fe
		type rpcbind_t, rpcbind_exec_t;
Chris PeBenito 7b61fe
	')
Chris PeBenito 7b61fe
Chris PeBenito 0bfccd
	domtrans_pattern($1, rpcbind_exec_t, rpcbind_t)
Chris PeBenito 7b61fe
')
Chris PeBenito 7b61fe
Chris PeBenito 7b61fe
########################################
Chris PeBenito 7b61fe
## <summary>
Chris PeBenito ff785b
##	Connect to rpcbindd over an unix stream socket.
Chris PeBenito ff785b
## </summary>
Chris PeBenito ff785b
## <param name="domain">
Chris PeBenito ff785b
##	<summary>
Chris PeBenito ff785b
##	Domain allowed access.
Chris PeBenito ff785b
##	</summary>
Chris PeBenito ff785b
## </param>
Chris PeBenito ff785b
#
Chris PeBenito ff785b
interface(`rpcbind_stream_connect',`
Chris PeBenito ff785b
	gen_require(`
Chris PeBenito ff785b
		type rpcbind_t, rpcbind_var_run_t;
Chris PeBenito ff785b
	')
Chris PeBenito ff785b
Chris PeBenito ff785b
	files_search_pids($1)
Chris PeBenito ff785b
	allow $1 rpcbind_var_run_t:sock_file write;
Chris PeBenito ff785b
	allow $1 rpcbind_t:unix_stream_socket connectto;
Chris PeBenito ff785b
')
Chris PeBenito ff785b
Chris PeBenito ff785b
########################################
Chris PeBenito ff785b
## <summary>
Chris PeBenito 7b61fe
##	Read rpcbind PID files.
Chris PeBenito 7b61fe
## </summary>
Chris PeBenito 7b61fe
## <param name="domain">
Chris PeBenito 7b61fe
##	<summary>
Chris PeBenito 7b61fe
##	Domain allowed access.
Chris PeBenito 7b61fe
##	</summary>
Chris PeBenito 7b61fe
## </param>
Chris PeBenito 7b61fe
#
Chris PeBenito 7b61fe
interface(`rpcbind_read_pid_files',`
Chris PeBenito 7b61fe
	gen_require(`
Chris PeBenito 7b61fe
		type rpcbind_var_run_t;
Chris PeBenito 7b61fe
	')
Chris PeBenito 7b61fe
Chris PeBenito 7b61fe
	files_search_pids($1)
Chris PeBenito 7b61fe
	allow $1 rpcbind_var_run_t:file read_file_perms;
Chris PeBenito 7b61fe
')
Chris PeBenito 7b61fe
Chris PeBenito 7b61fe
########################################
Chris PeBenito 7b61fe
## <summary>
Chris PeBenito 7b61fe
##	Search rpcbind lib directories.
Chris PeBenito 7b61fe
## </summary>
Chris PeBenito 7b61fe
## <param name="domain">
Chris PeBenito 7b61fe
##	<summary>
Chris PeBenito 7b61fe
##	Domain allowed access.
Chris PeBenito 7b61fe
##	</summary>
Chris PeBenito 7b61fe
## </param>
Chris PeBenito 7b61fe
#
Chris PeBenito 7b61fe
interface(`rpcbind_search_lib',`
Chris PeBenito 7b61fe
	gen_require(`
Chris PeBenito 7b61fe
		type rpcbind_var_lib_t;
Chris PeBenito 7b61fe
	')
Chris PeBenito 7b61fe
Chris PeBenito 7b61fe
	allow $1 rpcbind_var_lib_t:dir search_dir_perms;
Chris PeBenito 7b61fe
	files_search_var_lib($1)
Chris PeBenito 7b61fe
')
Chris PeBenito 7b61fe
Chris PeBenito 7b61fe
########################################
Chris PeBenito 7b61fe
## <summary>
Chris PeBenito 7b61fe
##	Read rpcbind lib files.
Chris PeBenito 7b61fe
## </summary>
Chris PeBenito 7b61fe
## <param name="domain">
Chris PeBenito 7b61fe
##	<summary>
Chris PeBenito 7b61fe
##	Domain allowed access.
Chris PeBenito 7b61fe
##	</summary>
Chris PeBenito 7b61fe
## </param>
Chris PeBenito 7b61fe
#
Chris PeBenito 7b61fe
interface(`rpcbind_read_lib_files',`
Chris PeBenito 7b61fe
	gen_require(`
Chris PeBenito 7b61fe
		type rpcbind_var_lib_t;
Chris PeBenito 7b61fe
	')
Chris PeBenito 7b61fe
Chris PeBenito 0bfccd
	read_files_pattern($1, rpcbind_var_lib_t, rpcbind_var_lib_t)
Chris PeBenito 7b61fe
	files_search_var_lib($1)
Chris PeBenito 7b61fe
')
Chris PeBenito 7b61fe
Chris PeBenito 7b61fe
########################################
Chris PeBenito 7b61fe
## <summary>
Chris PeBenito 7b61fe
##	Create, read, write, and delete
Chris PeBenito 7b61fe
##	rpcbind lib files.
Chris PeBenito 7b61fe
## </summary>
Chris PeBenito 7b61fe
## <param name="domain">
Chris PeBenito 7b61fe
##	<summary>
Chris PeBenito 7b61fe
##	Domain allowed access.
Chris PeBenito 7b61fe
##	</summary>
Chris PeBenito 7b61fe
## </param>
Chris PeBenito 7b61fe
#
Chris PeBenito 7b61fe
interface(`rpcbind_manage_lib_files',`
Chris PeBenito 7b61fe
	gen_require(`
Chris PeBenito 7b61fe
		type rpcbind_var_lib_t;
Chris PeBenito 7b61fe
	')
Chris PeBenito 7b61fe
Chris PeBenito 0bfccd
	manage_files_pattern($1, rpcbind_var_lib_t, rpcbind_var_lib_t)
Chris PeBenito 7b61fe
	files_search_var_lib($1)
Chris PeBenito 7b61fe
')
Chris PeBenito 658f4d
Chris PeBenito 658f4d
########################################
Chris PeBenito 658f4d
## <summary>
Chris PeBenito ff785b
##	All of the rules required to administrate
Chris PeBenito 658f4d
##	an rpcbind environment
Chris PeBenito 658f4d
## </summary>
Chris PeBenito 658f4d
## <param name="domain">
Chris PeBenito 658f4d
##	<summary>
Chris PeBenito 658f4d
##	Domain allowed access.
Chris PeBenito 658f4d
##	</summary>
Chris PeBenito 658f4d
## </param>
Chris PeBenito 658f4d
## <param name="role">
Chris PeBenito 658f4d
##	<summary>
Chris PeBenito 658f4d
##	The role to be allowed to manage the rpcbind domain.
Chris PeBenito 658f4d
##	</summary>
Chris PeBenito 658f4d
## </param>
Chris PeBenito 658f4d
## <rolecap/>
Chris PeBenito 658f4d
#
Chris PeBenito 658f4d
interface(`rpcbind_admin',`
Chris PeBenito 658f4d
	gen_require(`
Chris PeBenito 658f4d
		type rpcbind_t, rpcbind_var_lib_t, rpcbind_var_run_t;
Chris PeBenito 658f4d
		type rpcbind_initrc_exec_t;
Chris PeBenito 658f4d
	')
Chris PeBenito 658f4d
Chris PeBenito 658f4d
	allow $1 rpcbind_t:process { ptrace signal_perms };
Chris PeBenito 658f4d
	ps_process_pattern($1, rpcbind_t)
Chris PeBenito 2a9837
Dan Walsh 3eaa99
	init_labeled_script_domtrans($1, rpcbind_initrc_exec_t)
Chris PeBenito 658f4d
	domain_system_change_exemption($1)
Chris PeBenito 658f4d
	role_transition $2 rpcbind_initrc_exec_t system_r;
Chris PeBenito 658f4d
	allow $2 system_r;
Chris PeBenito 658f4d
')