Chris PeBenito 9b1907
## <summary>Pulseaudio network sound server.</summary>
Chris PeBenito 9b1907
Chris PeBenito 9b1907
########################################
Chris PeBenito 9b1907
## <summary>
Chris PeBenito 9b1907
##	Role access for pulseaudio
Chris PeBenito 9b1907
## </summary>
Chris PeBenito 9b1907
## <param name="role">
Chris PeBenito 9b1907
##	<summary>
Chris PeBenito 9b1907
##	Role allowed access
Chris PeBenito 9b1907
##	</summary>
Chris PeBenito 9b1907
## </param>
Chris PeBenito 9b1907
## <param name="domain">
Chris PeBenito 9b1907
##	<summary>
Chris PeBenito 9b1907
##	User domain for the role
Chris PeBenito 9b1907
##	</summary>
Chris PeBenito 9b1907
## </param>
Chris PeBenito 9b1907
#
Chris PeBenito 9b1907
interface(`pulseaudio_role',`
Chris PeBenito 9b1907
	gen_require(`
Chris PeBenito 9b1907
		type pulseaudio_t, pulseaudio_exec_t, print_spool_t;
Chris PeBenito 9b1907
		class dbus { send_msg };
Chris PeBenito 9b1907
	')
Chris PeBenito 9b1907
Chris PeBenito 9b1907
	role $1 types pulseaudio_t;
Chris PeBenito 9b1907
Chris PeBenito 9b1907
	# Transition from the user domain to the derived domain.
Chris PeBenito 9b1907
	domtrans_pattern($2, pulseaudio_exec_t, pulseaudio_t)
Chris PeBenito 9b1907
Chris PeBenito 9b1907
	ps_process_pattern($2, pulseaudio_t)
Chris PeBenito 9b1907
Chris PeBenito 9b1907
	allow pulseaudio_t $2:process { signal signull };
Chris PeBenito 9b1907
	allow $2 pulseaudio_t:process { signal signull };
Chris PeBenito 9b1907
	ps_process_pattern(pulseaudio_t, $2)
Chris PeBenito 9b1907
Chris PeBenito 9b1907
	allow pulseaudio_t $2:unix_stream_socket connectto;
Chris PeBenito 9b1907
	allow $2 pulseaudio_t:unix_stream_socket connectto;
Chris PeBenito 9b1907
Chris PeBenito 9b1907
	userdom_manage_home_role($1, pulseaudio_t)
Chris PeBenito 9b1907
	userdom_manage_tmp_role($1, pulseaudio_t)
Chris PeBenito 9b1907
	userdom_manage_tmpfs_role($1, pulseaudio_t)
Chris PeBenito 9b1907
Chris PeBenito 9b1907
	allow $2 pulseaudio_t:dbus send_msg;
Chris PeBenito 9b1907
	allow pulseaudio_t $2:dbus send_msg;
Chris PeBenito 9b1907
')
Chris PeBenito 9b1907
Chris PeBenito 9b1907
########################################
Chris PeBenito 9b1907
## <summary>
Chris PeBenito 9b1907
##	Execute a domain transition to run pulseaudio.
Chris PeBenito 9b1907
## </summary>
Chris PeBenito 9b1907
## <param name="domain">
Chris PeBenito 9b1907
## <summary>
Chris PeBenito 9b1907
##	Domain allowed to transition.
Chris PeBenito 9b1907
## </summary>
Chris PeBenito 9b1907
## </param>
Chris PeBenito 9b1907
#
Chris PeBenito 9b1907
interface(`pulseaudio_domtrans',`
Chris PeBenito 9b1907
	gen_require(`
Chris PeBenito 9b1907
		type pulseaudio_t, pulseaudio_exec_t;
Chris PeBenito 9b1907
	')
Chris PeBenito 9b1907
Chris PeBenito 9b1907
	domtrans_pattern($1,pulseaudio_exec_t,pulseaudio_t)
Chris PeBenito 9b1907
')
Chris PeBenito 9b1907
Chris PeBenito 9b1907
########################################
Chris PeBenito 9b1907
## <summary>
Chris PeBenito 9b1907
##	Execute pulseaudio in the pulseaudio domain, and
Chris PeBenito 9b1907
##	allow the specified role the pulseaudio domain.
Chris PeBenito 9b1907
## </summary>
Chris PeBenito 9b1907
## <param name="domain">
Chris PeBenito 9b1907
##	<summary>
Chris PeBenito 9b1907
##	Domain allowed access.
Chris PeBenito 9b1907
##	</summary>
Chris PeBenito 9b1907
## </param>
Chris PeBenito 9b1907
## <param name="role">
Chris PeBenito 9b1907
##	<summary>
Chris PeBenito 9b1907
##	The role to be allowed the pulseaudio domain.
Chris PeBenito 9b1907
##	</summary>
Chris PeBenito 9b1907
## </param>
Chris PeBenito 9b1907
#
Chris PeBenito 9b1907
interface(`pulseaudio_run',`
Chris PeBenito 9b1907
	gen_require(`
Chris PeBenito 9b1907
		type pulseaudio_t;
Chris PeBenito 9b1907
	')
Chris PeBenito 9b1907
Chris PeBenito 9b1907
	pulseaudio_domtrans($1)
Chris PeBenito 9b1907
	role $2 types pulseaudio_t;
Chris PeBenito 9b1907
')
Chris PeBenito 9b1907
Chris PeBenito 9b1907
########################################
Chris PeBenito 9b1907
## <summary>
Chris PeBenito 9b1907
##	Execute a pulseaudio in the current domain
Chris PeBenito 9b1907
## </summary>
Chris PeBenito 9b1907
## <param name="domain">
Chris PeBenito 9b1907
## <summary>
Chris PeBenito 9b1907
##	Domain allowed to transition.
Chris PeBenito 9b1907
## </summary>
Chris PeBenito 9b1907
## </param>
Chris PeBenito 9b1907
#
Chris PeBenito 9b1907
interface(`pulseaudio_exec',`
Chris PeBenito 9b1907
	gen_require(`
Chris PeBenito 9b1907
                type pulseaudio_exec_t;
Chris PeBenito 9b1907
	')
Chris PeBenito 9b1907
Chris PeBenito 9b1907
	can_exec($1,pulseaudio_exec_t)
Chris PeBenito 9b1907
')
Chris PeBenito 9b1907
Chris PeBenito 9b1907
########################################
Chris PeBenito 9b1907
## <summary>
Chris PeBenito 9b1907
##	Send and receive messages from
Chris PeBenito 9b1907
##	pulseaudio over dbus.
Chris PeBenito 9b1907
## </summary>
Chris PeBenito 9b1907
## <param name="domain">
Chris PeBenito 9b1907
##	<summary>
Chris PeBenito 9b1907
##	Domain allowed access.
Chris PeBenito 9b1907
##	</summary>
Chris PeBenito 9b1907
## </param>
Chris PeBenito 9b1907
#
Chris PeBenito 9b1907
interface(`pulseaudio_dbus_chat',`
Chris PeBenito 9b1907
	gen_require(`
Chris PeBenito 9b1907
		type pulseaudio_t;
Chris PeBenito 9b1907
		class dbus send_msg;
Chris PeBenito 9b1907
	')
Chris PeBenito 9b1907
Chris PeBenito 9b1907
	allow $1 pulseaudio_t:dbus send_msg;
Chris PeBenito 9b1907
	allow pulseaudio_t $1:dbus send_msg;
Chris PeBenito 9b1907
')
Chris PeBenito 9b1907
Chris PeBenito 9b1907
########################################
Chris PeBenito 9b1907
## <summary>
Chris PeBenito 9b1907
##	pulsaudio connection template.
Chris PeBenito 9b1907
## </summary>
Chris PeBenito 9b1907
## <param name="user_domain">
Chris PeBenito 9b1907
##	<summary>
Chris PeBenito 9b1907
##	The type of the user domain.
Chris PeBenito 9b1907
##	</summary>
Chris PeBenito 9b1907
## </param>
Chris PeBenito 9b1907
#
Chris PeBenito 9b1907
interface(`pulseaudio_stream_connect',`
Chris PeBenito 9b1907
	gen_require(`
Chris PeBenito 9b1907
		type pulseaudio_t;
Chris PeBenito 9b1907
	')
Chris PeBenito 9b1907
Chris PeBenito 9b1907
	allow $1 pulseaudio_t:process signull;
Chris PeBenito a3dd14
	allow pulseaudio_t $1:process signull;
Chris PeBenito 9b1907
	allow $1 pulseaudio_t:unix_stream_socket connectto;
Chris PeBenito 9b1907
')