Chris PeBenito ab58ad
#DESC Ldconfig - Configure dynamic linker bindings
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# Author:  Russell Coker <russell@coker.com.au>
Chris PeBenito ab58ad
# X-Debian-Packages: libc6
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
Chris PeBenito ab58ad
#################################
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# Rules for the ldconfig_t domain.
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
type ldconfig_t, domain, privlog, etc_writer;
Chris PeBenito ab58ad
type ldconfig_exec_t, file_type, sysadmfile, exec_type;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
role sysadm_r types ldconfig_t;
Chris PeBenito ab58ad
role system_r types ldconfig_t;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
domain_auto_trans({ sysadm_t initrc_t }, ldconfig_exec_t, ldconfig_t)
Chris PeBenito ab58ad
dontaudit ldconfig_t device_t:dir search;
Chris PeBenito ab58ad
can_access_pty(ldconfig_t, initrc)
Chris PeBenito ab58ad
allow ldconfig_t admin_tty_type:chr_file rw_file_perms;
Chris PeBenito ab58ad
allow ldconfig_t privfd:fd use;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
uses_shlib(ldconfig_t)
Chris PeBenito ab58ad
Chris PeBenito ab58ad
file_type_auto_trans(ldconfig_t, etc_t, ld_so_cache_t, file)
Chris PeBenito ab58ad
allow ldconfig_t lib_t:dir rw_dir_perms;
Chris PeBenito ab58ad
allow ldconfig_t lib_t:lnk_file create_lnk_perms;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
allow ldconfig_t userdomain:fd use;
Chris PeBenito ab58ad
# unlink for when /etc/ld.so.cache is mislabeled
Chris PeBenito ab58ad
allow ldconfig_t etc_t:file { getattr read unlink };
Chris PeBenito ab58ad
allow ldconfig_t etc_t:lnk_file read;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
allow ldconfig_t fs_t:filesystem getattr;
Chris PeBenito ab58ad
allow ldconfig_t tmp_t:dir search;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
ifdef(`apache.te', `
Chris PeBenito ab58ad
# dontaudit access to /usr/lib/apache, normal programs cannot read these libs anyway
Chris PeBenito ab58ad
dontaudit ldconfig_t httpd_modules_t:dir search;
Chris PeBenito ab58ad
')
Chris PeBenito ab58ad
Chris PeBenito ab58ad
allow ldconfig_t { var_t var_lib_t }:dir search;
Chris PeBenito ab58ad
allow ldconfig_t proc_t:file { getattr read };
Chris PeBenito ab58ad
ifdef(`hide_broken_symptoms', `
Chris PeBenito ab58ad
ifdef(`unconfined.te',`
Chris PeBenito ab58ad
dontaudit ldconfig_t unconfined_t:tcp_socket { read write };
Chris PeBenito ab58ad
');
Chris PeBenito ab58ad
')dnl end hide_broken_symptoms
Chris PeBenito ab58ad
ifdef(`targeted_policy', `
Chris PeBenito ab58ad
allow ldconfig_t lib_t:file r_file_perms;
Chris PeBenito ab58ad
unconfined_domain(ldconfig_t) 
Chris PeBenito ab58ad
')