Chris PeBenito 162a57
## <module name="selinux" layer="system">
Chris PeBenito 162a57
## <summary>Policy for SELinux policy and userland applications.</summary>
Chris PeBenito e181fe
Chris PeBenito 85bd7f
#######################################
Chris PeBenito c9428d
## <interface name="selinux_domtrans_checkpol">
Chris PeBenito daa0e0
##	<description>
Chris PeBenito daa0e0
##		Execute checkpolicy in the checkpolicy domain.
Chris PeBenito daa0e0
##	</description>
Chris PeBenito daa0e0
##	<parameter name="domain">
Chris PeBenito daa0e0
##		The type of the process performing this action.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
## </interface>
Chris PeBenito 85bd7f
#
Chris PeBenito c9428d
define(`selinux_domtrans_checkpol',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito cc41a9
	allow $1 checkpolicy_exec_t:file rx_file_perms;
Chris PeBenito 0c73cd
	allow $1 checkpolicy_t:process transition;
Chris PeBenito 0c73cd
	type_transition $1 checkpolicy_exec_t:process checkpolicy_t;
Chris PeBenito 0c73cd
	dontaudit $1 checkpolicy_t:process { noatsecure siginh rlimitinh };
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 checkpolicy_t:fd use;
Chris PeBenito 0c73cd
	allow checkpolicy_t $1:fd use;
Chris PeBenito 0c73cd
	allow checkpolicy_t $1:fifo_file rw_file_perms;
Chris PeBenito 0c73cd
	allow checkpolicy_t $1:process sigchld;
Chris PeBenito 85bd7f
')
Chris PeBenito 85bd7f
Chris PeBenito c9428d
define(`selinux_domtrans_checkpol_depend',`
Chris PeBenito 0c73cd
	type checkpolicy_t, checkpolicy_exec_t;
Chris PeBenito 0c73cd
Chris PeBenito cc41a9
	class file rx_file_perms
Chris PeBenito 0c73cd
	class process { transition noatsecure siginh rlimitinh sigchld sigchld };
Chris PeBenito 0c73cd
	class fd use;
Chris PeBenito 0c73cd
	class fifo_file rw_file_perms;
Chris PeBenito 85bd7f
')
Chris PeBenito 85bd7f
Chris PeBenito daa0e0
########################################
Chris PeBenito c9428d
## <interface name="selinux_run_checkpol">
Chris PeBenito daa0e0
##	<description>
Chris PeBenito daa0e0
##		Execute checkpolicy in the checkpolicy domain, and
Chris PeBenito daa0e0
##		allow the specified role the checkpolicy domain,
Chris PeBenito daa0e0
##		and use the caller's terminal.
Chris PeBenito 4bf4ed
##		Has a SIGCHLD signal backchannel.
Chris PeBenito daa0e0
##	</description>
Chris PeBenito daa0e0
##	<parameter name="domain">
Chris PeBenito daa0e0
##		The type of the process performing this action.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
##	<parameter name="role">
Chris PeBenito daa0e0
##		The role to be allowed the checkpolicy domain.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
##	<parameter name="terminal">
Chris PeBenito daa0e0
##		The type of the terminal allow the checkpolicy domain to use.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
## </interface>
Chris PeBenito daa0e0
#
Chris PeBenito c9428d
define(`selinux_run_checkpol',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito c9428d
	selinux_domtrans_checkpol($1)
Chris PeBenito 0c73cd
	role $2 types checkpolicy_t;
Chris PeBenito 0c73cd
	allow checkpolicy_t $3:chr_file { getattr read write ioctl };
Chris PeBenito daa0e0
')
Chris PeBenito daa0e0
Chris PeBenito c9428d
define(`selinux_run_checkpol_depend',`
Chris PeBenito 0c73cd
	type checkpolicy_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class chr_file { getattr read write ioctl };
Chris PeBenito daa0e0
')
Chris PeBenito daa0e0
Chris PeBenito 85bd7f
#######################################
Chris PeBenito 85bd7f
#
Chris PeBenito c9428d
# selinux_exec_checkpol(domain)
Chris PeBenito 85bd7f
#
Chris PeBenito c9428d
define(`selinux_exec_checkpol',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito cc41a9
	can_exec($1,checkpolicy_exec_t)
Chris PeBenito 85bd7f
')
Chris PeBenito 85bd7f
Chris PeBenito c9428d
define(`selinux_exec_checkpol_depend',`
Chris PeBenito 0c73cd
	type checkpolicy_exec_t;
Chris PeBenito 0c73cd
Chris PeBenito cc41a9
	class file { rx_file_perms execute_no_trans };
Chris PeBenito 85bd7f
')
Chris PeBenito 85bd7f
Chris PeBenito 85bd7f
#######################################
Chris PeBenito c9428d
## <interface name="selinux_domtrans_loadpol">
Chris PeBenito daa0e0
##	<description>
Chris PeBenito daa0e0
##		Execute load_policy in the load_policy domain.
Chris PeBenito daa0e0
##	</description>
Chris PeBenito daa0e0
##	<parameter name="domain">
Chris PeBenito daa0e0
##		The type of the process performing this action.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
## </interface>
Chris PeBenito 85bd7f
#
Chris PeBenito c9428d
define(`selinux_domtrans_loadpol',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito cc41a9
	allow $1 load_policy_exec_t:file rx_file_perms;
Chris PeBenito 0c73cd
	allow $1 load_policy_t:process transition;
Chris PeBenito 0c73cd
	type_transition $1 load_policy_exec_t:process load_policy_t;
Chris PeBenito 0c73cd
	dontaudit $1 load_policy_t:process { noatsecure siginh rlimitinh };
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 load_policy_t:fd use;
Chris PeBenito 0c73cd
	allow load_policy_t $1:fd use;
Chris PeBenito 0c73cd
	allow load_policy_t $1:fifo_file rw_file_perms;
Chris PeBenito 0c73cd
	allow load_policy_t $1:process sigchld;
Chris PeBenito 85bd7f
')
Chris PeBenito 85bd7f
Chris PeBenito c9428d
define(`selinux_domtrans_loadpol_depend',`
Chris PeBenito 0c73cd
	type load_policy_t, load_policy_exec_t;
Chris PeBenito 0c73cd
Chris PeBenito cc41a9
	class file rx_file_perms;
Chris PeBenito 0c73cd
	class process { transition noatsecure siginh rlimitinh sigchld };
Chris PeBenito 0c73cd
	class fd use;
Chris PeBenito 0c73cd
	class fifo_file rw_file_perms;
Chris PeBenito 85bd7f
')
Chris PeBenito 85bd7f
Chris PeBenito daa0e0
########################################
Chris PeBenito c9428d
## <interface name="selinux_run_loadpol">
Chris PeBenito daa0e0
##	<description>
Chris PeBenito daa0e0
##		Execute load_policy in the load_policy domain, and
Chris PeBenito daa0e0
##		allow the specified role the load_policy domain,
Chris PeBenito daa0e0
##		and use the caller's terminal.
Chris PeBenito 4bf4ed
##		Has a SIGCHLD signal backchannel.
Chris PeBenito daa0e0
##	</description>
Chris PeBenito daa0e0
##	<parameter name="domain">
Chris PeBenito daa0e0
##		The type of the process performing this action.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
##	<parameter name="role">
Chris PeBenito daa0e0
##		The role to be allowed the load_policy domain.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
##	<parameter name="terminal">
Chris PeBenito daa0e0
##		The type of the terminal allow the load_policy domain to use.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
## </interface>
Chris PeBenito daa0e0
#
Chris PeBenito c9428d
define(`selinux_run_loadpol',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito c9428d
	selinux_domtrans_loadpol($1)
Chris PeBenito 0c73cd
	role $2 types load_policy_t;
Chris PeBenito 0c73cd
	allow load_policy_t $3:chr_file { getattr read write ioctl };
Chris PeBenito daa0e0
')
Chris PeBenito daa0e0
Chris PeBenito c9428d
define(`selinux_run_loadpol_depend',`
Chris PeBenito 0c73cd
	type load_policy_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class chr_file { getattr read write ioctl };
Chris PeBenito daa0e0
')
Chris PeBenito daa0e0
Chris PeBenito 85bd7f
#######################################
Chris PeBenito 85bd7f
#
Chris PeBenito c9428d
# selinux_exec_loadpol(domain)
Chris PeBenito 85bd7f
#
Chris PeBenito c9428d
define(`selinux_exec_loadpol',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito cc41a9
	can_exec($1,load_policy_exec_t)
Chris PeBenito 85bd7f
')
Chris PeBenito 85bd7f
Chris PeBenito c9428d
define(`selinux_exec_loadpol_depend',`
Chris PeBenito 0c73cd
	type load_policy_exec_t;
Chris PeBenito 0c73cd
Chris PeBenito cc41a9
	class file { rx_file_perms execute_no_trans };
Chris PeBenito 85bd7f
')
Chris PeBenito 85bd7f
Chris PeBenito 85bd7f
#######################################
Chris PeBenito 85bd7f
#
Chris PeBenito c9428d
# selinux_read_loadpol(domain)
Chris PeBenito 85bd7f
#
Chris PeBenito c9428d
define(`selinux_read_loadpol',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito cc41a9
	allow $1 load_policy_exec_t:file r_file_perms;
Chris PeBenito 85bd7f
')
Chris PeBenito 85bd7f
Chris PeBenito c9428d
define(`selinux_read_loadpol_depend',`
Chris PeBenito 0c73cd
	type load_policy_exec_t;
Chris PeBenito 0c73cd
Chris PeBenito cc41a9
	class file r_file_perms
Chris PeBenito 85bd7f
')
Chris PeBenito 85bd7f
Chris PeBenito 85bd7f
#######################################
Chris PeBenito c9428d
## <interface name="selinux_domtrans_newrole">
Chris PeBenito daa0e0
##	<description>
Chris PeBenito daa0e0
##		Execute newrole in the load_policy domain.
Chris PeBenito daa0e0
##	</description>
Chris PeBenito daa0e0
##	<parameter name="domain">
Chris PeBenito daa0e0
##		The type of the process performing this action.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
## </interface>
Chris PeBenito 85bd7f
#
Chris PeBenito c9428d
define(`selinux_domtrans_newrole',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito cc41a9
	allow $1 newrole_exec_t:file rx_file_perms;
Chris PeBenito 0c73cd
	allow $1 newrole_t:process transition;
Chris PeBenito 0c73cd
	type_transition $1 newrole_exec_t:process newrole_t;
Chris PeBenito 0c73cd
	dontaudit $1 newrole_t:process { noatsecure siginh rlimitinh };
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 newrole_t:fd use;
Chris PeBenito 0c73cd
	allow newrole_t $1:fd use;
Chris PeBenito 0c73cd
	allow newrole_t $1:fifo_file rw_file_perms;
Chris PeBenito 0c73cd
	allow newrole_t $1:process sigchld;
Chris PeBenito 85bd7f
')
Chris PeBenito 85bd7f
Chris PeBenito c9428d
define(`selinux_domtrans_newrole_depend',`
Chris PeBenito 0c73cd
	type newrole_t, newrole_exec_t;
Chris PeBenito 0c73cd
Chris PeBenito cc41a9
	class file rx_file_perms;
Chris PeBenito 0c73cd
	class process { transition noatsecure siginh rlimitinh sigchld };
Chris PeBenito 0c73cd
	class fd use;
Chris PeBenito 0c73cd
	class fifo_file rw_file_perms;
Chris PeBenito 85bd7f
')
Chris PeBenito 85bd7f
Chris PeBenito daa0e0
########################################
Chris PeBenito c9428d
## <interface name="selinux_run_newrole">
Chris PeBenito daa0e0
##	<description>
Chris PeBenito daa0e0
##		Execute newrole in the newrole domain, and
Chris PeBenito daa0e0
##		allow the specified role the newrole domain,
Chris PeBenito daa0e0
##		and use the caller's terminal.
Chris PeBenito daa0e0
##	</description>
Chris PeBenito daa0e0
##	<parameter name="domain">
Chris PeBenito daa0e0
##		The type of the process performing this action.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
##	<parameter name="role">
Chris PeBenito daa0e0
##		The role to be allowed the newrole domain.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
##	<parameter name="terminal">
Chris PeBenito daa0e0
##		The type of the terminal allow the newrole domain to use.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
## </interface>
Chris PeBenito daa0e0
#
Chris PeBenito c9428d
define(`selinux_run_newrole',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito c9428d
	selinux_domtrans_newrole($1)
Chris PeBenito 0c73cd
	role $2 types newrole_t;
Chris PeBenito 0c73cd
	allow newrole_t $3:chr_file { getattr read write ioctl };
Chris PeBenito daa0e0
')
Chris PeBenito daa0e0
Chris PeBenito c9428d
define(`selinux_run_newrole_depend',`
Chris PeBenito 0c73cd
	type newrole_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class chr_file { getattr read write ioctl };
Chris PeBenito daa0e0
')
Chris PeBenito daa0e0
Chris PeBenito 85bd7f
#######################################
Chris PeBenito 85bd7f
#
Chris PeBenito c9428d
# selinux_exec_newrole(domain)
Chris PeBenito 85bd7f
#
Chris PeBenito c9428d
define(`selinux_exec_newrole',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito cc41a9
	can_exec($1,newrole_exec_t)
Chris PeBenito 85bd7f
')
Chris PeBenito 85bd7f
Chris PeBenito c9428d
define(`selinux_exec_newrole_depend',`
Chris PeBenito 0c73cd
	type newrole_t, newrole_exec_t;
Chris PeBenito 0c73cd
Chris PeBenito cc41a9
	class file { rx_file_perms execute_no_trans };
Chris PeBenito 85bd7f
')
Chris PeBenito 85bd7f
Chris PeBenito daa0e0
########################################
Chris PeBenito c9428d
## <interface name="selinux_dontaudit_newrole_signal">
Chris PeBenito daa0e0
##	<description>
Chris PeBenito daa0e0
##		Do not audit the caller attempts to send
Chris PeBenito daa0e0
##		a signal to newrole.
Chris PeBenito daa0e0
##	</description>
Chris PeBenito daa0e0
##	<parameter name="domain">
Chris PeBenito daa0e0
##		The type of the process performing this action.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
## </interface>
Chris PeBenito daa0e0
#
Chris PeBenito c9428d
define(`selinux_dontaudit_newrole_signal',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	dontaudit $1 newrole_t:process signal;
Chris PeBenito daa0e0
')
Chris PeBenito daa0e0
Chris PeBenito c9428d
define(`selinux_dontaudit_newrole_signal_depend',`
Chris PeBenito 0c73cd
	type newrole_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class process signal;
Chris PeBenito daa0e0
')
Chris PeBenito daa0e0
Chris PeBenito 85bd7f
#######################################
Chris PeBenito 85bd7f
#
Chris PeBenito 85bd7f
# selinux_newrole_sigchld(domain)
Chris PeBenito 85bd7f
#
Chris PeBenito 85bd7f
define(`selinux_newrole_sigchld',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 newrole_t:process sigchld;
Chris PeBenito 85bd7f
')
Chris PeBenito 85bd7f
Chris PeBenito 85bd7f
define(`selinux_newrole_sigchld_depend',`
Chris PeBenito 0c73cd
	type newrole_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class process sigchld;
Chris PeBenito 85bd7f
')
Chris PeBenito 85bd7f
Chris PeBenito 85bd7f
#######################################
Chris PeBenito 85bd7f
#
Chris PeBenito c9428d
# selinux_use_newrole_fd(domain)
Chris PeBenito ab64c3
#
Chris PeBenito c9428d
define(`selinux_use_newrole_fd',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 newrole_t:fd use;
Chris PeBenito ab64c3
')
Chris PeBenito ab64c3
Chris PeBenito c9428d
define(`selinux_use_newrole_fd_depend',`
Chris PeBenito 0c73cd
	type newrole_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class fd use;
Chris PeBenito ab64c3
')
Chris PeBenito ab64c3
Chris PeBenito ab64c3
#######################################
Chris PeBenito c9428d
## <interface name="selinux_domtrans_restorecon">
Chris PeBenito daa0e0
##	<description>
Chris PeBenito daa0e0
##		Execute restorecon in the restorecon domain.
Chris PeBenito daa0e0
##	</description>
Chris PeBenito daa0e0
##	<parameter name="domain">
Chris PeBenito daa0e0
##		The type of the process performing this action.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
## </interface>
Chris PeBenito 85bd7f
#
Chris PeBenito c9428d
define(`selinux_domtrans_restorecon',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito cc41a9
	allow $1 restorecon_exec_t:file rx_file_perms;
Chris PeBenito 0c73cd
	allow $1 restorecon_t:process transition;
Chris PeBenito 0c73cd
	type_transition $1 restorecon_exec_t:process restorecon_t;
Chris PeBenito 0c73cd
	dontaudit $1 restorecon_t:process { noatsecure siginh rlimitinh };
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 restorecon_t:fd use;
Chris PeBenito 0c73cd
	allow restorecon_t $1:fd use;
Chris PeBenito 0c73cd
	allow restorecon_t $1:fifo_file rw_file_perms;
Chris PeBenito 0c73cd
	allow restorecon_t $1:process sigchld;
Chris PeBenito 85bd7f
')
Chris PeBenito 85bd7f
Chris PeBenito c9428d
define(`selinux_domtrans_restorecon_depend',`
Chris PeBenito 0c73cd
	type restorecon_t, restorecon_exec_t;
Chris PeBenito 0c73cd
Chris PeBenito cc41a9
	class file rx_file_perms;
Chris PeBenito 0c73cd
	class process { transition noatsecure siginh rlimitinh sigchld };
Chris PeBenito 0c73cd
	class fd use;
Chris PeBenito 0c73cd
	class fifo_file rw_file_perms;
Chris PeBenito 85bd7f
')
Chris PeBenito 85bd7f
Chris PeBenito daa0e0
########################################
Chris PeBenito c9428d
## <interface name="selinux_run_restorecon">
Chris PeBenito daa0e0
##	<description>
Chris PeBenito daa0e0
##		Execute restorecon in the restorecon domain, and
Chris PeBenito daa0e0
##		allow the specified role the restorecon domain,
Chris PeBenito daa0e0
##		and use the caller's terminal.
Chris PeBenito daa0e0
##	</description>
Chris PeBenito daa0e0
##	<parameter name="domain">
Chris PeBenito daa0e0
##		The type of the process performing this action.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
##	<parameter name="role">
Chris PeBenito daa0e0
##		The role to be allowed the restorecon domain.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
##	<parameter name="terminal">
Chris PeBenito daa0e0
##		The type of the terminal allow the restorecon domain to use.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
## </interface>
Chris PeBenito daa0e0
#
Chris PeBenito c9428d
define(`selinux_run_restorecon',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito c9428d
	selinux_domtrans_restorecon($1)
Chris PeBenito 0c73cd
	role $2 types restorecon_t;
Chris PeBenito 0c73cd
	allow restorecon_t $3:chr_file { getattr read write ioctl };
Chris PeBenito daa0e0
')
Chris PeBenito daa0e0
Chris PeBenito c9428d
define(`selinux_run_restorecon_depend',`
Chris PeBenito 0c73cd
	type restorecon_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class chr_file { getattr read write ioctl };
Chris PeBenito daa0e0
')
Chris PeBenito daa0e0
Chris PeBenito 85bd7f
#######################################
Chris PeBenito 85bd7f
#
Chris PeBenito c9428d
# selinux_exec_restorecon(domain)
Chris PeBenito 85bd7f
#
Chris PeBenito c9428d
define(`selinux_exec_restorecon',`
Chris PeBenito bd202f
requires_block_template(`$0'_depend)
Chris PeBenito cc41a9
	can_exec($1,restorecon_exec_t)
Chris PeBenito 85bd7f
')
Chris PeBenito 85bd7f
Chris PeBenito c9428d
define(`selinux_exec_restorecon_depend',`
Chris PeBenito 0c73cd
	type restorecon_t, restorecon_exec_t;
Chris PeBenito 0c73cd
Chris PeBenito cc41a9
	class file { rx_file_perms execute_no_trans };
Chris PeBenito 85bd7f
')
Chris PeBenito 85bd7f
Chris PeBenito 8623d5
########################################
Chris PeBenito c9428d
## <interface name="selinux_domtrans_runinit">
Chris PeBenito daa0e0
##	<description>
Chris PeBenito daa0e0
##		Execute run_init in the run_init domain.
Chris PeBenito daa0e0
##	</description>
Chris PeBenito daa0e0
##	<parameter name="domain">
Chris PeBenito daa0e0
##		The type of the process performing this action.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
## </interface>
Chris PeBenito 8623d5
#
Chris PeBenito c9428d
define(`selinux_domtrans_runinit',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito cc41a9
	allow $1 run_init_exec_t:file rx_file_perms;
Chris PeBenito 0c73cd
	allow $1 run_init_t:process transition;
Chris PeBenito 0c73cd
	type_transition $1 run_init_exec_t:process run_init_t;
Chris PeBenito 0c73cd
	dontaudit $1 run_init_t:process { noatsecure siginh rlimitinh };
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 run_init_t:fd use;
Chris PeBenito 0c73cd
	allow run_init_t $1:fd use;
Chris PeBenito 0c73cd
	allow run_init_t $1:fifo_file rw_file_perms;
Chris PeBenito 0c73cd
	allow run_init_t $1:process sigchld;
Chris PeBenito 8623d5
')
Chris PeBenito 8623d5
Chris PeBenito c9428d
define(`selinux_domtrans_runinit_depend',`
Chris PeBenito 0c73cd
	type run_init_t, run_init_exec_t;
Chris PeBenito 0c73cd
Chris PeBenito cc41a9
	class file rx_file_perms;
Chris PeBenito 0c73cd
	class process { transition noatsecure siginh rlimitinh sigchld };
Chris PeBenito 0c73cd
	class fd use;
Chris PeBenito 0c73cd
	class fifo_file rw_file_perms;
Chris PeBenito 8623d5
')
Chris PeBenito 8623d5
Chris PeBenito 8623d5
########################################
Chris PeBenito c9428d
## <interface name="selinux_run_runinit">
Chris PeBenito daa0e0
##	<description>
Chris PeBenito daa0e0
##		Execute run_init in the run_init domain, and
Chris PeBenito daa0e0
##		allow the specified role the run_init domain,
Chris PeBenito daa0e0
##		and use the caller's terminal.
Chris PeBenito daa0e0
##	</description>
Chris PeBenito daa0e0
##	<parameter name="domain">
Chris PeBenito daa0e0
##		The type of the process performing this action.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
##	<parameter name="role">
Chris PeBenito daa0e0
##		The role to be allowed the run_init domain.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
##	<parameter name="terminal">
Chris PeBenito daa0e0
##		The type of the terminal allow the run_init domain to use.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
## </interface>
Chris PeBenito daa0e0
#
Chris PeBenito c9428d
define(`selinux_run_runinit',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito c9428d
	selinux_domtrans_runinit($1)
Chris PeBenito 0c73cd
	role $2 types run_init_t;
Chris PeBenito 0c73cd
	allow run_init_t $3:chr_file { getattr read write ioctl };
Chris PeBenito daa0e0
')
Chris PeBenito daa0e0
Chris PeBenito c9428d
define(`selinux_run_runinit_depend',`
Chris PeBenito 0c73cd
	type run_init_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class chr_file { getattr read write ioctl };
Chris PeBenito daa0e0
')
Chris PeBenito daa0e0
Chris PeBenito daa0e0
########################################
Chris PeBenito 8623d5
#
Chris PeBenito c9428d
# selinux_use_runinit_fd(domain)
Chris PeBenito 8623d5
#
Chris PeBenito c9428d
define(`selinux_use_runinit_fd',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 run_init_t:fd use;
Chris PeBenito 8623d5
')
Chris PeBenito 8623d5
Chris PeBenito c9428d
define(`selinux_use_runinit_fd_depend',`
Chris PeBenito 0c73cd
	type run_init_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class fd use;
Chris PeBenito 8623d5
')
Chris PeBenito 8623d5
Chris PeBenito daa0e0
########################################
Chris PeBenito c9428d
## <interface name="selinux_domtrans_setfiles">
Chris PeBenito daa0e0
##	<description>
Chris PeBenito daa0e0
##		Execute setfiles in the setfiles domain.
Chris PeBenito daa0e0
##	</description>
Chris PeBenito daa0e0
##	<parameter name="domain">
Chris PeBenito daa0e0
##		The type of the process performing this action.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
## </interface>
Chris PeBenito 85bd7f
#
Chris PeBenito c9428d
define(`selinux_domtrans_setfiles',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito cc41a9
	allow $1 setfiles_exec_t:file rx_file_perms;
Chris PeBenito 0c73cd
	allow $1 setfiles_t:process transition;
Chris PeBenito 0c73cd
	type_transition $1 setfiles_exec_t:process setfiles_t;
Chris PeBenito 0c73cd
	dontaudit $1 setfiles_t:process { noatsecure siginh rlimitinh };
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 setfiles_t:fd use;
Chris PeBenito 0c73cd
	allow setfiles_t $1:fd use;
Chris PeBenito 0c73cd
	allow setfiles_t $1:fifo_file rw_file_perms;
Chris PeBenito 0c73cd
	allow setfiles_t $1:process sigchld;
Chris PeBenito 85bd7f
')
Chris PeBenito 85bd7f
Chris PeBenito c9428d
define(`selinux_domtrans_setfiles_depend',`
Chris PeBenito 0c73cd
	type setfiles_t, setfiles_exec_t;
Chris PeBenito 0c73cd
Chris PeBenito cc41a9
	class file rx_file_perms;
Chris PeBenito 0c73cd
	class process { transition noatsecure siginh rlimitinh sigchld };
Chris PeBenito 0c73cd
	class fd use;
Chris PeBenito 0c73cd
	class fifo_file rw_file_perms;
Chris PeBenito 85bd7f
')
Chris PeBenito 85bd7f
Chris PeBenito daa0e0
########################################
Chris PeBenito c9428d
## <interface name="selinux_run_setfiles">
Chris PeBenito daa0e0
##	<description>
Chris PeBenito daa0e0
##		Execute setfiles in the setfiles domain, and
Chris PeBenito daa0e0
##		allow the specified role the setfiles domain,
Chris PeBenito daa0e0
##		and use the caller's terminal.
Chris PeBenito daa0e0
##	</description>
Chris PeBenito daa0e0
##	<parameter name="domain">
Chris PeBenito daa0e0
##		The type of the process performing this action.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
##	<parameter name="role">
Chris PeBenito daa0e0
##		The role to be allowed the setfiles domain.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
##	<parameter name="terminal">
Chris PeBenito daa0e0
##		The type of the terminal allow the setfiles domain to use.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
## </interface>
Chris PeBenito daa0e0
#
Chris PeBenito c9428d
define(`selinux_run_setfiles',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito c9428d
	selinux_domtrans_setfiles($1)
Chris PeBenito 0c73cd
	role $2 types setfiles_t;
Chris PeBenito 0c73cd
	allow setfiles_t $3:chr_file { getattr read write ioctl };
Chris PeBenito daa0e0
')
Chris PeBenito daa0e0
Chris PeBenito c9428d
define(`selinux_run_setfiles_depend',`
Chris PeBenito 0c73cd
	type setfiles_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class chr_file { getattr read write ioctl };
Chris PeBenito daa0e0
')
Chris PeBenito daa0e0
Chris PeBenito 85bd7f
#######################################
Chris PeBenito 85bd7f
#
Chris PeBenito c9428d
# selinux_exec_setfiles(domain)
Chris PeBenito 85bd7f
#
Chris PeBenito c9428d
define(`selinux_exec_setfiles',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito cc41a9
	can_exec($1,setfiles_exec_t)
Chris PeBenito 85bd7f
')
Chris PeBenito 85bd7f
Chris PeBenito c9428d
define(`selinux_exec_setfiles_depend',`
Chris PeBenito 0c73cd
	type setfiles_exec_t;
Chris PeBenito 0c73cd
Chris PeBenito cc41a9
	class file { rx_file_perms execute_no_trans };
Chris PeBenito 85bd7f
')
Chris PeBenito 85bd7f
Chris PeBenito b4cd15
########################################
Chris PeBenito b4cd15
#
Chris PeBenito bd202f
# selinux_read_config(domain)
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
define(`selinux_read_config',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito cc41a9
	allow $1 selinux_config_t:dir r_dir_perms;
Chris PeBenito cc41a9
	allow $1 selinux_config_t:file r_file_perms;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
define(`selinux_read_config_depend',`
Chris PeBenito 0c73cd
	type selinux_config_t;
Chris PeBenito 0c73cd
Chris PeBenito cc41a9
	class dir r_dir_perms;
Chris PeBenito cc41a9
	class file r_file_perms;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
########################################
Chris PeBenito b4cd15
#
Chris PeBenito bd202f
# selinux_read_default_contexts(domain)
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
define(`selinux_read_default_contexts',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 selinux_config_t:dir search;
Chris PeBenito cc41a9
	allow $1 default_context_t:dir r_dir_perms;
Chris PeBenito cc41a9
	allow $1 default_context_t:file r_file_perms;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
define(`selinux_read_default_contexts_depend',`
Chris PeBenito 0c73cd
	type selinux_config_t, default_context_t;
Chris PeBenito 0c73cd
Chris PeBenito cc41a9
	class dir r_dir_perms;
Chris PeBenito cc41a9
	class file r_file_perms;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
########################################
Chris PeBenito b4cd15
#
Chris PeBenito bd202f
# selinux_read_file_contexts(domain)
Chris PeBenito ee5772
#
Chris PeBenito ee5772
define(`selinux_read_file_contexts',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 selinux_config_t:dir search;
Chris PeBenito cc41a9
	allow $1 file_context_t:dir r_dir_perms;
Chris PeBenito cc41a9
	allow $1 file_context_t:file r_file_perms;
Chris PeBenito ee5772
')
Chris PeBenito ee5772
Chris PeBenito ee5772
define(`selinux_read_file_contexts_depend',`
Chris PeBenito 0c73cd
	type selinux_config_t, file_context_t;
Chris PeBenito 0c73cd
Chris PeBenito cc41a9
	class dir r_dir_perms;
Chris PeBenito cc41a9
	class file r_file_perms;
Chris PeBenito ee5772
')
Chris PeBenito ee5772
Chris PeBenito ee5772
########################################
Chris PeBenito ee5772
#
Chris PeBenito c9428d
# selinux_read_binary_pol(domain)
Chris PeBenito b4cd15
#
Chris PeBenito c9428d
define(`selinux_read_binary_pol',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito cc41a9
	allow $1 policy_config_t:dir r_dir_perms;
Chris PeBenito cc41a9
	allow $1 policy_config_t:file r_file_perms;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito c9428d
define(`selinux_read_binary_pol_depend',`
Chris PeBenito 0c73cd
	type policy_config_t;
Chris PeBenito 0c73cd
Chris PeBenito cc41a9
	class dir r_dir_perms;
Chris PeBenito cc41a9
	class file r_file_perms;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
########################################
Chris PeBenito b4cd15
#
Chris PeBenito c9428d
# selinux_write_binary_pol(domain)
Chris PeBenito b4cd15
#
Chris PeBenito c9428d
define(`selinux_write_binary_pol',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito cc41a9
	allow $1 policy_config_t:dir rw_dir_perms;
Chris PeBenito 0c73cd
	allow $1 policy_config_t:file { getattr create write unlink };
Chris PeBenito 0c73cd
	typeattribute $1 can_write_binary_policy;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito c9428d
define(`selinux_write_binary_pol_depend',`
Chris PeBenito 0c73cd
	attribute can_write_binary_policy;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	type policy_config_t;
Chris PeBenito 0c73cd
Chris PeBenito cc41a9
	class dir rw_dir_perms;
Chris PeBenito 0c73cd
	class file { getattr create write unlink };
Chris PeBenito b4cd15
')
Chris PeBenito ef3734
Chris PeBenito ef3734
########################################
Chris PeBenito c9428d
## <interface name="selinux_relabelto_binary_pol">
Chris PeBenito efd8ed
##	<description>
Chris PeBenito efd8ed
##		Allow the caller to relabel a file to the binary policy type.
Chris PeBenito efd8ed
##	</description>
Chris PeBenito efd8ed
##	<parameter name="domain">
Chris PeBenito efd8ed
##		The type of the process performing this action.
Chris PeBenito efd8ed
##	</parameter>
Chris PeBenito efd8ed
## </interface>
Chris PeBenito efd8ed
#
Chris PeBenito c9428d
define(`selinux_relabelto_binary_pol',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 policy_config_t:file relabelto;
Chris PeBenito 0c73cd
	typeattribute $1 can_relabelto_binary_policy;
Chris PeBenito efd8ed
')
Chris PeBenito efd8ed
Chris PeBenito c9428d
define(`selinux_relabelto_binary_pol_depend',`
Chris PeBenito 0c73cd
	attribute can_relabelto_binary_policy;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	type policy_config_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class file relabelto;
Chris PeBenito efd8ed
')
Chris PeBenito efd8ed
Chris PeBenito efd8ed
########################################
Chris PeBenito ef3734
#
Chris PeBenito c9428d
# selinux_manage_binary_pol(domain)
Chris PeBenito ef3734
#
Chris PeBenito c9428d
define(`selinux_manage_binary_pol',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	# FIXME: search etc_t:dir
Chris PeBenito 0c73cd
	allow $1 selinux_config_t:dir search;
Chris PeBenito cc41a9
	allow $1 policy_config_t:dir r_dir_perms;
Chris PeBenito cc41a9
	allow $1 policy_config_t:file create_file_perms;
Chris PeBenito 0c73cd
	typeattribute $1 can_write_binary_policy;
Chris PeBenito ef3734
')
Chris PeBenito ef3734
Chris PeBenito c9428d
define(`selinux_manage_binary_pol_depend',`
Chris PeBenito 0c73cd
	attribute can_write_binary_policy;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	type selinux_config_t, policy_config_t;
Chris PeBenito cc41a9
	class dir create_dir_perms;
Chris PeBenito cc41a9
	class file create_file_perms;
Chris PeBenito ef3734
')
Chris PeBenito ef3734
Chris PeBenito ef3734
########################################
Chris PeBenito ef3734
#
Chris PeBenito c9428d
# selinux_read_src_pol(domain)
Chris PeBenito ef3734
#
Chris PeBenito c9428d
define(`selinux_read_src_pol',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	# FIXME: search etc_t:dir
Chris PeBenito 0c73cd
	allow $1 selinux_config_t:dir search;
Chris PeBenito cc41a9
	allow $1 policy_src_t:dir r_dir_perms;
Chris PeBenito cc41a9
	allow $1 policy_src_t:file r_file_perms;
Chris PeBenito ef3734
')
Chris PeBenito ef3734
Chris PeBenito c9428d
define(`selinux_read_src_pol_depend',`
Chris PeBenito 0c73cd
	type selinux_config_t, policy_src_t;
Chris PeBenito 0c73cd
Chris PeBenito cc41a9
	class dir r_dir_perms;
Chris PeBenito cc41a9
	class file r_file_perms;
Chris PeBenito ef3734
')
Chris PeBenito ef3734
Chris PeBenito ef3734
########################################
Chris PeBenito ef3734
#
Chris PeBenito c9428d
# selinux_manage_src_pol(domain)
Chris PeBenito ef3734
#
Chris PeBenito c9428d
define(`selinux_manage_src_pol',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	# FIXME: search etc_t:dir
Chris PeBenito 0c73cd
	allow $1 selinux_config_t:dir search;
Chris PeBenito cc41a9
	allow $1 policy_src_t:dir create_dir_perms;
Chris PeBenito cc41a9
	allow $1 policy_src_t:file create_file_perms;
Chris PeBenito ef3734
')
Chris PeBenito ef3734
Chris PeBenito c9428d
define(`selinux_manage_src_pol_depend',`
Chris PeBenito 0c73cd
	type selinux_config_t, policy_src_t;
Chris PeBenito 0c73cd
Chris PeBenito cc41a9
	class dir create_dir_perms;
Chris PeBenito cc41a9
	class file create_file_perms;
Chris PeBenito ef3734
')
Chris PeBenito 162a57
Chris PeBenito 162a57
## </module>