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