## <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 to transition.
## </summary>
## </param>
#
interface(`mplayer_domtrans',`
gen_require(`
type mplayer_t, mplayer_exec_t;
')
domtrans_pattern($1, mplayer_exec_t, mplayer_t)
')
########################################
## <summary>
## Execute mplayer in the caller domain.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
#
interface(`mplayer_exec',`
gen_require(`
type mplayer_exec_t;
')
can_exec($1, mplayer_exec_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)
')
########################################
## <summary>
## Execute mplayer_exec_t
## in the specified domain.
## </summary>
## <desc>
## <p>
## Execute a mplayer_exec_t
## in the specified domain.
## </p>
## <p>
## No interprocess communication (signals, pipes,
## etc.) is provided by this interface since
## the domains are not owned by this module.
## </p>
## </desc>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
## <param name="target_domain">
## <summary>
## The type of the new process.
## </summary>
## </param>
#
interface(`mplayer_exec_domtrans',`
gen_require(`
type mplayer_exec_t;
')
allow $2 mplayer_exec_t:file entrypoint;
domtrans_pattern($1, mplayer_exec_t, $2)
')