Chris PeBenito 17de1b
## <summary>RPC port mapping service.</summary>
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Execute portmap_helper in the helper domain.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`portmap_domtrans_helper',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type portmap_helper_t, portmap_helper_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	corecmd_search_bin($1)
Chris PeBenito 17de1b
	domain_auto_trans($1,portmap_helper_exec_t,portmap_helper_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $1 portmap_helper_t:fd use;
Chris PeBenito 17de1b
	allow portmap_helper_t $1:fd use;
Chris PeBenito 17de1b
	allow portmap_helper_t $1:fifo_file rw_file_perms;
Chris PeBenito 17de1b
	allow portmap_helper_t $1:process sigchld;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Execute portmap helper in the helper domain, and
Chris PeBenito 17de1b
##	allow the specified role the helper domain.
Chris PeBenito 17de1b
##	Communicate with portmap.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
## <param name="role">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The role to be allowed the portmap domain.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
## <param name="terminal">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The type of the terminal allow the portmap domain to use.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`portmap_run_helper',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type portmap_t, portmap_helper_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	portmap_domtrans_helper($1)
Chris PeBenito 17de1b
	role $2 types portmap_helper_t;
Chris PeBenito 17de1b
	allow portmap_helper_t $3:chr_file { getattr read write ioctl };
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# send to portmap
Chris PeBenito 17de1b
	allow $1 portmap_t:udp_socket sendto;
Chris PeBenito 17de1b
	allow portmap_t $1:udp_socket recvfrom;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# receive from portmap
Chris PeBenito 17de1b
	allow portmap_t $1:udp_socket sendto;
Chris PeBenito 17de1b
	allow $1 portmap_t:udp_socket recvfrom;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Send UDP network traffic to portmap.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The type of the process performing this action.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`portmap_udp_send',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type portmap_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $1 portmap_t:udp_socket sendto;
Chris PeBenito 17de1b
	allow portmap_t $1:udp_socket recvfrom;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Send and receive UDP network traffic from portmap.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`portmap_udp_chat',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type portmap_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $1 portmap_t:udp_socket sendto;
Chris PeBenito 17de1b
	allow portmap_t $1:udp_socket recvfrom;
Chris PeBenito 17de1b
	allow portmap_t $1:udp_socket sendto;
Chris PeBenito 17de1b
	allow $1 portmap_t:udp_socket recvfrom;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Connect to portmap over a TCP socket
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The type of the process performing this action.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`portmap_tcp_connect',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type portmap_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $1 portmap_t:tcp_socket { connectto recvfrom };
Chris PeBenito 17de1b
	allow portmap_t $1:tcp_socket { acceptfrom recvfrom };
Chris PeBenito 17de1b
	kernel_tcp_recvfrom($1)
Chris PeBenito 17de1b
')