Chris PeBenito ab58ad
# Authors:  Dan Walsh,  Russell Coker
Chris PeBenito ab58ad
# Maintained by Dan Walsh <dwalsh@redhat.com>
Chris PeBenito ab58ad
define(`sudo_domain',`
Chris PeBenito ab58ad
newrole_domain($1_sudo, `, privuser')
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# By default, revert to the calling domain when a shell is executed.
Chris PeBenito ab58ad
domain_auto_trans($1_sudo_t, shell_exec_t, $1_t)
Chris PeBenito ab58ad
Chris PeBenito ab58ad
ifdef(`mta.te', `
Chris PeBenito ab58ad
domain_auto_trans($1_sudo_t, sendmail_exec_t, $1_mail_t)
Chris PeBenito ab58ad
allow $1_mail_t $1_sudo_t:fifo_file rw_file_perms;
Chris PeBenito ab58ad
')
Chris PeBenito ab58ad
Chris PeBenito ab58ad
allow $1_sudo_t self:capability sys_resource;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
allow $1_sudo_t self:process setrlimit;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
ifdef(`pam.te', `
Chris PeBenito ab58ad
allow $1_sudo_t pam_var_run_t:dir create_dir_perms;
Chris PeBenito ab58ad
allow $1_sudo_t pam_var_run_t:file create_file_perms;
Chris PeBenito ab58ad
')
Chris PeBenito ab58ad
Chris PeBenito ab58ad
allow $1_sudo_t initrc_var_run_t:file rw_file_perms;
Chris PeBenito ab58ad
allow $1_sudo_t sysctl_t:dir search;
Chris PeBenito ab58ad
allow $1_sudo_t { su_exec_t etc_t lib_t usr_t bin_t sbin_t exec_type } :file getattr;
Chris PeBenito ab58ad
allow $1_sudo_t { su_exec_t etc_t lib_t usr_t bin_t sbin_t exec_type } :lnk_file { getattr read };
Chris PeBenito ab58ad
read_sysctl($1_sudo_t)
Chris PeBenito ab58ad
Chris PeBenito ab58ad
allow $1_sudo_t var_run_t:dir search;
Chris PeBenito ab58ad
r_dir_file($1_sudo_t, default_context_t)
Chris PeBenito ab58ad
rw_dir_create_file($1_sudo_t, $1_tmp_t)
Chris PeBenito ab58ad
rw_dir_create_file($1_sudo_t, $1_home_t)
Chris PeBenito ab58ad
domain_auto_trans($1_t, sudo_exec_t, $1_sudo_t)
Chris PeBenito ab58ad
')