|
Dan Walsh |
3eaa99 |
## <summary>policy for daemon for playing music</summary>
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
########################################
|
|
Dan Walsh |
3eaa99 |
## <summary>
|
|
Dan Walsh |
3eaa99 |
## Execute a domain transition to run mpd.
|
|
Dan Walsh |
3eaa99 |
## </summary>
|
|
Dan Walsh |
3eaa99 |
## <param name="domain">
|
|
Dominick Grift |
1976dd |
## <summary>
|
|
Dan Walsh |
3eaa99 |
## Domain allowed to transition.
|
|
Dominick Grift |
1976dd |
## </summary>
|
|
Dan Walsh |
3eaa99 |
## </param>
|
|
Dan Walsh |
3eaa99 |
#
|
|
Dan Walsh |
3eaa99 |
interface(`mpd_domtrans',`
|
|
Dan Walsh |
3eaa99 |
gen_require(`
|
|
Dan Walsh |
3eaa99 |
type mpd_t, mpd_exec_t;
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
domtrans_pattern($1, mpd_exec_t, mpd_t)
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
########################################
|
|
Dan Walsh |
3eaa99 |
## <summary>
|
|
Dan Walsh |
3eaa99 |
## Execute mpd server in the mpd domain.
|
|
Dan Walsh |
3eaa99 |
## </summary>
|
|
Dan Walsh |
3eaa99 |
## <param name="domain">
|
|
Dan Walsh |
3eaa99 |
## <summary>
|
|
Dan Walsh |
3eaa99 |
## Domain allowed access.
|
|
Dan Walsh |
3eaa99 |
## </summary>
|
|
Dan Walsh |
3eaa99 |
## </param>
|
|
Dan Walsh |
3eaa99 |
#
|
|
Dan Walsh |
3eaa99 |
interface(`mpd_initrc_domtrans',`
|
|
Dan Walsh |
3eaa99 |
gen_require(`
|
|
Dan Walsh |
3eaa99 |
type mpd_initrc_exec_t;
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
init_labeled_script_domtrans($1, mpd_initrc_exec_t)
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
#######################################
|
|
Dan Walsh |
3eaa99 |
## <summary>
|
|
Dominick Grift |
1976dd |
## Read mpd data files.
|
|
Dan Walsh |
3eaa99 |
## </summary>
|
|
Dan Walsh |
3eaa99 |
## <param name="domain">
|
|
Dominick Grift |
1976dd |
## <summary>
|
|
Dominick Grift |
1976dd |
## Domain allowed access.
|
|
Dominick Grift |
1976dd |
## </summary>
|
|
Dan Walsh |
3eaa99 |
## </param>
|
|
Dan Walsh |
3eaa99 |
#
|
|
Dan Walsh |
3eaa99 |
interface(`mpd_read_data_files',`
|
|
Dominick Grift |
1976dd |
gen_require(`
|
|
Dominick Grift |
1976dd |
type mpd_data_t;
|
|
Dominick Grift |
1976dd |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
mpd_search_lib($1)
|
|
Dominick Grift |
1976dd |
read_files_pattern($1, mpd_data_t, mpd_data_t)
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
#######################################
|
|
Dan Walsh |
3eaa99 |
## <summary>
|
|
Dominick Grift |
1976dd |
## Read mpd tmpfs files.
|
|
Dan Walsh |
3eaa99 |
## </summary>
|
|
Dan Walsh |
3eaa99 |
## <param name="domain">
|
|
Dominick Grift |
1976dd |
## <summary>
|
|
Dominick Grift |
1976dd |
## Domain allowed access.
|
|
Dominick Grift |
1976dd |
## </summary>
|
|
Dan Walsh |
3eaa99 |
## </param>
|
|
Dan Walsh |
3eaa99 |
#
|
|
Dan Walsh |
3eaa99 |
interface(`mpd_read_tmpfs_files',`
|
|
Dominick Grift |
1976dd |
gen_require(`
|
|
Dominick Grift |
1976dd |
type mpd_tmpfs_t;
|
|
Dominick Grift |
1976dd |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dominick Grift |
0ba923 |
fs_search_tmpfs($1)
|
|
Dominick Grift |
1976dd |
read_files_pattern($1, mpd_tmpfs_t, mpd_tmpfs_t)
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
###################################
|
|
Dan Walsh |
3eaa99 |
## <summary>
|
|
Dominick Grift |
1976dd |
## Manage mpd tmpfs files.
|
|
Dan Walsh |
3eaa99 |
## </summary>
|
|
Dan Walsh |
3eaa99 |
## <param name="domain">
|
|
Dominick Grift |
1976dd |
## <summary>
|
|
Dominick Grift |
1976dd |
## Domain allowed access.
|
|
Dominick Grift |
1976dd |
## </summary>
|
|
Dan Walsh |
3eaa99 |
## </param>
|
|
Dan Walsh |
3eaa99 |
#
|
|
Dan Walsh |
3eaa99 |
interface(`mpd_manage_tmpfs_files',`
|
|
Dominick Grift |
1976dd |
gen_require(`
|
|
Dominick Grift |
1976dd |
type mpd_tmpfs_t;
|
|
Dominick Grift |
1976dd |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dominick Grift |
0ba923 |
fs_search_tmpfs($1)
|
|
Dominick Grift |
1976dd |
manage_files_pattern($1, mpd_tmpfs_t, mpd_tmpfs_t)
|
|
Dominick Grift |
1976dd |
manage_lnk_files_pattern($1, mpd_tmpfs_t, mpd_tmpfs_t)
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
######################################
|
|
Dan Walsh |
3eaa99 |
## <summary>
|
|
Dominick Grift |
1976dd |
## Manage mpd data files.
|
|
Dan Walsh |
3eaa99 |
## </summary>
|
|
Dan Walsh |
3eaa99 |
## <param name="domain">
|
|
Dominick Grift |
1976dd |
## <summary>
|
|
Dominick Grift |
1976dd |
## Domain allowed access.
|
|
Dominick Grift |
1976dd |
## </summary>
|
|
Dan Walsh |
3eaa99 |
## </param>
|
|
Dan Walsh |
3eaa99 |
#
|
|
Dan Walsh |
3eaa99 |
interface(`mpd_manage_data_files',`
|
|
Dominick Grift |
1976dd |
gen_require(`
|
|
Dominick Grift |
1976dd |
type mpd_data_t;
|
|
Dominick Grift |
1976dd |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dominick Grift |
1976dd |
mpd_search_lib($1)
|
|
Dominick Grift |
1976dd |
manage_files_pattern($1, mpd_data_t, mpd_data_t)
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
########################################
|
|
Dan Walsh |
3eaa99 |
## <summary>
|
|
Dan Walsh |
3eaa99 |
## Search mpd lib directories.
|
|
Dan Walsh |
3eaa99 |
## </summary>
|
|
Dan Walsh |
3eaa99 |
## <param name="domain">
|
|
Dan Walsh |
3eaa99 |
## <summary>
|
|
Dan Walsh |
3eaa99 |
## Domain allowed access.
|
|
Dan Walsh |
3eaa99 |
## </summary>
|
|
Dan Walsh |
3eaa99 |
## </param>
|
|
Dan Walsh |
3eaa99 |
#
|
|
Dan Walsh |
3eaa99 |
interface(`mpd_search_lib',`
|
|
Dan Walsh |
3eaa99 |
gen_require(`
|
|
Dan Walsh |
3eaa99 |
type mpd_var_lib_t;
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
allow $1 mpd_var_lib_t:dir search_dir_perms;
|
|
Dan Walsh |
3eaa99 |
files_search_var_lib($1)
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
########################################
|
|
Dan Walsh |
3eaa99 |
## <summary>
|
|
Dan Walsh |
3eaa99 |
## Read mpd lib files.
|
|
Dan Walsh |
3eaa99 |
## </summary>
|
|
Dan Walsh |
3eaa99 |
## <param name="domain">
|
|
Dan Walsh |
3eaa99 |
## <summary>
|
|
Dan Walsh |
3eaa99 |
## Domain allowed access.
|
|
Dan Walsh |
3eaa99 |
## </summary>
|
|
Dan Walsh |
3eaa99 |
## </param>
|
|
Dan Walsh |
3eaa99 |
#
|
|
Dan Walsh |
3eaa99 |
interface(`mpd_read_lib_files',`
|
|
Dan Walsh |
3eaa99 |
gen_require(`
|
|
Dan Walsh |
3eaa99 |
type mpd_var_lib_t;
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
files_search_var_lib($1)
|
|
Dominick Grift |
1976dd |
read_files_pattern($1, mpd_var_lib_t, mpd_var_lib_t)
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
########################################
|
|
Dan Walsh |
3eaa99 |
## <summary>
|
|
Dan Walsh |
3eaa99 |
## Create, read, write, and delete
|
|
Dan Walsh |
3eaa99 |
## mpd lib files.
|
|
Dan Walsh |
3eaa99 |
## </summary>
|
|
Dan Walsh |
3eaa99 |
## <param name="domain">
|
|
Dan Walsh |
3eaa99 |
## <summary>
|
|
Dan Walsh |
3eaa99 |
## Domain allowed access.
|
|
Dan Walsh |
3eaa99 |
## </summary>
|
|
Dan Walsh |
3eaa99 |
## </param>
|
|
Dan Walsh |
3eaa99 |
#
|
|
Dan Walsh |
3eaa99 |
interface(`mpd_manage_lib_files',`
|
|
Dan Walsh |
3eaa99 |
gen_require(`
|
|
Dan Walsh |
3eaa99 |
type mpd_var_lib_t;
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
files_search_var_lib($1)
|
|
Dominick Grift |
1976dd |
manage_files_pattern($1, mpd_var_lib_t, mpd_var_lib_t)
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
#######################################
|
|
Dan Walsh |
3eaa99 |
## <summary>
|
|
Dominick Grift |
1976dd |
## Create an object in the root directory, with a private
|
|
Dominick Grift |
1976dd |
## type using a type transition.
|
|
Dan Walsh |
3eaa99 |
## </summary>
|
|
Dan Walsh |
3eaa99 |
## <param name="domain">
|
|
Dominick Grift |
1976dd |
## <summary>
|
|
Dominick Grift |
1976dd |
## Domain allowed access.
|
|
Dominick Grift |
1976dd |
## </summary>
|
|
Dan Walsh |
3eaa99 |
## </param>
|
|
Dan Walsh |
3eaa99 |
## <param name="private type">
|
|
Dominick Grift |
1976dd |
## <summary>
|
|
Dominick Grift |
1976dd |
## The type of the object to be created.
|
|
Dominick Grift |
1976dd |
## </summary>
|
|
Dan Walsh |
3eaa99 |
## </param>
|
|
Dan Walsh |
3eaa99 |
## <param name="object">
|
|
Dominick Grift |
1976dd |
## <summary>
|
|
Dominick Grift |
1976dd |
## The object class of the object being created.
|
|
Dominick Grift |
1976dd |
## </summary>
|
|
Dan Walsh |
3eaa99 |
## </param>
|
|
Dan Walsh |
3eaa99 |
#
|
|
Dan Walsh |
3eaa99 |
interface(`mpd_var_lib_filetrans',`
|
|
Dominick Grift |
1976dd |
gen_require(`
|
|
Dominick Grift |
1976dd |
type mpd_var_lib_t;
|
|
Dominick Grift |
1976dd |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dominick Grift |
ce8724 |
files_search_var_lib($1)
|
|
Dominick Grift |
1976dd |
filetrans_pattern($1, mpd_var_lib_t, $2, $3)
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
########################################
|
|
Dan Walsh |
3eaa99 |
## <summary>
|
|
Dan Walsh |
3eaa99 |
## Manage mpd lib dirs files.
|
|
Dan Walsh |
3eaa99 |
## </summary>
|
|
Dan Walsh |
3eaa99 |
## <param name="domain">
|
|
Dan Walsh |
3eaa99 |
## <summary>
|
|
Dan Walsh |
3eaa99 |
## Domain allowed access.
|
|
Dan Walsh |
3eaa99 |
## </summary>
|
|
Dan Walsh |
3eaa99 |
## </param>
|
|
Dan Walsh |
3eaa99 |
#
|
|
Dan Walsh |
3eaa99 |
interface(`mpd_manage_lib_dirs',`
|
|
Dan Walsh |
3eaa99 |
gen_require(`
|
|
Dan Walsh |
3eaa99 |
type mpd_var_lib_t;
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
files_search_var_lib($1)
|
|
Dominick Grift |
1976dd |
manage_dirs_pattern($1, mpd_var_lib_t, mpd_var_lib_t)
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
########################################
|
|
Dan Walsh |
3eaa99 |
## <summary>
|
|
Dan Walsh |
3eaa99 |
## All of the rules required to administrate
|
|
Dan Walsh |
3eaa99 |
## an mpd environment
|
|
Dan Walsh |
3eaa99 |
## </summary>
|
|
Dan Walsh |
3eaa99 |
## <param name="domain">
|
|
Dan Walsh |
3eaa99 |
## <summary>
|
|
Dan Walsh |
3eaa99 |
## Domain allowed access.
|
|
Dan Walsh |
3eaa99 |
## </summary>
|
|
Dan Walsh |
3eaa99 |
## </param>
|
|
Dan Walsh |
3eaa99 |
## <param name="role">
|
|
Dan Walsh |
3eaa99 |
## <summary>
|
|
Dan Walsh |
3eaa99 |
## Role allowed access.
|
|
Dan Walsh |
3eaa99 |
## </summary>
|
|
Dan Walsh |
3eaa99 |
## </param>
|
|
Dan Walsh |
3eaa99 |
## <rolecap/>
|
|
Dan Walsh |
3eaa99 |
#
|
|
Dan Walsh |
3eaa99 |
interface(`mpd_admin',`
|
|
Dan Walsh |
3eaa99 |
gen_require(`
|
|
Dominick Grift |
8f0b74 |
type mpd_t, mpd_initrc_exec_t, mpd_etc_t;
|
|
Dominick Grift |
8f0b74 |
type mpd_data_t, mpd_log_t, mpd_var_lib_t;
|
|
Dominick Grift |
c5e7db |
type mpd_tmpfs_t;
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
allow $1 mpd_t:process { ptrace signal_perms };
|
|
Dan Walsh |
3eaa99 |
ps_process_pattern($1, mpd_t)
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
mpd_initrc_domtrans($1)
|
|
Dan Walsh |
3eaa99 |
domain_system_change_exemption($1)
|
|
Dan Walsh |
3eaa99 |
role_transition $2 mpd_initrc_exec_t system_r;
|
|
Dan Walsh |
3eaa99 |
allow $2 system_r;
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
admin_pattern($1, mpd_etc_t)
|
|
Dominick Grift |
61f406 |
files_list_etc($1)
|
|
Dan Walsh |
3eaa99 |
|
|
Dominick Grift |
61f406 |
files_list_var_lib($1)
|
|
Dan Walsh |
3eaa99 |
admin_pattern($1, mpd_var_lib_t)
|
|
Dominick Grift |
1976dd |
|
|
Dan Walsh |
3eaa99 |
admin_pattern($1, mpd_data_t)
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
admin_pattern($1, mpd_log_t)
|
|
Dan Walsh |
3eaa99 |
|
|
Dominick Grift |
61f406 |
fs_list_tmpfs($1)
|
|
Dominick Grift |
c5e7db |
admin_pattern($1, mpd_tmpfs_t)
|
|
Dan Walsh |
3eaa99 |
')
|