Chris PeBenito 77b81c
## <summary>Mplayer media player and encoder</summary>
Chris PeBenito 77b81c
Chris PeBenito 296273
########################################
Chris PeBenito 77b81c
## <summary>
Chris PeBenito 296273
##	Role access for mplayer
Chris PeBenito 77b81c
## </summary>
Chris PeBenito 296273
## <param name="role">
Chris PeBenito 77b81c
##	<summary>
Chris PeBenito 296273
##	Role allowed access
Chris PeBenito 77b81c
##	</summary>
Chris PeBenito 77b81c
## </param>
Chris PeBenito 296273
## <param name="domain">
Chris PeBenito 77b81c
##	<summary>
Chris PeBenito 296273
##	User domain for the role
Chris PeBenito 77b81c
##	</summary>
Chris PeBenito 77b81c
## </param>
Chris PeBenito 77b81c
#
Chris PeBenito 296273
interface(`mplayer_role',`
Chris PeBenito 6b19be
	gen_require(`
Chris PeBenito 296273
		type mencoder_t, mencoder_exec_t;
Chris PeBenito 296273
		type mplayer_t, mplayer_exec_t;
Chris PeBenito 296273
		type mplayer_home_t;
Chris PeBenito 6b19be
	')
Chris PeBenito 77b81c
Chris PeBenito 296273
	role $1 types { mencoder_t mplayer_t };
Chris PeBenito 2a9837
Chris PeBenito 77b81c
	# domain transition
Chris PeBenito 296273
	domtrans_pattern($2, mencoder_exec_t, mencoder_t)
Chris PeBenito 77b81c
Chris PeBenito 77b81c
	# Allow the user domain to signal/ps.
Chris PeBenito 296273
	ps_process_pattern($2, mencoder_t)
Chris PeBenito 296273
	allow $2 mencoder_t:process signal_perms;
Chris PeBenito 77b81c
Chris PeBenito 77b81c
	# Home access
Chris PeBenito 296273
	manage_dirs_pattern($2, mplayer_home_t, mplayer_home_t)
Chris PeBenito 296273
	manage_files_pattern($2, mplayer_home_t, mplayer_home_t)
Chris PeBenito 296273
	manage_lnk_files_pattern($2, mplayer_home_t, mplayer_home_t)
Chris PeBenito 296273
	relabel_dirs_pattern($2, mplayer_home_t, mplayer_home_t)
Chris PeBenito 296273
	relabel_files_pattern($2, mplayer_home_t, mplayer_home_t)
Chris PeBenito 296273
	relabel_lnk_files_pattern($2, mplayer_home_t, mplayer_home_t)
Chris PeBenito 77b81c
Chris PeBenito 77b81c
	# domain transition
Chris PeBenito 296273
	domtrans_pattern($2, mplayer_exec_t, mplayer_t)
Chris PeBenito 77b81c
Chris PeBenito 77b81c
	# Allow the user domain to signal/ps.
Chris PeBenito 296273
	ps_process_pattern($2, mplayer_t)
Chris PeBenito 296273
	allow $2 mplayer_t:process signal_perms;
Chris PeBenito 77b81c
')
Chris PeBenito 6b19be
Chris PeBenito 6b19be
########################################
Chris PeBenito 6b19be
## <summary>
Chris PeBenito 6b19be
##	Run mplayer in mplayer domain.
Chris PeBenito 6b19be
## </summary>
Chris PeBenito 6b19be
## <param name="domain">
Chris PeBenito 6b19be
##	<summary>
Chris PeBenito 6b19be
##	Domain allowed access.
Chris PeBenito 6b19be
##	</summary>
Chris PeBenito 6b19be
## </param>
Chris PeBenito 6b19be
#
Chris PeBenito 296273
interface(`mplayer_domtrans',`
Chris PeBenito 6b19be
	gen_require(`
Chris PeBenito 296273
		type mplayer_t, mplayer_exec_t;
Chris PeBenito 6b19be
	')
Chris PeBenito 6b19be
Chris PeBenito 296273
	domtrans_pattern($1, mplayer_exec_t, mplayer_t)
Chris PeBenito 6b19be
')
Chris PeBenito 6b19be
Chris PeBenito 6b19be
########################################
Chris PeBenito 6b19be
## <summary>
Chris PeBenito 3f67f7
##	Execute mplayer in the caller domain.
Chris PeBenito c90440
## </summary>
Chris PeBenito c90440
## <param name="domain">
Chris PeBenito 3f67f7
##	<summary>
Chris PeBenito 3f67f7
##	Domain allowed access.
Chris PeBenito 3f67f7
##	</summary>
Chris PeBenito c90440
## </param>
Chris PeBenito c90440
#
Chris PeBenito c90440
#
Chris PeBenito c90440
interface(`mplayer_exec',`
Chris PeBenito c90440
	gen_require(`
Chris PeBenito c90440
		type mplayer_exec_t;
Chris PeBenito c90440
	')
Chris PeBenito c90440
Chris PeBenito c90440
	can_exec($1, mplayer_exec_t)
Chris PeBenito c90440
')
Chris PeBenito c90440
Chris PeBenito c90440
########################################
Chris PeBenito c90440
## <summary>
Chris PeBenito 6b19be
##	Read mplayer per user homedir
Chris PeBenito 6b19be
## </summary>
Chris PeBenito 6b19be
## <param name="domain">
Chris PeBenito 6b19be
##	<summary>
Chris PeBenito 6b19be
##	Domain allowed access.
Chris PeBenito 6b19be
##	</summary>
Chris PeBenito 6b19be
## </param>
Chris PeBenito 6b19be
#
Chris PeBenito 296273
interface(`mplayer_read_user_home_files',`
Chris PeBenito 6b19be
	gen_require(`
Chris PeBenito 296273
		type mplayer_home_t;
Chris PeBenito 6b19be
	')
Chris PeBenito 6b19be
Chris PeBenito 296273
	read_files_pattern($1, mplayer_home_t, mplayer_home_t)
Chris PeBenito 296273
	userdom_search_user_home_dirs($1)
Chris PeBenito 6b19be
')