## policy for sanlock
########################################
##
## Execute a domain transition to run sanlock.
##
##
##
## Domain allowed access.
##
##
#
interface(`sanlock_domtrans',`
gen_require(`
type sanlock_t, sanlock_exec_t;
')
domtrans_pattern($1, sanlock_exec_t, sanlock_t)
')
########################################
##
## Execute sanlock server in the sanlock domain.
##
##
##
## The type of the process performing this action.
##
##
#
interface(`sanlock_initrc_domtrans',`
gen_require(`
type sanlock_initrc_exec_t;
')
init_labeled_script_domtrans($1, sanlock_initrc_exec_t)
')
######################################
##
## Create, read, write, and delete sanlock PID files.
##
##
##
## Domain allowed access.
##
##
#
interface(`sanlock_manage_pid_files',`
gen_require(`
type sanlock_var_run_t;
')
files_search_pids($1)
manage_files_pattern($1, sanlock_var_run_t, sanlock_var_run_t)
')
########################################
##
## Connect to sanlock over an unix stream socket.
##
##
##
## Domain allowed access.
##
##
#
interface(`sanlock_stream_connect',`
gen_require(`
type sanlock_t, sanlock_var_run_t;
')
files_search_pids($1)
stream_connect_pattern($1, sanlock_var_run_t, sanlock_var_run_t, sanlock_t)
')
########################################
##
## All of the rules required to administrate
## an sanlock environment
##
##
##
## Domain allowed access.
##
##
##
##
## Role allowed access.
##
##
##
#
interface(`sanlock_admin',`
gen_require(`
type sanlock_t;
type sanlock_initrc_exec_t;
')
allow $1 sanlock_t:process signal_perms;
ps_process_pattern($1, sanlock_t)
sanlock_initrc_domtrans($1)
domain_system_change_exemption($1)
role_transition $2 sanlock_initrc_exec_t system_r;
allow $2 system_r;
')