Chris PeBenito 48e0db
## <summary>Policy for system libraries.</summary>
Chris PeBenito 48e0db
Chris PeBenito 48e0db
########################################
Chris PeBenito 62a7b0
## <summary>
Chris PeBenito 414e41
##	Execute ldconfig in the ldconfig domain.
Chris PeBenito 62a7b0
## </summary>
Chris PeBenito 414e41
## <param name="domain">
Chris PeBenito 414e41
##	The type of the process performing this action.
Chris PeBenito 414e41
## </param>
Chris PeBenito 48e0db
#
Chris PeBenito 199895
interface(`libs_domtrans_ldconfig',`
Chris PeBenito 139520
	gen_require(`
Chris PeBenito 139520
		type ldconfig_t, ldconfig_exec_t;
Chris PeBenito 139520
		class process sigchld;
Chris PeBenito 139520
		class fd use;
Chris PeBenito 139520
		class fifo_file rw_file_perms;
Chris PeBenito 139520
	')
Chris PeBenito 139520
Chris PeBenito 139520
	corecmd_search_sbin($1)
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 48e0db
########################################
Chris PeBenito 62a7b0
## <summary>
Chris PeBenito 414e41
##	Execute ldconfig in the ldconfig domain.
Chris PeBenito 62a7b0
## </summary>
Chris PeBenito 414e41
## <param name="domain">
Chris PeBenito 414e41
##	The type of the process performing this action.
Chris PeBenito 414e41
## </param>
Chris PeBenito 414e41
## <param name="role">
Chris PeBenito 414e41
##	The role to allow the ldconfig domain.
Chris PeBenito 414e41
## </param>
Chris PeBenito 414e41
## <param name="terminal">
Chris PeBenito 414e41
##	The type of the terminal allow the ldconfig domain to use.
Chris PeBenito 414e41
## </param>
Chris PeBenito 48e0db
#
Chris PeBenito 199895
interface(`libs_run_ldconfig',`
Chris PeBenito 139520
	gen_require(`
Chris PeBenito 139520
		type ldconfig_t;
Chris PeBenito 139520
		class chr_file rw_term_perms;
Chris PeBenito 139520
	')
Chris PeBenito 0c73cd
Chris PeBenito c9428d
	libs_domtrans_ldconfig($1)
Chris PeBenito 0c73cd
	role $2 types ldconfig_t;
Chris PeBenito 139520
	allow ldconfig_t $3:chr_file rw_term_perms;
Chris PeBenito 48e0db
')
Chris PeBenito e181fe
Chris PeBenito b4cd15
########################################
Chris PeBenito 62a7b0
## <summary>
Chris PeBenito 414e41
##	Use the dynamic link/loader for automatic loading
Chris PeBenito 414e41
##	of shared libraries.
Chris PeBenito 62a7b0
## </summary>
Chris PeBenito 414e41
## <param name="domain">
Chris PeBenito 414e41
##	The type of the process performing this action.
Chris PeBenito 414e41
## </param>
Chris PeBenito b4cd15
#
Chris PeBenito 199895
interface(`libs_use_ld_so',`
Chris PeBenito 139520
	gen_require(`
Chris PeBenito 139520
		type lib_t, ld_so_t, ld_so_cache_t;
Chris PeBenito 139520
		class dir r_dir_perms;
Chris PeBenito 139520
		class lnk_file r_file_perms;
Chris PeBenito 139520
		class file rx_file_perms;
Chris PeBenito 139520
	')
Chris PeBenito 139520
Chris PeBenito 139520
	files_list_etc($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 b4cd15
########################################
Chris PeBenito 62a7b0
## <summary>
Chris PeBenito 414e41
##	Use the dynamic link/loader for automatic loading
Chris PeBenito 414e41
##	of shared libraries with legacy support.
Chris PeBenito 62a7b0
## </summary>
Chris PeBenito 414e41
## <param name="domain">
Chris PeBenito 414e41
##	The type of the process performing this action.
Chris PeBenito 414e41
## </param>
Chris PeBenito 8beec8
#
Chris PeBenito 199895
interface(`libs_legacy_use_ld_so',`
Chris PeBenito 139520
	gen_require(`
Chris PeBenito 139520
		type ld_so_t, ld_so_cache_t;
Chris PeBenito 139520
		class file { execute execmod };
Chris PeBenito 139520
	')
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 8beec8
########################################
Chris PeBenito 62a7b0
## <summary>
Chris PeBenito 62a7b0
##	Execute the dynamic link/loader in the caller's domain.
Chris PeBenito 62a7b0
## </summary>
Chris PeBenito 414e41
## <param name="domain">
Chris PeBenito 414e41
##	The type of the process performing this action.
Chris PeBenito 414e41
## </param>
Chris PeBenito 075c4f
#
Chris PeBenito 199895
interface(`libs_exec_ld_so',`
Chris PeBenito 139520
	gen_require(`
Chris PeBenito 139520
		type lib_t, ld_so_t;
Chris PeBenito 139520
		class dir r_dir_perms;
Chris PeBenito 139520
		class lnk_file r_file_perms;
Chris PeBenito 139520
	')
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 139520
	can_exec($1,ld_so_t)
Chris PeBenito 075c4f
')
Chris PeBenito 075c4f
Chris PeBenito 075c4f
########################################
Chris PeBenito 62a7b0
## <summary>
Chris PeBenito 414e41
##	Modify the dynamic link/loader's cached listing
Chris PeBenito 414e41
##	of shared libraries.
Chris PeBenito 62a7b0
## </summary>
Chris PeBenito 414e41
## <param name="domain">
Chris PeBenito 414e41
##	The type of the process performing this action.
Chris PeBenito 414e41
## </param>
Chris PeBenito b4cd15
#
Chris PeBenito 199895
interface(`libs_rw_ld_so_cache',`
Chris PeBenito 139520
	gen_require(`
Chris PeBenito 139520
		type ld_so_cache_t;
Chris PeBenito 139520
		class file rw_file_perms;
Chris PeBenito 139520
	')
Chris PeBenito 0c73cd
Chris PeBenito 139520
	files_list_etc($1)
Chris PeBenito dd8229
	allow $1 ld_so_cache_t:file rw_file_perms;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito 139520
########################################
Chris PeBenito 62a7b0
## <summary>
Chris PeBenito 414e41
##	Search lib directories.
Chris PeBenito 62a7b0
## </summary>
Chris PeBenito 414e41
## <param name="domain">
Chris PeBenito 414e41
##	The type of the process performing this action.
Chris PeBenito 414e41
## </param>
Chris PeBenito 139520
#
Chris PeBenito 199895
interface(`libs_search_lib',`
Chris PeBenito 139520
	gen_require(`
Chris PeBenito 139520
		type lib_t;
Chris PeBenito 139520
		class dir search;
Chris PeBenito 139520
	')
Chris PeBenito 0c73cd
Chris PeBenito 139520
	allow $1 lib_t:dir search;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
########################################
Chris PeBenito 62a7b0
## <summary>
Chris PeBenito 414e41
##	Read files in the library directories, such
Chris PeBenito 414e41
##	as static libraries.
Chris PeBenito 62a7b0
## </summary>
Chris PeBenito 414e41
## <param name="domain">
Chris PeBenito 414e41
##	The type of the process performing this action.
Chris PeBenito 414e41
## </param>
Chris PeBenito b4cd15
#
Chris PeBenito 199895
interface(`libs_read_lib',`
Chris PeBenito 139520
	gen_require(`
Chris PeBenito 139520
		type lib_t;
Chris PeBenito 139520
		class dir r_dir_perms;
Chris PeBenito 139520
		class lnk_file r_file_perms;
Chris PeBenito 139520
		class file r_file_perms;
Chris PeBenito 139520
	')
Chris PeBenito 0c73cd
Chris PeBenito 139520
	files_search_usr($1)
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 f5c42b
########################################
Chris PeBenito 62a7b0
## <summary>
Chris PeBenito 414e41
##	Execute library scripts in the caller domain.
Chris PeBenito 62a7b0
## </summary>
Chris PeBenito 414e41
## <param name="domain">
Chris PeBenito 414e41
##	The type of the process performing this action.
Chris PeBenito 414e41
## </param>
Chris PeBenito f5c42b
#
Chris PeBenito 199895
interface(`libs_exec_lib_files',`
Chris PeBenito 139520
	gen_require(`
Chris PeBenito 139520
		type lib_t;
Chris PeBenito 139520
		class dir r_dir_perms;
Chris PeBenito 139520
		class lnk_file r_file_perms;
Chris PeBenito 139520
	')
Chris PeBenito 0c73cd
Chris PeBenito 139520
	files_search_usr($1)
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 139520
	can_exec($1,lib_t)
Chris PeBenito f5c42b
')
Chris PeBenito f5c42b
Chris PeBenito f5c42b
########################################
Chris PeBenito 5f38a6
## <summary>
Chris PeBenito 5f38a6
##	Relabel files to the type used in library directories.
Chris PeBenito 5f38a6
## </summary>
Chris PeBenito 5f38a6
## <param name="domain">
Chris PeBenito 5f38a6
##	The type of the process performing this action.
Chris PeBenito 5f38a6
## </param>
Chris PeBenito 5f38a6
#
Chris PeBenito 5f38a6
interface(`libs_relabelto_lib_files',`
Chris PeBenito 5f38a6
	gen_require(`
Chris PeBenito 5f38a6
		type lib_t;
Chris PeBenito 5f38a6
		class file relabelto;
Chris PeBenito 5f38a6
	')
Chris PeBenito 5f38a6
Chris PeBenito 5f38a6
	allow $1 lib_t:file relabelto;
Chris PeBenito 5f38a6
')
Chris PeBenito 5f38a6
Chris PeBenito 5f38a6
########################################
Chris PeBenito 62a7b0
## <summary>
Chris PeBenito 414e41
##	Load and execute functions from shared libraries.
Chris PeBenito 62a7b0
## </summary>
Chris PeBenito 414e41
## <param name="domain">
Chris PeBenito 414e41
##	The type of the process performing this action.
Chris PeBenito 414e41
## </param>
Chris PeBenito b4cd15
#
Chris PeBenito 199895
interface(`libs_use_shared_libs',`
Chris PeBenito 139520
	gen_require(`
Chris PeBenito 139520
		type lib_t, shlib_t, texrel_shlib_t;
Chris PeBenito 139520
		class dir r_dir_perms;
Chris PeBenito 139520
		class lnk_file r_file_perms;
Chris PeBenito 98a8ea
		class file { rx_file_perms execmod };
Chris PeBenito 139520
	')
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 98a8ea
	allow $1 texrel_shlib_t:file execmod;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
########################################
Chris PeBenito 62a7b0
## <summary>
Chris PeBenito 414e41
##	Load and execute functions from shared libraries,
Chris PeBenito 414e41
##	with legacy support.
Chris PeBenito 62a7b0
## </summary>
Chris PeBenito 414e41
## <param name="domain">
Chris PeBenito 414e41
##	The type of the process performing this action.
Chris PeBenito 414e41
## </param>
Chris PeBenito 8beec8
#
Chris PeBenito 199895
interface(`libs_legacy_use_shared_libs',`
Chris PeBenito 139520
	gen_require(`
Chris PeBenito 139520
		type shlib_t, texrel_shlib_t;
Chris PeBenito 139520
		class file execmod;
Chris PeBenito 139520
	')
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