Chris PeBenito 48e0db
## <module name="libraries" layer="system">
Chris PeBenito 48e0db
## <summary>Policy for system libraries.</summary>
Chris PeBenito 48e0db
Chris PeBenito 48e0db
########################################
Chris PeBenito c9428d
## <interface name="libs_domtrans_ldconfig">
Chris PeBenito 48e0db
##	<description>
Chris PeBenito 48e0db
##		Execute ldconfig in the ldconfig domain.
Chris PeBenito 48e0db
##	</description>
Chris PeBenito 48e0db
##	<parameter name="domain">
Chris PeBenito 48e0db
##		The type of the process performing this action.
Chris PeBenito 48e0db
##	</parameter>
Chris PeBenito 48e0db
## </interface>
Chris PeBenito 48e0db
#
Chris PeBenito c9428d
define(`libs_domtrans_ldconfig',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0fd9dc
	domain_auto_trans($1,ldconfig_exec_t,ldconfig_t)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 ldconfig_t:fd use;
Chris PeBenito 0c73cd
	allow ldconfig_t $1:fd use;
Chris PeBenito 0c73cd
	allow ldconfig_t $1:fifo_file rw_file_perms;
Chris PeBenito 0c73cd
	allow ldconfig_t $1:process sigchld;
Chris PeBenito 48e0db
')
Chris PeBenito 48e0db
Chris PeBenito c9428d
define(`libs_domtrans_ldconfig_depend',`
Chris PeBenito 0c73cd
	type ldconfig_t, ldconfig_exec_t;
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	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 48e0db
')
Chris PeBenito 48e0db
Chris PeBenito 48e0db
########################################
Chris PeBenito c9428d
## <interface name="libs_run_ldconfig">
Chris PeBenito 48e0db
##	<description>
Chris PeBenito 48e0db
##		Execute ldconfig in the ldconfig domain.
Chris PeBenito 48e0db
##	</description>
Chris PeBenito 48e0db
##	<parameter name="domain">
Chris PeBenito 48e0db
##		The type of the process performing this action.
Chris PeBenito 48e0db
##	</parameter>
Chris PeBenito 48e0db
##	<parameter name="role">
Chris PeBenito 48e0db
##		The role to allow the ldconfig domain.
Chris PeBenito 48e0db
##	</parameter>
Chris PeBenito 48e0db
##	<parameter name="terminal">
Chris PeBenito 48e0db
##		The type of the terminal allow the ldconfig domain to use.
Chris PeBenito 48e0db
##	</parameter>
Chris PeBenito 48e0db
## </interface>
Chris PeBenito 48e0db
#
Chris PeBenito c9428d
define(`libs_run_ldconfig',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito c9428d
	libs_domtrans_ldconfig($1)
Chris PeBenito 0c73cd
	role $2 types ldconfig_t;
Chris PeBenito 0c73cd
	allow ldconfig_t $3:chr_file { getattr read write ioctl };
Chris PeBenito 48e0db
')
Chris PeBenito 48e0db
Chris PeBenito c9428d
define(`libs_run_ldconfig_depend',`
Chris PeBenito 0c73cd
	type ldconfig_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class chr_file { getattr read write ioctl };
Chris PeBenito 48e0db
')
Chris PeBenito e181fe
Chris PeBenito b4cd15
########################################
Chris PeBenito c9428d
## <interface name="libs_use_ld_so">
Chris PeBenito f5c42b
##	<description>
Chris PeBenito f5c42b
##		Use the dynamic link/loader for automatic loading
Chris PeBenito f5c42b
##		of shared libraries.
Chris PeBenito f5c42b
##	</description>
Chris PeBenito f5c42b
##	<parameter name="domain">
Chris PeBenito f5c42b
##		The type of the process performing this action.
Chris PeBenito f5c42b
##	</parameter>
Chris PeBenito f5c42b
## </interface>
Chris PeBenito b4cd15
#
Chris PeBenito c9428d
define(`libs_use_ld_so',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito c9428d
	files_read_generic_etc_files_directory($1)
Chris PeBenito 0c73cd
	allow $1 lib_t:dir r_dir_perms;
Chris PeBenito 0c73cd
	allow $1 lib_t:lnk_file r_file_perms;
Chris PeBenito 0c73cd
	allow $1 ld_so_t:lnk_file r_file_perms;
Chris PeBenito 0c73cd
	allow $1 ld_so_t:file rx_file_perms;
Chris PeBenito 0c73cd
	allow $1 ld_so_cache_t:file r_file_perms;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito c9428d
define(`libs_use_ld_so_depend',`
Chris PeBenito 0c73cd
	type lib_t, ld_so_t, ld_so_cache_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class dir r_dir_perms;
Chris PeBenito 0c73cd
	class lnk_file r_file_perms;
Chris PeBenito 0c73cd
	class file rx_file_perms;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
########################################
Chris PeBenito c9428d
## <interface name="libs_legacy_use_ld_so">
Chris PeBenito f5c42b
##	<description>
Chris PeBenito f5c42b
##		Use the dynamic link/loader for automatic loading
Chris PeBenito f5c42b
##		of shared libraries with legacy support.
Chris PeBenito f5c42b
##	</description>
Chris PeBenito f5c42b
##	<parameter name="domain">
Chris PeBenito f5c42b
##		The type of the process performing this action.
Chris PeBenito f5c42b
##	</parameter>
Chris PeBenito f5c42b
## </interface>
Chris PeBenito 8beec8
#
Chris PeBenito c9428d
define(`libs_legacy_use_ld_so',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito c9428d
	libs_use_ld_so($1)
Chris PeBenito 0c73cd
	allow $1 ld_so_t:file execmod;
Chris PeBenito 0c73cd
	allow $1 ld_so_cache_t:file execute;
Chris PeBenito 8beec8
')
Chris PeBenito 8beec8
Chris PeBenito c9428d
define(`libs_legacy_use_ld_so_depend',`
Chris PeBenito 0c73cd
	type ld_so_t, ld_so_cache_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class file { execute execmod };
Chris PeBenito 8beec8
')
Chris PeBenito 8beec8
Chris PeBenito 8beec8
########################################
Chris PeBenito c9428d
## <interface name="libs_exec_ld_so">
Chris PeBenito f5c42b
##	<description>
Chris PeBenito f5c42b
##		Execute the dynamic link/loader in the caller's
Chris PeBenito f5c42b
##		domain.  This is commonly needed for the
Chris PeBenito f5c42b
##		/usr/bin/ldd program.  Note: this can be used
Chris PeBenito f5c42b
##		to execute any binary that the caller can
Chris PeBenito f5c42b
##		read, even if the caller does not have execute
Chris PeBenito f5c42b
##		permissions.
Chris PeBenito f5c42b
##	</description>
Chris PeBenito f5c42b
##	<parameter name="domain">
Chris PeBenito f5c42b
##		The type of the process performing this action.
Chris PeBenito f5c42b
##	</parameter>
Chris PeBenito f5c42b
## </interface>
Chris PeBenito 075c4f
#
Chris PeBenito c9428d
define(`libs_exec_ld_so',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 lib_t:dir r_dir_perms;
Chris PeBenito 0c73cd
	allow $1 lib_t:lnk_file r_file_perms;
Chris PeBenito 0c73cd
	allow $1 ld_so_t:lnk_file r_file_perms;
Chris PeBenito 0c73cd
	allow $1 ld_so_t:file { r_file_perms execute execute_no_trans };
Chris PeBenito 075c4f
')
Chris PeBenito 075c4f
Chris PeBenito c9428d
define(`libs_exec_ld_so_depend',`
Chris PeBenito 0c73cd
	type lib_t, ld_so_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class dir r_dir_perms;
Chris PeBenito 0c73cd
	class lnk_file r_file_perms;
Chris PeBenito 0c73cd
	class file { r_file_perms execute execute_no_trans };
Chris PeBenito 075c4f
')
Chris PeBenito 075c4f
Chris PeBenito 075c4f
########################################
Chris PeBenito c9428d
## <interface name="libs_rw_ld_so_cache">
Chris PeBenito f5c42b
##	<description>
Chris PeBenito f5c42b
##		Modify the dynamic link/loader's cached listing
Chris PeBenito f5c42b
##		of shared libraries.
Chris PeBenito f5c42b
##	</description>
Chris PeBenito f5c42b
##	<parameter name="domain">
Chris PeBenito f5c42b
##		The type of the process performing this action.
Chris PeBenito f5c42b
##	</parameter>
Chris PeBenito f5c42b
## </interface>
Chris PeBenito b4cd15
#
Chris PeBenito c9428d
define(`libs_rw_ld_so_cache',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito c9428d
	files_read_generic_etc_files_directory($1)
Chris PeBenito dd8229
	allow $1 ld_so_cache_t:file rw_file_perms;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito c9428d
define(`libs_rw_ld_so_cache_depend',`
Chris PeBenito 0c73cd
	type ld_so_cache_t;
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	class file rw_file_perms;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
########################################
Chris PeBenito c9428d
## <interface name="libs_read_lib">
Chris PeBenito f5c42b
##	<description>
Chris PeBenito f5c42b
##		Read files in the library directories, such
Chris PeBenito f5c42b
##		as static libraries.
Chris PeBenito f5c42b
##	</description>
Chris PeBenito f5c42b
##	<parameter name="domain">
Chris PeBenito f5c42b
##		The type of the process performing this action.
Chris PeBenito f5c42b
##	</parameter>
Chris PeBenito f5c42b
## </interface>
Chris PeBenito b4cd15
#
Chris PeBenito c9428d
define(`libs_read_lib',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	allow $1 lib_t:dir r_dir_perms;
Chris PeBenito dd8229
	allow $1 lib_t:{ file lnk_file } r_file_perms;
Chris PeBenito f5c42b
')
Chris PeBenito f5c42b
Chris PeBenito c9428d
define(`libs_read_lib_depend',`
Chris PeBenito 0c73cd
	type lib_t;
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	class dir r_dir_perms;
Chris PeBenito dd8229
	class lnk_file r_file_perms;
Chris PeBenito dd8229
	class file r_file_perms;
Chris PeBenito f5c42b
')
Chris PeBenito f5c42b
Chris PeBenito f5c42b
########################################
Chris PeBenito c9428d
## <interface name="libs_exec_lib_files">
Chris PeBenito f5c42b
##	<description>
Chris PeBenito f5c42b
##		Execute library scripts in the caller domain.
Chris PeBenito f5c42b
##	</description>
Chris PeBenito f5c42b
##	<parameter name="domain">
Chris PeBenito f5c42b
##		The type of the process performing this action.
Chris PeBenito f5c42b
##	</parameter>
Chris PeBenito f5c42b
## </interface>
Chris PeBenito f5c42b
#
Chris PeBenito c9428d
define(`libs_exec_lib_files',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	allow $1 lib_t:dir r_dir_perms;
Chris PeBenito 0fd9dc
	allow $1 lib_t:lnk_file r_file_perms;
Chris PeBenito 0c73cd
	allow $1 lib_t:file { getattr read execute execute_no_trans };
Chris PeBenito f5c42b
')
Chris PeBenito f5c42b
Chris PeBenito c9428d
define(`libs_exec_lib_files_depend',`
Chris PeBenito 0c73cd
	type lib_t;
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	class dir r_dir_perms;
Chris PeBenito dd8229
	class lnk_file r_file_perms;
Chris PeBenito 0c73cd
	class file { getattr read execute execute_no_trans };
Chris PeBenito f5c42b
')
Chris PeBenito f5c42b
Chris PeBenito f5c42b
########################################
Chris PeBenito c9428d
## <interface name="libs_use_shared_libs">
Chris PeBenito f5c42b
##	<description>
Chris PeBenito f5c42b
##		Load and execute functions from shared libraries.
Chris PeBenito f5c42b
##	</description>
Chris PeBenito f5c42b
##	<parameter name="domain">
Chris PeBenito f5c42b
##		The type of the process performing this action.
Chris PeBenito f5c42b
##	</parameter>
Chris PeBenito f5c42b
## </interface>
Chris PeBenito b4cd15
#
Chris PeBenito c9428d
define(`libs_use_shared_libs',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito c9428d
	files_search_usr($1)
Chris PeBenito 0c73cd
	allow $1 lib_t:dir r_dir_perms;
Chris PeBenito 0c73cd
	allow $1 lib_t:lnk_file r_file_perms;
Chris PeBenito 0c73cd
	allow $1 { shlib_t texrel_shlib_t }:lnk_file r_file_perms;
Chris PeBenito 0c73cd
	allow $1 { shlib_t texrel_shlib_t }:file rx_file_perms;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito c9428d
define(`libs_use_shared_libs_depend',`
Chris PeBenito 0c73cd
	type lib_t, shlib_t, texrel_shlib_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class dir r_dir_perms;
Chris PeBenito 0c73cd
	class lnk_file r_file_perms;
Chris PeBenito 0c73cd
	class file rx_dir_perms;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
########################################
Chris PeBenito c9428d
## <interface name="libs_legacy_use_shared_libs">
Chris PeBenito f5c42b
##	<description>
Chris PeBenito f5c42b
##		Load and execute functions from shared libraries,
Chris PeBenito f5c42b
##		with legacy support.
Chris PeBenito f5c42b
##	</description>
Chris PeBenito f5c42b
##	<parameter name="domain">
Chris PeBenito f5c42b
##		The type of the process performing this action.
Chris PeBenito f5c42b
##	</parameter>
Chris PeBenito f5c42b
## </interface>
Chris PeBenito 8beec8
#
Chris PeBenito c9428d
define(`libs_legacy_use_shared_libs',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito c9428d
	libs_use_shared_libs($1)
Chris PeBenito 0c73cd
	allow $1 { shlib_t texrel_shlib_t }:file execmod;
Chris PeBenito 8beec8
')
Chris PeBenito 8beec8
Chris PeBenito c9428d
define(`libs_legacy_use_shared_libs_depend',`
Chris PeBenito 0c73cd
	type shlib_t, texrel_shlib_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class file execmod;
Chris PeBenito 8beec8
')
Chris PeBenito 8beec8
Chris PeBenito 48e0db
## </module>