Chris PeBenito 17de1b
Chris PeBenito e51390
policy_module(libraries, 2.5.1)
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 3f67f7
init_system_domain(ldconfig_t, ldconfig_exec_t)
Chris PeBenito 19b2de
role system_r types ldconfig_t;
Chris PeBenito 19b2de
Chris PeBenito 9c4500
type ldconfig_cache_t;
Chris PeBenito 9c4500
files_type(ldconfig_cache_t)
Chris PeBenito 9c4500
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 4c92f0
ifdef(`distro_gentoo',`
Chris PeBenito 4c92f0
	# openrc unfortunately mounts a tmpfs
Chris PeBenito 4c92f0
	# at /lib/rc/
Chris PeBenito 4c92f0
	files_mountpoint(lib_t)
Chris PeBenito 4c92f0
')
Chris PeBenito 4c92f0
Chris PeBenito e8cb08
optional_policy(`
Chris PeBenito e8cb08
	postgresql_loadable_module(lib_t)
Chris PeBenito e8cb08
	postgresql_loadable_module(textrel_shlib_t)
Chris PeBenito e8cb08
')
Chris PeBenito e8cb08
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 9c4500
manage_files_pattern(ldconfig_t, ldconfig_cache_t, ldconfig_cache_t)
Chris PeBenito 9c4500
Chris PeBenito c0868a
allow ldconfig_t ld_so_cache_t:file manage_file_perms;
Chris PeBenito 3f67f7
files_etc_filetrans(ldconfig_t, ld_so_cache_t, file)
Chris PeBenito 17de1b
Chris PeBenito 3f67f7
manage_dirs_pattern(ldconfig_t, ldconfig_tmp_t, ldconfig_tmp_t)
Chris PeBenito 3f67f7
manage_files_pattern(ldconfig_t, ldconfig_tmp_t, ldconfig_tmp_t)
Chris PeBenito 3f67f7
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 3f67f7
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 19b2de
miscfiles_read_localization(ldconfig_t)
Chris PeBenito 19b2de
Chris PeBenito 17de1b
logging_send_syslog_msg(ldconfig_t)
Chris PeBenito 17de1b
Chris PeBenito 296273
userdom_use_user_terminals(ldconfig_t)
Chris PeBenito 17de1b
userdom_use_all_users_fds(ldconfig_t)
Chris PeBenito 17de1b
Chris PeBenito 12cf80
ifdef(`distro_ubuntu',`
Chris PeBenito 12cf80
	optional_policy(`
Chris PeBenito 12cf80
		unconfined_domain(ldconfig_t)
Chris PeBenito 12cf80
	')
Chris PeBenito 12cf80
')
Chris PeBenito 12cf80
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 e065ac
	apt_rw_pipes(ldconfig_t)
Chris PeBenito e065ac
	apt_use_fds(ldconfig_t)
Chris PeBenito e065ac
	apt_use_ptys(ldconfig_t)
Chris PeBenito e065ac
')
Chris PeBenito e065ac
Chris PeBenito e065ac
optional_policy(`
Chris PeBenito 82e284
	# When you install a kernel the postinstall builds a initrd image in tmp 
Chris PeBenito ff8f0a
	# 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
')