Chris PeBenito 17de1b
Chris PeBenito 6c53a1
policy_module(libraries,1.7.2)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Declarations
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# ld_so_cache_t is the type of /etc/ld.so.cache.
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
type ld_so_cache_t;
Chris PeBenito 17de1b
files_type(ld_so_cache_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# ld_so_t is the type of the system dynamic loaders.
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
type ld_so_t;
Chris PeBenito 17de1b
files_type(ld_so_t)
Chris PeBenito 17de1b
Chris PeBenito 19b2de
type ldconfig_t;
Chris PeBenito 19b2de
type ldconfig_exec_t;
Chris PeBenito 19b2de
init_system_domain(ldconfig_t,ldconfig_exec_t)
Chris PeBenito 19b2de
role system_r types ldconfig_t;
Chris PeBenito 19b2de
Chris PeBenito 19b2de
type ldconfig_tmp_t;
Chris PeBenito 19b2de
files_tmp_file(ldconfig_tmp_t)
Chris PeBenito 19b2de
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# lib_t is the type of files in the system lib directories.
Chris PeBenito 17de1b
#
Chris PeBenito 350b6a
type lib_t alias shlib_t;
Chris PeBenito 17de1b
files_type(lib_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# textrel_shlib_t is the type of shared objects in the system lib
Chris PeBenito 17de1b
# directories, which require text relocation.
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
type textrel_shlib_t alias texrel_shlib_t;
Chris PeBenito 17de1b
files_type(textrel_shlib_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# ldconfig local policy
Chris PeBenito 17de1b
#
Chris PeBenito 19b2de
Chris PeBenito 19b2de
allow ldconfig_t self:capability sys_chroot;
Chris PeBenito 17de1b
Chris PeBenito c0868a
allow ldconfig_t ld_so_cache_t:file manage_file_perms;
Chris PeBenito 17de1b
files_etc_filetrans(ldconfig_t,ld_so_cache_t,file)
Chris PeBenito 17de1b
Chris PeBenito 19b2de
manage_dirs_pattern(ldconfig_t,ldconfig_tmp_t,ldconfig_tmp_t)
Chris PeBenito 19b2de
manage_files_pattern(ldconfig_t,ldconfig_tmp_t,ldconfig_tmp_t)
Chris PeBenito d534d3
manage_lnk_files_pattern(ldconfig_t,ldconfig_tmp_t,ldconfig_tmp_t)
Chris PeBenito d534d3
files_tmp_filetrans(ldconfig_t, ldconfig_tmp_t, { file dir lnk_file })
Chris PeBenito 19b2de
Chris PeBenito c0868a
manage_lnk_files_pattern(ldconfig_t,lib_t,lib_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
kernel_read_system_state(ldconfig_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
fs_getattr_xattr_fs(ldconfig_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
domain_use_interactive_fds(ldconfig_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
files_search_var_lib(ldconfig_t)
Chris PeBenito 17de1b
files_read_etc_files(ldconfig_t)
Chris PeBenito 17de1b
files_search_tmp(ldconfig_t)
Chris PeBenito 17de1b
files_search_usr(ldconfig_t)
Chris PeBenito 17de1b
# for when /etc/ld.so.cache is mislabeled:
Chris PeBenito 17de1b
files_delete_etc_files(ldconfig_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
init_use_script_ptys(ldconfig_t)
Chris PeBenito 17de1b
Chris PeBenito c0868a
libs_use_ld_so(ldconfig_t)
Chris PeBenito c0868a
libs_use_shared_libs(ldconfig_t)
Chris PeBenito c0868a
Chris PeBenito 19b2de
miscfiles_read_localization(ldconfig_t)
Chris PeBenito 19b2de
Chris PeBenito 17de1b
logging_send_syslog_msg(ldconfig_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
userdom_use_all_users_fds(ldconfig_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
ifdef(`hide_broken_symptoms',`
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		unconfined_dontaudit_rw_tcp_sockets(ldconfig_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	# dontaudit access to /usr/lib/apache, normal programs cannot read these libs anyway
Chris PeBenito 17de1b
	apache_dontaudit_search_modules(ldconfig_t)
Chris PeBenito 17de1b
')
Chris PeBenito 82e284
Chris PeBenito 82e284
optional_policy(`
Chris PeBenito 82e284
	# When you install a kernel the postinstall builds a initrd image in tmp 
Chris PeBenito 82e284
	# and executes ldconfig on it.  If you dont allow this kernel installs 
Chris PeBenito 82e284
	# blow up.
Chris PeBenito 82e284
	rpm_manage_script_tmp_files(ldconfig_t)
Chris PeBenito 82e284
')