Blob Blame History Raw
## <summary>Mplayer media player and encoder</summary>

########################################
## <summary>
##	Role access for mplayer
## </summary>
## <param name="role">
##	<summary>
##	Role allowed access
##	</summary>
## </param>
## <param name="domain">
##	<summary>
##	User domain for the role
##	</summary>
## </param>
#
interface(`mplayer_role',`
	gen_require(`
		type mencoder_t, mencoder_exec_t;
		type mplayer_t, mplayer_exec_t;
		type mplayer_home_t;
	')

	role $1 types { mencoder_t mplayer_t };

	# domain transition
	domtrans_pattern($2, mencoder_exec_t, mencoder_t)

	# Allow the user domain to signal/ps.
	ps_process_pattern($2, mencoder_t)
	allow $2 mencoder_t:process signal_perms;

	# Home access
	manage_dirs_pattern($2, mplayer_home_t, mplayer_home_t)
	manage_files_pattern($2, mplayer_home_t, mplayer_home_t)
	manage_lnk_files_pattern($2, mplayer_home_t, mplayer_home_t)
	relabel_dirs_pattern($2, mplayer_home_t, mplayer_home_t)
	relabel_files_pattern($2, mplayer_home_t, mplayer_home_t)
	relabel_lnk_files_pattern($2, mplayer_home_t, mplayer_home_t)

	# domain transition
	domtrans_pattern($2, mplayer_exec_t, mplayer_t)

	# Allow the user domain to signal/ps.
	ps_process_pattern($2, mplayer_t)
	allow $2 mplayer_t:process signal_perms;
')

########################################
## <summary>
##	Run mplayer in mplayer domain.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`mplayer_domtrans',`
	gen_require(`
		type mplayer_t, mplayer_exec_t;
	')

	domtrans_pattern($1, mplayer_exec_t, mplayer_t)
')

########################################
## <summary>
##	Read mplayer per user homedir
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`mplayer_read_user_home_files',`
	gen_require(`
		type mplayer_home_t;
	')

	read_files_pattern($1, mplayer_home_t, mplayer_home_t)
	userdom_search_user_home_dirs($1)
')