2005-04-20 19:07:16 +00:00
|
|
|
|
2005-12-09 15:42:39 +00:00
|
|
|
policy_module(libraries,1.1.1)
|
2005-04-26 17:00:25 +00:00
|
|
|
|
2005-05-23 15:45:53 +00:00
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Declarations
|
|
|
|
#
|
|
|
|
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
|
|
|
# ld_so_cache_t is the type of /etc/ld.so.cache.
|
|
|
|
#
|
|
|
|
type ld_so_cache_t;
|
2005-06-29 14:26:41 +00:00
|
|
|
files_type(ld_so_cache_t)
|
2005-04-14 20:18:17 +00:00
|
|
|
|
2005-05-23 15:45:53 +00:00
|
|
|
#
|
2005-04-14 20:18:17 +00:00
|
|
|
# ld_so_t is the type of the system dynamic loaders.
|
|
|
|
#
|
|
|
|
type ld_so_t;
|
2005-06-29 14:26:41 +00:00
|
|
|
files_type(ld_so_t)
|
2005-04-14 20:18:17 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# lib_t is the type of files in the system lib directories.
|
|
|
|
#
|
|
|
|
type lib_t;
|
2005-06-29 14:26:41 +00:00
|
|
|
files_type(lib_t)
|
2005-04-14 20:18:17 +00:00
|
|
|
|
2005-11-15 18:47:20 +00:00
|
|
|
kernel_use_ld_so_from(lib_t,ld_so_t,ld_so_cache_t)
|
|
|
|
kernel_use_shared_libs_from(lib_t,{ shlib_t texrel_shlib_t })
|
|
|
|
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
|
|
|
# shlib_t is the type of shared objects in the system lib
|
|
|
|
# directories.
|
|
|
|
#
|
2005-11-09 20:48:20 +00:00
|
|
|
ifdef(`targeted_policy',`
|
|
|
|
typealias lib_t alias shlib_t;
|
|
|
|
',`
|
|
|
|
type shlib_t;
|
|
|
|
files_type(shlib_t)
|
|
|
|
')
|
2005-04-14 20:18:17 +00:00
|
|
|
|
|
|
|
#
|
2005-04-21 22:46:49 +00:00
|
|
|
# texrel_shlib_t is the type of shared objects in the system lib
|
2005-04-14 20:18:17 +00:00
|
|
|
# directories, which require text relocation.
|
|
|
|
#
|
2005-12-09 15:42:39 +00:00
|
|
|
type texrel_shlib_t;
|
|
|
|
files_type(texrel_shlib_t)
|
2005-05-23 15:45:53 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# ldconfig local policy
|
|
|
|
#
|
|
|
|
type ldconfig_t;
|
|
|
|
type ldconfig_exec_t;
|
2005-06-13 17:35:46 +00:00
|
|
|
init_system_domain(ldconfig_t,ldconfig_exec_t)
|
2005-05-23 15:45:53 +00:00
|
|
|
role system_r types ldconfig_t;
|
|
|
|
|
2005-06-09 14:50:48 +00:00
|
|
|
allow ldconfig_t ld_so_cache_t:file create_file_perms;
|
2005-06-13 17:35:46 +00:00
|
|
|
files_create_etc_config(ldconfig_t,ld_so_cache_t,file)
|
2005-05-23 15:45:53 +00:00
|
|
|
|
2005-06-09 14:50:48 +00:00
|
|
|
allow ldconfig_t lib_t:dir rw_dir_perms;
|
2005-05-23 15:45:53 +00:00
|
|
|
allow ldconfig_t lib_t:lnk_file { getattr create read unlink };
|
2005-06-09 14:50:48 +00:00
|
|
|
allow ldconfig_t ld_so_t:lnk_file r_file_perms;
|
|
|
|
allow ldconfig_t ld_so_t:file rx_file_perms;
|
|
|
|
allow ldconfig_t ld_so_cache_t:file r_file_perms;
|
|
|
|
allow ldconfig_t { shlib_t texrel_shlib_t }:lnk_file r_file_perms;
|
|
|
|
allow ldconfig_t { shlib_t texrel_shlib_t }:file rx_file_perms;
|
2005-05-23 15:45:53 +00:00
|
|
|
|
|
|
|
kernel_read_system_state(ldconfig_t)
|
|
|
|
|
2005-06-10 01:01:13 +00:00
|
|
|
fs_getattr_xattr_fs(ldconfig_t)
|
2005-05-23 15:45:53 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
domain_use_wide_inherit_fd(ldconfig_t)
|
2005-05-23 15:45:53 +00:00
|
|
|
|
2005-06-20 17:41:29 +00:00
|
|
|
files_search_var_lib(ldconfig_t)
|
2005-06-29 14:26:41 +00:00
|
|
|
files_read_etc_files(ldconfig_t)
|
2005-06-29 20:53:53 +00:00
|
|
|
files_search_tmp(ldconfig_t)
|
2005-05-23 15:45:53 +00:00
|
|
|
# for when /etc/ld.so.cache is mislabeled:
|
2005-06-29 14:26:41 +00:00
|
|
|
files_delete_etc_files(ldconfig_t)
|
2005-05-23 15:45:53 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
init_use_script_pty(ldconfig_t)
|
2005-05-23 15:45:53 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
logging_send_syslog_msg(ldconfig_t)
|
2005-05-23 15:45:53 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
userdom_use_all_user_fd(ldconfig_t)
|
2005-05-23 15:45:53 +00:00
|
|
|
|
2005-07-08 20:44:57 +00:00
|
|
|
ifdef(`hide_broken_symptoms',`
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`unconfined',`
|
2005-07-08 20:44:57 +00:00
|
|
|
unconfined_dontaudit_rw_tcp_socket(ldconfig_t)
|
2005-06-03 12:25:14 +00:00
|
|
|
')
|
2005-05-23 15:45:53 +00:00
|
|
|
')
|
|
|
|
|
2005-07-08 20:44:57 +00:00
|
|
|
ifdef(`targeted_policy',`
|
2005-06-03 12:25:14 +00:00
|
|
|
allow ldconfig_t lib_t:file r_file_perms;
|
2005-07-08 20:44:57 +00:00
|
|
|
unconfined_domain_template(ldconfig_t)
|
2005-05-23 15:45:53 +00:00
|
|
|
')
|
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`apache',`
|
2005-07-08 20:44:57 +00:00
|
|
|
# dontaudit access to /usr/lib/apache, normal programs cannot read these libs anyway
|
2005-11-15 18:47:20 +00:00
|
|
|
apache_dontaudit_search_modules(ldconfig_t)
|
2005-07-08 20:44:57 +00:00
|
|
|
')
|