- ##
-@@ -27,10 +28,8 @@
- files_type(virt_etc_rw_t)
-
- # virt Image files
--type virt_image_t; # customizable
--files_type(virt_image_t)
--# virt_image_t can be assigned to blk devices
--dev_node(virt_image_t)
-+type virt_image_t, virt_image_type; # customizable
-+virt_image(virt_image_t)
-
- type virt_log_t;
- logging_log_file(virt_log_t)
-@@ -45,6 +44,9 @@
- type virtd_exec_t;
- init_daemon_domain(virtd_t, virtd_exec_t)
-
-+type virtd_initrc_exec_t;
-+init_script_file(virtd_initrc_exec_t)
-+
- ########################################
- #
- # virtd local policy
-@@ -49,9 +51,8 @@
- #
- # virtd local policy
- #
--
- allow virtd_t self:capability { dac_override kill net_admin setgid sys_nice sys_ptrace };
--allow virtd_t self:process { sigkill signal execmem };
-+allow virtd_t self:process { getsched sigkill signal execmem };
- allow virtd_t self:fifo_file rw_file_perms;
- allow virtd_t self:unix_stream_socket create_stream_socket_perms;
- allow virtd_t self:tcp_socket create_stream_socket_perms;
-@@ -64,7 +65,7 @@
- manage_lnk_files_pattern(virtd_t, virt_etc_rw_t, virt_etc_rw_t)
- filetrans_pattern(virtd_t, virt_etc_t, virt_etc_rw_t, dir)
-
--manage_files_pattern(virtd_t, virt_image_t, virt_image_t)
-+manage_files_pattern(virtd_t, virt_image_type, virt_image_type)
-
- manage_dirs_pattern(virtd_t, virt_log_t, virt_log_t)
- manage_files_pattern(virtd_t, virt_log_t, virt_log_t)
-@@ -82,6 +83,8 @@
- kernel_read_system_state(virtd_t)
- kernel_read_network_state(virtd_t)
- kernel_rw_net_sysctls(virtd_t)
-+kernel_read_xen_state(virtd_t)
-+kernel_write_xen_state(virtd_t)
- kernel_load_module(virtd_t)
-
- corecmd_exec_bin(virtd_t)
-@@ -93,7 +96,7 @@
- corenet_tcp_sendrecv_all_nodes(virtd_t)
- corenet_tcp_sendrecv_all_ports(virtd_t)
- corenet_tcp_bind_all_nodes(virtd_t)
--#corenet_tcp_bind_virt_port(virtd_t)
-+corenet_tcp_bind_virt_port(virtd_t)
- corenet_tcp_bind_vnc_port(virtd_t)
- corenet_tcp_connect_vnc_port(virtd_t)
- corenet_tcp_connect_soundd_port(virtd_t)
-@@ -107,8 +110,10 @@
-
- files_read_usr_files(virtd_t)
- files_read_etc_files(virtd_t)
-+files_read_usr_files(virtd_t)
- files_read_etc_runtime_files(virtd_t)
- files_search_all(virtd_t)
-+files_list_kernel_modules(virtd_t)
-
- fs_list_auto_mountpoints(virtd_t)
-
-@@ -162,26 +167,27 @@
- ')
- ')
-
--#optional_policy(`
--# dnsmasq_domtrans(virtd_t)
--# dnsmasq_signal(virtd_t)
--# dnsmasq_sigkill(virtd_t)
--#')
-+optional_policy(`
-+ dnsmasq_domtrans(virtd_t)
-+ dnsmasq_signal(virtd_t)
-+ dnsmasq_sigkill(virtd_t)
-+')
-
- optional_policy(`
- iptables_domtrans(virtd_t)
- ')
-
--#optional_policy(`
--# polkit_domtrans_auth(virtd_t)
--# polkit_domtrans_resolve(virtd_t)
--#')
-+optional_policy(`
-+ polkit_domtrans_auth(virtd_t)
-+ polkit_domtrans_resolve(virtd_t)
-+')
-
- optional_policy(`
- qemu_domtrans(virtd_t)
- qemu_read_state(virtd_t)
- qemu_signal(virtd_t)
- qemu_kill(virtd_t)
-+ qemu_setsched(virtd_t)
- ')
-
- optional_policy(`
-@@ -189,9 +195,10 @@
- ')
-
- optional_policy(`
-- kernel_read_xen_state(virtd_t)
-- kernel_write_xen_state(virtd_t)
--
- xen_stream_connect(virtd_t)
- xen_stream_connect_xenstore(virtd_t)
- ')
-+
-+optional_policy(`
-+ unconfined_domain(virtd_t)
-+')
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/services/w3c.te serefpolicy-3.5.13/policy/modules/services/w3c.te
---- nsaserefpolicy/policy/modules/services/w3c.te 2008-08-25 09:12:31.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/services/w3c.te 2008-10-28 10:56:19.000000000 -0400
-@@ -8,11 +8,18 @@
-
- apache_content_template(w3c_validator)
-
-+type httpd_w3c_validator_tmp_t;
-+files_tmp_file(httpd_w3c_validator_tmp_t)
-+
- ########################################
- #
- # Local policy
- #
-
-+manage_dirs_pattern(httpd_w3c_validator_script_t, httpd_w3c_validator_tmp_t, httpd_w3c_validator_tmp_t)
-+manage_files_pattern(httpd_w3c_validator_script_t, httpd_w3c_validator_tmp_t, httpd_w3c_validator_tmp_t)
-+files_tmp_filetrans(httpd_w3c_validator_script_t, httpd_w3c_validator_tmp_t, { file dir })
-+
- corenet_tcp_connect_ftp_port(httpd_w3c_validator_script_t)
- corenet_tcp_sendrecv_ftp_port(httpd_w3c_validator_script_t)
- corenet_tcp_connect_http_port(httpd_w3c_validator_script_t)
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/services/xserver.fc serefpolicy-3.5.13/policy/modules/services/xserver.fc
---- nsaserefpolicy/policy/modules/services/xserver.fc 2008-08-07 11:15:11.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/services/xserver.fc 2008-11-03 11:42:39.000000000 -0500
-@@ -1,13 +1,15 @@
- #
- # HOME_DIR
- #
--HOME_DIR/\.fonts\.conf -- gen_context(system_u:object_r:ROLE_fonts_config_t,s0)
--HOME_DIR/\.fonts(/.*)? gen_context(system_u:object_r:ROLE_fonts_t,s0)
--HOME_DIR/\.fonts/auto(/.*)? gen_context(system_u:object_r:ROLE_fonts_cache_t,s0)
--HOME_DIR/\.fonts\.cache-.* -- gen_context(system_u:object_r:ROLE_fonts_cache_t,s0)
--HOME_DIR/\.ICEauthority.* -- gen_context(system_u:object_r:ROLE_iceauth_home_t,s0)
--HOME_DIR/\.xauth.* -- gen_context(system_u:object_r:ROLE_xauth_home_t,s0)
--HOME_DIR/\.Xauthority.* -- gen_context(system_u:object_r:ROLE_xauth_home_t,s0)
-+HOME_DIR/\.fonts(/.*)? gen_context(system_u:object_r:fonts_home_t,s0)
-+HOME_DIR/\.fontconfig(/.*)? gen_context(system_u:object_r:fonts_config_home_t,s0)
-+HOME_DIR/\.fonts\.conf -- gen_context(system_u:object_r:fonts_config_home_t,s0)
-+HOME_DIR/\.fonts/auto(/.*)? gen_context(system_u:object_r:fonts_cache_home_t,s0)
-+HOME_DIR/\.fonts\.cache-.* -- gen_context(system_u:object_r:fonts_cache_home_t,s0)
-+HOME_DIR/\.ICEauthority.* -- gen_context(system_u:object_r:iceauth_home_t,s0)
-+HOME_DIR/\.xauth.* -- gen_context(system_u:object_r:xauth_home_t,s0)
-+HOME_DIR/\.Xauthority.* -- gen_context(system_u:object_r:xauth_home_t,s0)
-+HOME_DIR/\.xsession-errors.* -- gen_context(system_u:object_r:xdm_home_t,s0)
-
- #
- # /dev
-@@ -32,11 +34,6 @@
- /etc/X11/wdm/Xstartup.* -- gen_context(system_u:object_r:xsession_exec_t,s0)
- /etc/X11/Xsession[^/]* -- gen_context(system_u:object_r:xsession_exec_t,s0)
-
--ifdef(`distro_redhat',`
--/etc/gdm/PostSession/.* -- gen_context(system_u:object_r:xsession_exec_t,s0)
--/etc/gdm/PreSession/.* -- gen_context(system_u:object_r:xsession_exec_t,s0)
--')
--
- #
- # /opt
- #
-@@ -50,7 +47,7 @@
- /tmp/\.ICE-unix -d gen_context(system_u:object_r:xdm_tmp_t,s0)
- /tmp/\.ICE-unix/.* -s <>
- /tmp/\.X0-lock -- gen_context(system_u:object_r:xdm_xserver_tmp_t,s0)
--/tmp/\.X11-unix -d gen_context(system_u:object_r:xdm_tmp_t,s0)
-+/tmp/\.X11-unix -d gen_context(system_u:object_r:xdm_xserver_tmp_t,s0)
- /tmp/\.X11-unix/.* -s <>
-
- #
-@@ -58,9 +55,11 @@
- #
-
- /usr/(s)?bin/gdm-binary -- gen_context(system_u:object_r:xdm_exec_t,s0)
--/usr/(s)?bin/[xgkw]dm -- gen_context(system_u:object_r:xdm_exec_t,s0)
-+/usr/bin/[xgkw]dm -- gen_context(system_u:object_r:xdm_exec_t,s0)
-+/usr/sbin/[xgkw]dm -- gen_context(system_u:object_r:xdm_exec_t,s0)
- /usr/bin/gpe-dm -- gen_context(system_u:object_r:xdm_exec_t,s0)
- /usr/bin/iceauth -- gen_context(system_u:object_r:iceauth_exec_t,s0)
-+/usr/bin/slim -- gen_context(system_u:object_r:xdm_exec_t,s0)
- /usr/bin/Xair -- gen_context(system_u:object_r:xserver_exec_t,s0)
- /usr/bin/xauth -- gen_context(system_u:object_r:xauth_exec_t,s0)
- /usr/bin/Xorg -- gen_context(system_u:object_r:xserver_exec_t,s0)
-@@ -89,16 +88,25 @@
-
- /var/[xgk]dm(/.*)? gen_context(system_u:object_r:xserver_log_t,s0)
-
--/var/lib/[xkw]dm(/.*)? gen_context(system_u:object_r:xdm_var_lib_t,s0)
-+/var/lib/[gxkw]dm(/.*)? gen_context(system_u:object_r:xdm_var_lib_t,s0)
- /var/lib/xkb(/.*)? gen_context(system_u:object_r:xkb_var_lib_t,s0)
-+/var/lib/xorg(/.*)? gen_context(system_u:object_r:xserver_var_lib_t,s0)
-
--/var/log/[kw]dm\.log -- gen_context(system_u:object_r:xserver_log_t,s0)
-+/var/log/[kw]dm\.log.* -- gen_context(system_u:object_r:xserver_log_t,s0)
- /var/log/gdm(/.*)? gen_context(system_u:object_r:xserver_log_t,s0)
- /var/log/XFree86.* -- gen_context(system_u:object_r:xserver_log_t,s0)
- /var/log/Xorg.* -- gen_context(system_u:object_r:xserver_log_t,s0)
-+/var/log/nvidia-installer\.log.* -- gen_context(system_u:object_r:xserver_log_t,s0)
-+
-+/var/spool/gdm(/.*)? gen_context(system_u:object_r:xdm_spool_t,s0)
-
-+/var/run/gdm(/.*)? gen_context(system_u:object_r:xdm_var_run_t,s0)
-+/var/run/gdm_socket -s gen_context(system_u:object_r:xdm_var_run_t,s0)
- /var/run/[gx]dm\.pid -- gen_context(system_u:object_r:xdm_var_run_t,s0)
-+/var/run/video.rom -- gen_context(system_u:object_r:xserver_var_run_t,s0)
- /var/run/xdmctl(/.*)? gen_context(system_u:object_r:xdm_var_run_t,s0)
-+/var/run/xauth(/.*)? gen_context(system_u:object_r:xdm_var_run_t,s0)
-+/var/run/xorg(/.*)? gen_context(system_u:object_r:xserver_var_run_t,s0)
-
- ifdef(`distro_suse',`
- /var/lib/pam_devperm/:0 -- gen_context(system_u:object_r:xdm_var_lib_t,s0)
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/services/xserver.if serefpolicy-3.5.13/policy/modules/services/xserver.if
---- nsaserefpolicy/policy/modules/services/xserver.if 2008-10-08 19:00:27.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/services/xserver.if 2008-11-04 13:27:32.000000000 -0500
-@@ -16,6 +16,7 @@
- gen_require(`
- type xkb_var_lib_t, xserver_exec_t, xserver_log_t;
-
-+ attribute rootwindow_type;
- attribute x_server_domain;
- class x_drawable all_x_drawable_perms;
- class x_colormap all_x_colormap_perms;
-@@ -134,18 +135,24 @@
- dev_rw_agp($1_xserver_t)
- dev_rw_framebuffer($1_xserver_t)
- dev_manage_dri_dev($1_xserver_t)
-- dev_create_generic_dirs($1_xserver_t)
-- dev_setattr_generic_dirs($1_xserver_t)
-+ dev_manage_generic_dirs($1_xserver_t)
- # raw memory access is needed if not using the frame buffer
- dev_read_raw_memory($1_xserver_t)
- dev_wx_raw_memory($1_xserver_t)
- # for other device nodes such as the NVidia binary-only driver
- dev_rw_xserver_misc($1_xserver_t)
-+ dev_setattr_xserver_misc_dev($1_xserver_t)
- # read events - the synaptics touchpad driver reads raw events
- dev_rw_input_dev($1_xserver_t)
- dev_rwx_zero($1_xserver_t)
-+ dev_read_urand($1_xserver_t)
-+ dev_rw_generic_usb_dev($1_xserver_t)
-+ dev_rw_generic_usb_pipes($1_xserver_t)
-
-+ domain_mmap_low_type($1_xserver_t)
- domain_mmap_low($1_xserver_t)
-+ domain_read_all_domains_state($1_xserver_t)
-+ domain_dontaudit_ptrace_all_domains($1_xserver_t)
-
- files_read_etc_files($1_xserver_t)
- files_read_etc_runtime_files($1_xserver_t)
-@@ -159,7 +166,8 @@
- fs_getattr_xattr_fs($1_xserver_t)
- fs_search_nfs($1_xserver_t)
- fs_search_auto_mountpoints($1_xserver_t)
-- fs_search_ramfs($1_xserver_t)
-+ fs_manage_ramfs_files($1_xserver_t)
-+ fs_list_inotifyfs($1_xserver_t)
-
- selinux_validate_context($1_xserver_t)
- selinux_compute_access_vector($1_xserver_t)
-@@ -169,6 +177,9 @@
-
- init_getpgid($1_xserver_t)
-
-+ miscfiles_read_hwdata($1_xserver_t)
-+
-+ term_search_ptys($1_xserver_t)
- term_setattr_unallocated_ttys($1_xserver_t)
- term_use_unallocated_ttys($1_xserver_t)
-
-@@ -276,6 +287,8 @@
- gen_require(`
- type iceauth_exec_t, xauth_exec_t;
- attribute fonts_type, fonts_cache_type, fonts_config_type;
-+ type fonts_home_t, fonts_cache_home_t, fonts_config_home_t;
-+ type iceauth_home_t, xauth_t, xauth_home_t, xauth_tmp_t;
- ')
-
- ##############################
-@@ -286,61 +299,41 @@
- xserver_common_domain_template($1)
- role $3 types $1_xserver_t;
-
-- type $1_fonts_t, fonts_type;
-- userdom_user_home_content($1, $1_fonts_t)
--
-- type $1_fonts_cache_t, fonts_cache_type;
-- userdom_user_home_content($1, $1_fonts_cache_t)
--
-- type $1_fonts_config_t, fonts_config_type;
-- userdom_user_home_content($1, $1_fonts_cache_t)
-+ typealias fonts_home_t alias $1_fonts_t;
-+ typealias fonts_cache_home_t alias $1_fonts_cache_t;
-+ typealias fonts_config_home_t alias $1_fonts_config_t;
-
- type $1_iceauth_t;
- domain_type($1_iceauth_t)
- domain_entry_file($1_iceauth_t, iceauth_exec_t)
- role $3 types $1_iceauth_t;
-
-- type $1_iceauth_home_t alias $1_iceauth_rw_t;
-- files_poly_member($1_iceauth_home_t)
-- userdom_user_home_content($1, $1_iceauth_home_t)
--
-- type $1_xauth_t;
-- domain_type($1_xauth_t)
-- domain_entry_file($1_xauth_t, xauth_exec_t)
-- role $3 types $1_xauth_t;
--
-- type $1_xauth_home_t alias $1_xauth_rw_t, xauth_home_type;
-- files_poly_member($1_xauth_home_t)
-- userdom_user_home_content($1, $1_xauth_home_t)
-+ typealias iceauth_home_t alias $1_iceauth_rw_t;
-+ typealias iceauth_home_t alias $1_iceauth_home_t;
-
-- type $1_xauth_tmp_t;
-- files_tmp_file($1_xauth_tmp_t)
--
-- ##############################
-- #
-- # $1_xserver_t Local policy
-- #
-+ typealias xauth_home_t alias $1_xauth_rw_t;
-+ typealias xauth_home_t alias $1_xauth_home_t;
-
-- domtrans_pattern($1_xserver_t, xauth_exec_t, $1_xauth_t)
-+ allow $1_xserver_t xauth_home_t:file read_file_perms;
-
-- allow $1_xserver_t $1_xauth_home_t:file { getattr read };
-+ domtrans_pattern($1_xserver_t, xauth_exec_t, xauth_t)
-+ role $3 types xauth_t;
-
-- domtrans_pattern($2, xserver_exec_t, $1_xserver_t)
- allow $1_xserver_t $2:process signal;
-
- allow $1_xserver_t $2:shm rw_shm_perms;
-
-- manage_dirs_pattern($2, $1_fonts_t, $1_fonts_t)
-- manage_files_pattern($2, $1_fonts_t, $1_fonts_t)
-- relabel_dirs_pattern($2, $1_fonts_t, $1_fonts_t)
-- relabel_files_pattern($2, $1_fonts_t, $1_fonts_t)
--
-- manage_dirs_pattern($2, $1_fonts_config_t, $1_fonts_config_t)
-- manage_files_pattern($2, $1_fonts_config_t, $1_fonts_config_t)
-- relabel_files_pattern($2, $1_fonts_config_t, $1_fonts_config_t)
-+ manage_dirs_pattern($2, fonts_home_t, fonts_home_t)
-+ manage_files_pattern($2, fonts_home_t, fonts_home_t)
-+ relabel_dirs_pattern($2, fonts_home_t, fonts_home_t)
-+ relabel_files_pattern($2, fonts_home_t, fonts_home_t)
-+
-+ manage_dirs_pattern($2, fonts_config_home_t, fonts_config_home_t)
-+ manage_files_pattern($2, fonts_config_home_t, fonts_config_home_t)
-+ relabel_files_pattern($2, fonts_config_home_t, fonts_config_home_t)
-
- # For startup relabel
-- allow $2 $1_fonts_cache_t:{ dir file } { relabelto relabelfrom };
-+ allow $2 fonts_cache_home_t:{ dir file } { relabelto relabelfrom };
-
- stream_connect_pattern($2, $1_xserver_tmp_t, $1_xserver_tmp_t, $1_xserver_t)
-
-@@ -354,85 +347,36 @@
-
- locallogin_use_fds($1_xserver_t)
-
-+ miscfiles_read_fonts($2)
-+
- userdom_search_user_home_dirs($1, $1_xserver_t)
- userdom_use_user_ttys($1, $1_xserver_t)
- userdom_setattr_user_ttys($1, $1_xserver_t)
- userdom_rw_user_tmpfs_files($1, $1_xserver_t)
-
- xserver_use_user_fonts($1, $1_xserver_t)
-- xserver_rw_xdm_tmp_files($1_xauth_t)
-+ xserver_rw_xdm_tmp_files(xauth_t)
-+ xserver_read_xdm_xserver_tmp_files($2)
-
- optional_policy(`
- userhelper_search_config($1_xserver_t)
- ')
-
-- ifdef(`TODO',`
-- ifdef(`xdm.te', `
-- allow $1_t xdm_tmp_t:sock_file unlink;
-- allow $1_xserver_t xdm_var_run_t:dir search;
-+ optional_policy(`
-+ wm_exec($2)
- ')
-- ') dnl end TODO
--
-- ##############################
-- #
-- # $1_xauth_t Local policy
-- #
-
-- allow $1_xauth_t self:process signal;
-- allow $1_xauth_t self:unix_stream_socket create_stream_socket_perms;
-+ domtrans_pattern($2, xauth_exec_t, xauth_t)
-+ allow $2 xauth_t:process signal;
-
-- allow $1_xauth_t $1_xauth_home_t:file manage_file_perms;
-- userdom_user_home_dir_filetrans($1, $1_xauth_t, $1_xauth_home_t,file)
--
-- manage_dirs_pattern($1_xauth_t, $1_xauth_tmp_t, $1_xauth_tmp_t)
-- manage_files_pattern($1_xauth_t, $1_xauth_tmp_t, $1_xauth_tmp_t)
-- files_tmp_filetrans($1_xauth_t, $1_xauth_tmp_t, { file dir })
--
-- domtrans_pattern($2, xauth_exec_t, $1_xauth_t)
--
-- allow $2 $1_xauth_t:process signal;
-+ allow $2 xauth_home_t:file manage_file_perms;
-+ allow $2 xauth_home_t:file { relabelfrom relabelto };
-
- # allow ps to show xauth
-- ps_process_pattern($2,$1_xauth_t)
--
-- allow $2 $1_xauth_home_t:file manage_file_perms;
-- allow $2 $1_xauth_home_t:file { relabelfrom relabelto };
--
-- allow xdm_t $1_xauth_home_t:file manage_file_perms;
-- userdom_user_home_dir_filetrans($1, xdm_t, $1_xauth_home_t, file)
--
-- domain_use_interactive_fds($1_xauth_t)
--
-- files_read_etc_files($1_xauth_t)
-- files_search_pids($1_xauth_t)
--
-- fs_getattr_xattr_fs($1_xauth_t)
-- fs_search_auto_mountpoints($1_xauth_t)
-+ ps_process_pattern($2,xauth_t)
-
-- # cjp: why?
-- term_use_ptmx($1_xauth_t)
--
-- auth_use_nsswitch($1_xauth_t)
--
-- libs_use_ld_so($1_xauth_t)
-- libs_use_shared_libs($1_xauth_t)
--
-- userdom_use_user_terminals($1, $1_xauth_t)
-- userdom_read_user_tmp_files($1, $1_xauth_t)
--
-- tunable_policy(`use_nfs_home_dirs',`
-- fs_manage_nfs_files($1_xauth_t)
-- ')
--
-- tunable_policy(`use_samba_home_dirs',`
-- fs_manage_cifs_files($1_xauth_t)
-- ')
--
-- optional_policy(`
-- ssh_sigchld($1_xauth_t)
-- ssh_read_pipes($1_xauth_t)
-- ssh_dontaudit_rw_tcp_sockets($1_xauth_t)
-- ')
-+ userdom_use_user_terminals($1, xauth_t)
-+ userdom_read_user_tmp_files($1, xauth_t)
-
- ##############################
- #
-@@ -441,16 +385,17 @@
-
- domtrans_pattern($2, iceauth_exec_t, $1_iceauth_t)
-
-- allow $1_iceauth_t $1_iceauth_home_t:file manage_file_perms;
-- userdom_user_home_dir_filetrans($1, $1_iceauth_t, $1_iceauth_home_t, file)
-+ allow $1_iceauth_t iceauth_home_t:file manage_file_perms;
-+ userdom_user_home_dir_filetrans($1, $1_iceauth_t, iceauth_home_t, file)
-
- # allow ps to show iceauth
- ps_process_pattern($2, $1_iceauth_t)
-
-- allow $2 $1_iceauth_home_t:file manage_file_perms;
-- allow $2 $1_iceauth_home_t:file { relabelfrom relabelto };
-+ allow $2 iceauth_home_t:file manage_file_perms;
-+ allow $2 iceauth_home_t:file { relabelfrom relabelto };
-
-- allow xdm_t $1_iceauth_home_t:file read_file_perms;
-+ xserver_use_xdm($2)
-+ xserver_rw_xdm_xserver_shm($2)
-
- fs_search_auto_mountpoints($1_iceauth_t)
-
-@@ -473,33 +418,12 @@
- #
-
- # Device rules
-- allow $1_x_domain $1_xserver_t:x_device { read getattr use setattr setfocus grab bell };
-+ allow $1_x_domain $1_xserver_t:x_device { getattr use setattr setfocus grab bell };
-
- allow $1_xserver_t { input_xevent_t $1_input_xevent_type }:x_event send;
-+ allow $2 $1_input_xevent_type:x_event send;
- allow $1_xserver_t { $1_rootwindow_t $1_x_domain }:x_drawable send;
--
-- # manage: xhost X11:ChangeHosts
-- # freeze: metacity X11:GrabKey
-- # force_cursor: metacity X11:GrabPointer
-- allow $2 $1_xserver_t:x_device { manage freeze force_cursor };
--
-- # gnome-settings-daemon XKEYBOARD:SetControls
-- allow $2 $1_xserver_t:x_server manage;
--
-- # gnome-settings-daemon RANDR:SelectInput
-- allow $2 $1_xserver_t:x_resource write;
--
-- # metacity X11:InstallColormap X11:UninstallColormap
-- allow $2 $1_rootwindow_t:x_colormap { install uninstall };
--
-- # read: gnome-settings-daemon RANDR:GetScreenSizeRange
-- # write: gnome-settings-daemon RANDR:SelectInput
-- # setattr: gnome-settings-daemon X11:GrabKey
-- # manage: metacity X11:ChangeWindowAttributes
-- allow $2 $1_rootwindow_t:x_drawable { read write manage setattr };
--
-- # setattr: metacity X11:InstallColormap
-- allow $2 $1_xserver_t:x_screen { saver_setattr saver_getattr setattr };
-+ allow $2 xdm_rootwindow_t:x_colormap remove_color;
-
- # xrdb X11:ChangeProperty prop=RESOURCE_MANAGER
- allow $2 info_xproperty_t:x_property { create write append };
-@@ -548,7 +472,7 @@
- allow $2 $1_xserver_t:process signal;
-
- # Read /tmp/.X0-lock
-- allow $2 $1_xserver_tmp_t:file { getattr read };
-+ allow $2 $1_xserver_tmp_t:file read_file_perms;
-
- # Client read xserver shm
- allow $2 $1_xserver_t:fd use;
-@@ -616,7 +540,7 @@
- # refpolicywarn(`$0() has been deprecated, please use xserver_user_x_domain_template instead.')
- gen_require(`
- type xdm_t, xdm_tmp_t;
-- type $1_xauth_home_t, $1_iceauth_home_t, $1_xserver_t, $1_xserver_tmpfs_t;
-+ type xauth_home_t, iceauth_home_t, $1_xserver_t, $1_xserver_tmpfs_t;
- ')
-
- allow $2 self:shm create_shm_perms;
-@@ -624,12 +548,12 @@
- allow $2 self:unix_stream_socket { connectto create_stream_socket_perms };
-
- # Read .Xauthority file
-- allow $2 $1_xauth_home_t:file { getattr read };
-- allow $2 $1_iceauth_home_t:file { getattr read };
-+ allow $2 xauth_home_t:file read_file_perms;
-+ allow $2 iceauth_home_t:file read_file_perms;
-
- # for when /tmp/.X11-unix is created by the system
- allow $2 xdm_t:fd use;
-- allow $2 xdm_t:fifo_file { getattr read write ioctl };
-+ allow $2 xdm_t:fifo_file rw_fifo_files_perms;
- allow $2 xdm_tmp_t:dir search;
- allow $2 xdm_tmp_t:sock_file { read write };
- dontaudit $2 xdm_t:tcp_socket { read write };
-@@ -649,13 +573,210 @@
-
- xserver_read_xdm_tmp_files($2)
-
-- # Client write xserver shm
-- tunable_policy(`allow_write_xshm',`
-- allow $2 $1_xserver_t:shm rw_shm_perms;
-- allow $2 $1_xserver_tmpfs_t:file rw_file_perms;
- ')
-+
-+#######################################
-+##
-+## Interface to provide X object permissions on a given X server to
-+## an X client domain. Provides the minimal set required by a basic
-+## X client application.
-+##
-+##
-+##
-+## The prefix of the X server domain (e.g., user
-+## is the prefix for user_t).
-+##
-+##
-+##
-+##
-+## The prefix of the X client domain (e.g., user
-+## is the prefix for user_t).
-+##
-+##
-+##
-+##
-+## Client domain allowed access.
-+##
-+##
-+#
-+interface(`xserver_use',`
-+ gen_require(`
-+ type $1_rootwindow_t;
-+ type $1_xproperty_t;
-+ attribute $1_x_domain, $1_input_xevent_type;
-+ attribute x_domain;
-+ type $1_xserver_t;
-+# type $2_input_xevent_t;
- ')
-
-+ allow $1_xserver_t self:netlink_selinux_socket create_socket_perms;
-+
-+# typeattribute $2_input_xevent_t $1_input_xevent_type;
-+
-+ # can change properties of root window
-+ allow $3 $1_rootwindow_t:x_drawable { list_property get_property set_property };
-+ # X Windows
-+ # operations allowed on root windows
-+ allow $3 $1_rootwindow_t:x_drawable { read getattr list_child add_child remove_child send receive override destroy hide };
-+# type_transition $3 $1_rootwindow_t:x_drawable $2_t;
-+
-+ allow $3 $1_xproperty_t:x_property { write read };
-+
-+ # X Colormaps
-+ # can use the default colormap
-+ allow $3 $1_rootwindow_t:x_colormap { read use add_color };
-+
-+ # manage: xhost X11:ChangeHosts
-+ # freeze: metacity X11:GrabKey
-+ # force_cursor: metacity X11:GrabPointer
-+ allow $3 $1_xserver_t:x_device { manage freeze force_cursor };
-+ allow $3 $1_xserver_t:x_device { getfocus setfocus grab use getattr setattr bell };
-+
-+ # gnome-settings-daemon XKEYBOARD:SetControls
-+ allow $3 $1_xserver_t:x_server { manage grab };
-+
-+ # gnome-settings-daemon RANDR:SelectInput
-+ allow $3 $1_xserver_t:x_resource { read write };
-+
-+ # metacity X11:InstallColormap X11:UninstallColormap
-+ allow $3 $1_rootwindow_t:x_colormap { use install uninstall };
-+
-+ # read: gnome-settings-daemon RANDR:GetScreenSizeRange
-+ # write: gnome-settings-daemon RANDR:SelectInput
-+ # setattr: gnome-settings-daemon X11:GrabKey
-+ # manage: metacity X11:ChangeWindowAttributes
-+ allow $3 $1_rootwindow_t:x_drawable { show write manage setattr get_property blend create add_child write receive set_property };
-+
-+ # setattr: metacity X11:InstallColormap
-+ allow $3 $1_xserver_t:x_screen { getattr saver_setattr saver_getattr setattr };
-+ ifdef(`enable_mls',`
-+ mls_xwin_read_to_clearance($1_xserver_t)
-+
-+ mls_fd_use_all_levels($1_xserver_t)
-+
-+ mls_socket_read_all_levels($1_xserver_t)
-+ mls_socket_write_all_levels($1_xserver_t)
-+
-+ mls_sysvipc_read_to_clearance($1_xserver_t)
-+ mls_sysvipc_write_to_clearance($1_xserver_t)
-+
-+# missing socket transition
-+ mls_file_write_within_range($1_xserver_t)
-+ mls_xwin_write_all_levels($1_xserver_t)
-+
-+# /dev/mem
-+ mls_file_read_all_levels($1_xserver_t)
-+ mls_file_write_all_levels($1_xserver_t)
-+ ')
-+
-+ selinux_getattr_fs($1_xserver_t)
-+ seutil_read_config($1_xserver_t)
-+
-+# allow $1_xserver_t $2:process getpgid;
-+
-+ allow $1_xserver_t input_xevent_t:x_event send;
-+ allow $1_xserver_t $1_rootwindow_t:x_drawable send;
-+')
-+
-+#######################################
-+##
-+## Interface to provide X object permissions on a given X server to
-+## an X client domain. Provides the minimal set required by a basic
-+## X client application.
-+##
-+##
-+##
-+## The prefix of the X server domain (e.g., user
-+## is the prefix for user_t).
-+##
-+##
-+##
-+##
-+## Client domain allowed access.
-+##
-+##
-+#
-+interface(`xserver_common_app',`
-+ gen_require(`
-+ type std_xext_t;
-+# type $1_rootwindow_t;
-+# type $1_xproperty_t;
-+# type $1_client_xevent_t;
-+# type $1_focus_xevent_t;
-+# type $1_input_xevent_t;
-+# type $1_manage_xevent_t;
-+# type $1_property_xevent_t;
-+ attribute rootwindow_type;
-+ attribute xproperty_type;
-+ class x_drawable all_x_drawable_perms;
-+ class x_screen all_x_screen_perms;
-+ class x_gc all_x_gc_perms;
-+ class x_font all_x_font_perms;
-+ class x_colormap all_x_colormap_perms;
-+ class x_property all_x_property_perms;
-+ class x_selection all_x_selection_perms;
-+ class x_cursor all_x_cursor_perms;
-+ class x_client all_x_client_perms;
-+ class x_device all_x_device_perms;
-+ class x_server all_x_server_perms;
-+ class x_extension all_x_extension_perms;
-+ class x_resource all_x_resource_perms;
-+ class x_event all_x_event_perms;
-+ class x_synthetic_event all_x_synthetic_event_perms;
-+ type xevent_t, input_xevent_t, client_xevent_t;
-+ type clipboard_xselection_t;
-+ type xproperty_t, focus_xevent_t, info_xproperty_t, manage_xevent_t;
-+ type manage_xevent_t, output_xext_t, property_xevent_t;
-+ type debug_xext_t, screensaver_xext_t;
-+ type shmem_xext_t, xselection_t;
-+ attribute xevent_type, xextension_type;
-+ ')
-+ # can receive certain root window events
-+ allow $2 self:x_cursor { destroy create use setattr };
-+ allow $2 self:x_drawable { write getattr read destroy create add_child };
-+
-+ allow $2 self:x_gc { destroy create use setattr };
-+ allow $2 self:x_resource { write read };
-+
-+ allow $2 input_xevent_t:x_synthetic_event receive;
-+ allow $2 client_xevent_t:x_synthetic_event { send receive };
-+ allow $2 focus_xevent_t:x_event receive;
-+ allow $2 info_xproperty_t:x_property read;
-+ allow $2 manage_xevent_t:x_event receive;
-+ allow $2 manage_xevent_t:x_synthetic_event { send receive };
-+
-+ allow $2 xextension_type:x_extension { query use };
-+
-+ allow $2 property_xevent_t:x_event receive;
-+
-+# allow $2 $1_client_xevent_t:x_synthetic_event receive;
-+# allow $2 $1_client_xevent_t:x_event receive;
-+# allow $2 $1_focus_xevent_t:x_event receive;
-+# allow $2 $1_input_xevent_t:x_event receive;
-+# allow $2 $1_input_xevent_t:x_synthetic_event receive;
-+# allow $2 $1_manage_xevent_t:x_event receive;
-+# allow $2 $1_property_xevent_t:x_event receive;
-+ allow $2 xevent_type:x_event receive;
-+ allow $2 xevent_type:x_synthetic_event receive;
-+
-+ allow $2 $1_t:x_drawable { get_property setattr show receive blend create manage add_child write read getattr list_child set_property };
-+
-+# Broken Compiler
-+# allow $2 $1_xproperty_t:x_property read;
-+ allow $2 xproperty_type:x_property {getattr read };
-+
-+ allow $2 std_xext_t:x_extension { query use };
-+ allow $2 xproperty_t:x_property { write create destroy };
-+ allow $2 xselection_t:x_selection getattr;
-+ allow $2 clipboard_xselection_t:x_selection { getattr setattr };
-+
-+ allow $1_t $2:x_resource { write read };
-+
-+# xserver_use($1, $1, $2)
-+ xserver_use(xdm, $1, $2)
-+')
-+
-+
- #######################################
- ##
- ## Interface to provide X object permissions on a given X server to
-@@ -682,7 +803,7 @@
- #
- template(`xserver_common_x_domain_template',`
- gen_require(`
-- type $1_rootwindow_t, std_xext_t, shmem_xext_t;
-+ type std_xext_t, shmem_xext_t;
- type xproperty_t, info_xproperty_t, clipboard_xproperty_t;
- type input_xevent_t, focus_xevent_t, property_xevent_t, manage_xevent_t;
- type xevent_t, client_xevent_t;
-@@ -691,7 +812,6 @@
- attribute x_server_domain, x_domain;
- attribute xproperty_type;
- attribute xevent_type, xextension_type;
-- attribute $1_x_domain, $1_input_xevent_type;
-
- class x_drawable all_x_drawable_perms;
- class x_screen all_x_screen_perms;
-@@ -708,6 +828,7 @@
- class x_resource all_x_resource_perms;
- class x_event all_x_event_perms;
- class x_synthetic_event all_x_synthetic_event_perms;
-+ attribute $1_x_domain;
- ')
-
- ##############################
-@@ -715,20 +836,22 @@
- # Declarations
- #
-
-- # Type attributes
-- typeattribute $3 $1_x_domain, x_domain;
-+ type $2_input_xevent_t, xevent_type;
-
- # Types for properties
- type $2_xproperty_t alias $2_default_xproperty_t, xproperty_type;
-
- # Types for events
-- type $2_input_xevent_t, $1_input_xevent_type, xevent_type;
- type $2_property_xevent_t, xevent_type;
- type $2_focus_xevent_t, xevent_type;
- type $2_manage_xevent_t, xevent_type;
- type $2_default_xevent_t, xevent_type;
- type $2_client_xevent_t, xevent_type;
-
-+ # Type attributes
-+ typeattribute $2_t x_domain;
-+ typeattribute $2_t $1_x_domain;
-+
- ##############################
- #
- # Local Policy
-@@ -746,7 +869,7 @@
- allow $3 x_server_domain:x_server getattr;
- # everyone can do override-redirect windows.
- # this could be used to spoof labels
-- allow $3 self:x_drawable override;
-+ allow $3 $3:x_drawable override;
- # everyone can receive management events on the root window
- # allows to know when new windows appear, among other things
- allow $3 manage_xevent_t:x_event receive;
-@@ -755,36 +878,30 @@
- # can read server-owned resources
- allow $3 x_server_domain:x_resource read;
- # can mess with own clients
-- allow $3 self:x_client { manage destroy };
-+ allow $3 $3:x_client { manage destroy };
-
- # X Protocol Extensions
- allow $3 std_xext_t:x_extension { query use };
- allow $3 shmem_xext_t:x_extension { query use };
- dontaudit $3 xextension_type:x_extension { query use };
-
-+ tunable_policy(`xserver_rw_x_device',`
-+ allow $3 x_server_domain:x_device { read write };
-+ ')
-+
- # X Properties
- # can read and write client properties
-- allow $3 $2_xproperty_t:x_property { create destroy read write append };
-+ allow $3 $2_xproperty_t:x_property { getattr create destroy read write append };
- type_transition $3 xproperty_t:x_property $2_xproperty_t;
- # can read and write cut buffers
-- allow $3 clipboard_xproperty_t:x_property { create read write append };
-+ allow $3 clipboard_xproperty_t:x_property { getattr create read write append };
- # can read info properties
-- allow $3 info_xproperty_t:x_property read;
-- # can change properties of root window
-- allow $3 $1_rootwindow_t:x_drawable { list_property get_property set_property };
-+ allow $3 info_xproperty_t:x_property { getattr read };
- # can change properties of own windows
-- allow $3 self:x_drawable { list_property get_property set_property };
-+ allow $3 $3:x_drawable { list_property get_property set_property };
-
-- # X Windows
-- # operations allowed on root windows
-- allow $3 $1_rootwindow_t:x_drawable { getattr list_child add_child remove_child send receive };
- # operations allowed on my windows
-- allow $3 self:x_drawable { create destroy getattr setattr read write show hide list_child add_child remove_child manage send receive };
-- type_transition $3 $1_rootwindow_t:x_drawable $3;
--
-- # X Colormaps
-- # can use the default colormap
-- allow $3 $1_rootwindow_t:x_colormap { read use add_color };
-+ allow $3 $3:x_drawable { blend create destroy getattr setattr read write show hide list_child add_child remove_child manage send receive };
-
- # X Input
- # can receive own events
-@@ -811,6 +928,12 @@
- allow $3 manage_xevent_t:x_synthetic_event send;
- allow $3 client_xevent_t:x_synthetic_event send;
-
-+ allow $3 input_xevent_t:x_event receive;
-+ allow $3 input_xevent_t:x_synthetic_event send;
-+ allow $3 $2_client_xevent_t:x_synthetic_event send;
-+ allow $3 xproperty_t:x_property { read destroy };
-+ allow $3 xselection_t:x_selection setattr;
-+
- # X Selections
- # can use the clipboard
- allow $3 clipboard_xselection_t:x_selection { getattr setattr read };
-@@ -819,13 +942,15 @@
-
- # Other X Objects
- # can create and use cursors
-- allow $3 self:x_cursor *;
-+ allow $3 $3:x_cursor *;
- # can create and use graphics contexts
-- allow $3 self:x_gc *;
-+ allow $3 $3:x_gc *;
- # can create and use colormaps
-- allow $3 self:x_colormap *;
-+ allow $3 $3:x_colormap *;
- # can read and write own objects
-- allow $3 self:x_resource { read write };
-+ allow $3 $3:x_resource { read write };
-+
-+ xserver_common_app($1, $3)
-
- tunable_policy(`! xserver_object_manager',`
- # should be xserver_unconfined($3),
-@@ -885,24 +1010,17 @@
- #
- template(`xserver_user_x_domain_template',`
- gen_require(`
-- type xdm_t, xdm_tmp_t;
-- type $1_xauth_home_t, $1_iceauth_home_t, $1_xserver_t, $1_xserver_tmpfs_t;
-+ type xdm_xproperty_t;
-+ type xauth_home_t, iceauth_home_t;
- ')
-
-- allow $3 self:shm create_shm_perms;
-- allow $3 self:unix_dgram_socket create_socket_perms;
-- allow $3 self:unix_stream_socket { connectto create_stream_socket_perms };
-+ allow $3 $3:shm create_shm_perms;
-+ allow $3 $3:unix_dgram_socket create_socket_perms;
-+ allow $3 $3:unix_stream_socket { connectto create_stream_socket_perms };
-
- # Read .Xauthority file
-- allow $3 $1_xauth_home_t:file { getattr read };
-- allow $3 $1_iceauth_home_t:file { getattr read };
--
-- # for when /tmp/.X11-unix is created by the system
-- allow $3 xdm_t:fd use;
-- allow $3 xdm_t:fifo_file { getattr read write ioctl };
-- allow $3 xdm_tmp_t:dir search;
-- allow $3 xdm_tmp_t:sock_file { read write };
-- dontaudit $3 xdm_t:tcp_socket { read write };
-+ allow $3 xauth_home_t:file read_file_perms;
-+ allow $3 iceauth_home_t:file read_file_perms;
-
- # Allow connections to X server.
- files_search_tmp($3)
-@@ -917,16 +1035,16 @@
- xserver_rw_session_template($1, $3, $4)
- xserver_use_user_fonts($1, $3)
-
-- xserver_read_xdm_tmp_files($3)
--
- # X object manager
- xserver_common_x_domain_template($1, $2, $3)
-
-- # Client write xserver shm
-- tunable_policy(`allow_write_xshm',`
-- allow $3 $1_xserver_t:shm rw_shm_perms;
-- allow $3 $1_xserver_tmpfs_t:file rw_file_perms;
-- ')
-+ allow $3 xdm_xproperty_t:x_property { write read };
-+ allow $3 xdm_xserver_t:x_screen { saver_hide saver_show };
-+
-+# allow $3 $1_rootwindow_t:x_drawable read;
-+ allow $3 xdm_rootwindow_t:x_drawable read;
-+
-+ xserver_use_xdm($3)
- ')
-
- ########################################
-@@ -958,26 +1076,43 @@
- #
- template(`xserver_use_user_fonts',`
- gen_require(`
-- type $1_fonts_t, $1_fonts_cache_t, $1_fonts_config_t;
-+ type fonts_home_t, fonts_cache_home_t, fonts_config_home_t;
- ')
-
- # Read per user fonts
-- allow $2 $1_fonts_t:dir list_dir_perms;
-- allow $2 $1_fonts_t:file read_file_perms;
-+ read_files_pattern($2, fonts_home_t, fonts_home_t)
-
- # Manipulate the global font cache
-- manage_dirs_pattern($2, $1_fonts_cache_t, $1_fonts_cache_t)
-- manage_files_pattern($2, $1_fonts_cache_t, $1_fonts_cache_t)
-+ manage_dirs_pattern($2, fonts_cache_home_t, fonts_cache_home_t)
-+ manage_files_pattern($2, fonts_cache_home_t, fonts_cache_home_t)
-
- # Read per user font config
-- allow $2 $1_fonts_config_t:dir list_dir_perms;
-- allow $2 $1_fonts_config_t:file read_file_perms;
-+ allow $2 fonts_config_home_t:dir list_dir_perms;
-+ allow $2 fonts_config_home_t:file read_file_perms;
-
- userdom_search_user_home_dirs($1, $2)
- ')
-
- ########################################
- ##
-+## Get the attributes of xauth executable
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+#
-+interface(`xserver_getattr_xauth',`
-+ gen_require(`
-+ type xauth_exec_t;
-+ ')
-+
-+ allow $1 xauth_exec_t:file getattr;
-+')
-+
-+########################################
-+##
- ## Transition to a user Xauthority domain.
- ##
- ##
-@@ -1003,10 +1138,77 @@
- #
- template(`xserver_domtrans_user_xauth',`
- gen_require(`
-- type $1_xauth_t, xauth_exec_t;
-+ type xauth_t, xauth_exec_t;
- ')
-
-- domtrans_pattern($2, xauth_exec_t, $1_xauth_t)
-+ domtrans_pattern($2, xauth_exec_t, xauth_t)
-+')
-+
-+########################################
-+##
-+## Read a user Xauthority domain.
-+##
-+##
-+##
-+## read to a user Xauthority domain.
-+##
-+##
-+## This is a templated interface, and should only
-+## be called from a per-userdomain template.
-+##
-+##
-+##
-+##
-+## The prefix of the user domain (e.g., user
-+## is the prefix for user_t).
-+##
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+#
-+template(`xserver_read_user_xauth',`
-+ gen_require(`
-+ type xauth_home_t;
-+ ')
-+
-+ allow $2 xauth_home_t:file read_file_perms;
-+')
-+
-+########################################
-+##
-+## Read a user Iceauthority domain.
-+##
-+##
-+##
-+## read to a user Iceauthority domain.
-+##
-+##
-+## This is a templated interface, and should only
-+## be called from a per-userdomain template.
-+##
-+##
-+##
-+##
-+## The prefix of the user domain (e.g., user
-+## is the prefix for user_t).
-+##
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+#
-+template(`xserver_read_user_iceauth',`
-+ gen_require(`
-+ type iceauth_home_t;
-+ ')
-+
-+ # Read .Iceauthority file
-+ allow $2 iceauth_home_t:file read_file_perms;
- ')
-
- ########################################
-@@ -1036,10 +1238,10 @@
- #
- template(`xserver_user_home_dir_filetrans_user_xauth',`
- gen_require(`
-- type $1_xauth_home_t;
-+ type xauth_home_t;
- ')
-
-- userdom_user_home_dir_filetrans($1, $2, $1_xauth_home_t, file)
-+ userdom_user_home_dir_filetrans($1, $2, xauth_home_t, file)
- ')
-
- ########################################
-@@ -1180,7 +1382,7 @@
- type xdm_t;
- ')
-
-- allow $1 xdm_t:fifo_file { getattr read write };
-+ allow $1 xdm_t:fifo_file rw_fifo_file_perms;
- ')
-
- ########################################
-@@ -1225,6 +1427,25 @@
-
- ########################################
- ##
-+## Connect to apmd over an unix stream socket.
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+#
-+interface(`xserver_stream_connect',`
-+ gen_require(`
-+ type xdm_xserver_t, xserver_var_run_t;
-+ ')
-+
-+ files_search_pids($1)
-+ stream_connect_pattern($1, xserver_var_run_t, xserver_var_run_t, xdm_xserver_t)
-+')
-+
-+########################################
-+##
- ## Read xdm-writable configuration files.
- ##
- ##
-@@ -1239,7 +1460,7 @@
- ')
-
- files_search_etc($1)
-- allow $1 xdm_rw_etc_t:file { getattr read };
-+ allow $1 xdm_rw_etc_t:file read_file_perms;
- ')
-
- ########################################
-@@ -1279,6 +1500,7 @@
- files_search_tmp($1)
- allow $1 xdm_tmp_t:dir list_dir_perms;
- create_sock_files_pattern($1, xdm_tmp_t, xdm_tmp_t)
-+ allow $1 xdm_tmp_t:sock_file unlink;
- ')
-
- ########################################
-@@ -1297,7 +1519,7 @@
- ')
-
- files_search_pids($1)
-- allow $1 xdm_var_run_t:file read_file_perms;
-+ read_files_pattern($1, xdm_var_run_t, xdm_var_run_t)
- ')
-
- ########################################
-@@ -1315,7 +1537,25 @@
- type xdm_var_lib_t;
- ')
-
-- allow $1 xdm_var_lib_t:file { getattr read };
-+ allow $1 xdm_var_lib_t:file read_file_perms;
-+')
-+
-+########################################
-+##
-+## dontaudit search of XDM var lib directories.
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+#
-+interface(`xserver_dontaudit_xdm_lib_search',`
-+ gen_require(`
-+ type xdm_var_lib_t;
-+ ')
-+
-+ dontaudit $1 xdm_var_lib_t:dir search_dir_perms;
- ')
-
- ########################################
-@@ -1330,15 +1570,47 @@
- #
- interface(`xserver_domtrans_xdm_xserver',`
- gen_require(`
-- type xdm_xserver_t, xserver_exec_t;
-+ type xdm_xserver_t, xserver_exec_t, xdm_t;
- ')
-
- allow $1 xdm_xserver_t:process siginh;
-+ allow xdm_t $1:process sigchld;
- domtrans_pattern($1, xserver_exec_t, xdm_xserver_t)
- ')
-
- ########################################
- ##
-+## Execute xsever in the xdm_xserver domain, and
-+## allow the specified role the xdm_xserver domain.
-+##
-+##
-+##
-+## The type of the process performing this action.
-+##
-+##
-+##
-+##
-+## The role to be allowed the xdm_xserver domain.
-+##
-+##
-+##
-+##
-+## The type of the terminal allow the xdm_xserver domain to use.
-+##
-+##
-+#
-+interface(`xserver_run_xdm_xserver',`
-+ gen_require(`
-+ type xdm_xserver_t;
-+ ')
-+
-+ xserver_domtrans_xdm_xserver($1)
-+ role $2 types xdm_xserver_t;
-+ allow xdm_xserver_t $3:chr_file rw_term_perms;
-+')
-+
-+########################################
-+##
- ## Make an X session script an entrypoint for the specified domain.
- ##
- ##
-@@ -1488,7 +1760,7 @@
- type xdm_xserver_tmp_t;
- ')
-
-- allow $1 xdm_xserver_tmp_t:file { getattr read };
-+ read_files_pattern($1, xdm_xserver_tmp_t, xdm_xserver_tmp_t)
- ')
-
- ########################################
-@@ -1680,6 +1952,26 @@
-
- ########################################
- ##
-+## Connect to apmd over an unix stream socket.
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+#
-+interface(`xserver_xdm_stream_connect',`
-+ gen_require(`
-+ type xdm_t, xdm_var_run_t;
-+ ')
-+
-+ files_search_pids($1)
-+ allow $1 xdm_var_run_t:sock_file write;
-+ allow $1 xdm_t:unix_stream_socket connectto;
-+')
-+
-+########################################
-+##
- ## xdm xserver RW shared memory socket.
- ##
- ##
-@@ -1698,6 +1990,24 @@
-
- ########################################
- ##
-+## Ptrace XDM
-+##
-+##
-+##
-+## Domain to not audit
-+##
-+##
-+#
-+interface(`xserver_ptrace_xdm',`
-+ gen_require(`
-+ type xdm_t;
-+ ')
-+
-+ allow $1 xdm_t:process ptrace;
-+')
-+
-+########################################
-+##
- ## Interface to provide X object permissions on a given X server to
- ## an X client domain. Gives the domain complete control over the
- ## display.
-@@ -1710,8 +2020,176 @@
- #
- interface(`xserver_unconfined',`
- gen_require(`
-- attribute xserver_unconfined_type;
-+ attribute xserver_unconfined_type, x_domain;
-+ ')
-+
-+ typeattribute $1 xserver_unconfined_type, x_domain;
-+')
-+
-+########################################
-+##
-+## Read xserver files created in /var/run
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+#
-+interface(`xserver_read_pid',`
-+ gen_require(`
-+ type xserver_var_run_t;
-+ ')
-+
-+ files_search_pids($1)
-+ read_files_pattern($1, xserver_var_run_t, xserver_var_run_t)
-+')
-+
-+########################################
-+##
-+## Execute xserver files created in /var/run
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+#
-+interface(`xserver_exec_pid',`
-+ gen_require(`
-+ type xserver_var_run_t;
-+ ')
-+
-+ files_search_pids($1)
-+ exec_files_pattern($1, xserver_var_run_t, xserver_var_run_t)
-+')
-+
-+########################################
-+##
-+## Write xserver files created in /var/run
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+#
-+interface(`xserver_write_pid',`
-+ gen_require(`
-+ type xserver_var_run_t;
-+ ')
-+
-+ files_search_pids($1)
-+ write_files_pattern($1, xserver_var_run_t, xserver_var_run_t)
-+')
-+
-+########################################
-+##
-+## Read user homedir fonts.
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+##
-+#
-+interface(`xserver_manage_home_fonts',`
-+ gen_require(`
-+ type fonts_home_t;
-+ type fonts_config_home_t;
-+ ')
-+
-+ manage_dirs_pattern($1, fonts_home_t, fonts_home_t)
-+ manage_files_pattern($1, fonts_home_t, fonts_home_t)
-+ manage_lnk_files_pattern($1, fonts_home_t, fonts_home_t)
-+
-+ manage_files_pattern($1, fonts_config_home_t, fonts_config_home_t)
-+')
-+
-+########################################
-+##
-+## Read user homedir fonts.
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+##
-+#
-+interface(`xserver_read_home_fonts',`
-+ gen_require(`
-+ type fonts_home_t;
-+ ')
-+
-+ read_files_pattern($1, fonts_home_t, fonts_home_t)
-+ read_lnk_files_pattern($1, fonts_home_t, fonts_home_t)
-+')
-+
-+########################################
-+##
-+## write to .xsession-errors file
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+#
-+interface(`xserver_rw_xdm_home_files',`
-+ gen_require(`
-+ type xdm_home_t;
-+ ')
-+
-+ allow $1 xdm_home_t:file rw_file_perms;
-+')
-+
-+########################################
-+##
-+## Dontaudit write to .xsession-errors file
-+##
-+##
-+##
-+## Domain to not audit
-+##
-+##
-+#
-+interface(`xserver_dontaudit_rw_xdm_home_files',`
-+ gen_require(`
-+ type xdm_home_t;
- ')
-
-- typeattribute $1 xserver_unconfined_type;
-+ dontaudit $1 xdm_home_t:file rw_file_perms;
-+')
-+
-+#######################################
-+##
-+## Interface to provide X object permissions on a given X server to
-+## an X client domain. Provides the minimal set required by a basic
-+## X client application.
-+##
-+##
-+##
-+## Client domain allowed access.
-+##
-+##
-+#
-+interface(`xserver_use_xdm',`
-+ gen_require(`
-+ type xdm_t, xdm_tmp_t;
-+ ')
-+
-+ allow $1 xdm_t:fd use;
-+ allow $1 xdm_t:fifo_file rw_fifo_file_perms;
-+ dontaudit $1 xdm_t:tcp_socket { read write };
-+
-+ # Allow connections to X server.
-+ xserver_stream_connect_xdm($1)
-+ xserver_read_xdm_tmp_files($1)
-+ xserver_xdm_stream_connect($1)
-+
-+ allow $1 xdm_t:x_client { getattr destroy };
-+ allow $1 xdm_t:x_drawable { read receive get_property getattr send list_child add_child };
-+ allow $1 xdm_xproperty_t:x_property { write read };
- ')
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/services/xserver.te serefpolicy-3.5.13/policy/modules/services/xserver.te
---- nsaserefpolicy/policy/modules/services/xserver.te 2008-10-16 17:21:16.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/services/xserver.te 2008-11-05 15:24:47.000000000 -0500
-@@ -8,6 +8,14 @@
-
- ##
- ##
-+## Allows X clients to read/write the x devices (keyboard/mouse)
-+##
-+##
-+gen_tunable(xserver_rw_x_device, true)
-+
-+
-+##
-+##
- ## Allows clients to write to the X server shared
- ## memory segments.
- ##
-@@ -16,6 +24,13 @@
-
- ##
- ##
-+## Allows XServer to execute writable memory
-+##
-+##
-+gen_tunable(allow_xserver_execmem, false)
-+
-+##
-+##
- ## Allow xdm logins as sysadm
- ##
- ##
-@@ -36,6 +51,7 @@
- # Domains
- attribute xserver_unconfined_type;
- attribute x_server_domain;
-+attribute x_server_domain_tmpfs;
-
- # Per-object attributes
- attribute rootwindow_type;
-@@ -92,7 +108,10 @@
- files_lock_file(xdm_lock_t)
-
- type xdm_rw_etc_t;
--files_type(xdm_rw_etc_t)
-+files_config_file(xdm_rw_etc_t)
-+
-+type xdm_spool_t;
-+files_type(xdm_spool_t)
-
- type xdm_var_lib_t;
- files_type(xdm_var_lib_t)
-@@ -100,6 +119,12 @@
- type xdm_var_run_t;
- files_pid_file(xdm_var_run_t)
-
-+type xserver_var_lib_t;
-+files_type(xserver_var_lib_t)
-+
-+type xserver_var_run_t;
-+files_pid_file(xserver_var_run_t)
-+
- type xdm_tmp_t;
- files_tmp_file(xdm_tmp_t)
- typealias xdm_tmp_t alias ice_tmp_t;
-@@ -107,6 +132,9 @@
- type xdm_tmpfs_t;
- files_tmpfs_file(xdm_tmpfs_t)
-
-+type xdm_home_t;
-+userdom_user_home_content(user, xdm_home_t)
-+
- # type for /var/lib/xkb
- type xkb_var_lib_t;
- files_type(xkb_var_lib_t)
-@@ -122,6 +150,31 @@
- type xserver_log_t;
- logging_log_file(xserver_log_t)
-
-+type fonts_cache_home_t, fonts_cache_type;
-+userdom_user_home_content(user, fonts_cache_home_t)
-+
-+type fonts_home_t, fonts_type;
-+userdom_user_home_content(user, fonts_home_t)
-+
-+type fonts_config_home_t, fonts_config_type;
-+userdom_user_home_content(user, fonts_config_home_t)
-+
-+type iceauth_home_t;
-+userdom_user_home_content(user, iceauth_home_t)
-+
-+type xauth_t;
-+domain_type(xauth_t)
-+domain_entry_file(xauth_t, xauth_exec_t)
-+
-+type xauth_home_t, xauth_home_type;
-+userdom_user_home_content(user, xauth_home_t)
-+
-+type admin_xauth_home_t;
-+files_type(admin_xauth_home_t)
-+
-+type xauth_tmp_t;
-+files_tmp_file(xauth_tmp_t)
-+
- xserver_common_domain_template(xdm)
- xserver_common_x_domain_template(xdm, xdm, xdm_t)
- init_system_domain(xdm_xserver_t, xserver_exec_t)
-@@ -140,13 +193,14 @@
- # XDM Local policy
- #
-
--allow xdm_t self:capability { setgid setuid sys_resource kill sys_tty_config mknod chown dac_override dac_read_search fowner fsetid ipc_owner sys_nice sys_rawio net_bind_service };
--allow xdm_t self:process { setexec setpgid getsched setsched setrlimit signal_perms setkeycreate };
-+allow xdm_t self:capability { setgid setuid sys_resource kill sys_tty_config mknod chown dac_override dac_read_search fowner fsetid ipc_owner sys_nice sys_rawio net_bind_service sys_ptrace };
-+allow xdm_t self:process { setexec setpgid getsched setsched setrlimit signal_perms setkeycreate ptrace };
-+allow xdm_t self:process { getattr getcap setcap };
- allow xdm_t self:fifo_file rw_fifo_file_perms;
- allow xdm_t self:shm create_shm_perms;
- allow xdm_t self:sem create_sem_perms;
- allow xdm_t self:unix_stream_socket { connectto create_stream_socket_perms };
--allow xdm_t self:unix_dgram_socket create_socket_perms;
-+allow xdm_t self:unix_dgram_socket { create_socket_perms sendto };
- allow xdm_t self:tcp_socket create_stream_socket_perms;
- allow xdm_t self:udp_socket create_socket_perms;
- allow xdm_t self:socket create_socket_perms;
-@@ -154,6 +208,12 @@
- allow xdm_t self:key { search link write };
-
- allow xdm_t xconsole_device_t:fifo_file { getattr setattr };
-+manage_dirs_pattern(xdm_t, xkb_var_lib_t, xkb_var_lib_t)
-+manage_files_pattern(xdm_t, xkb_var_lib_t, xkb_var_lib_t)
-+
-+manage_files_pattern(xdm_t, xdm_home_t, xdm_home_t)
-+unprivuser_home_dir_filetrans(xdm_t, xdm_home_t, file)
-+#userdom_manage_user_home_content_files(user, xdm_t)
-
- # Allow gdm to run gdm-binary
- can_exec(xdm_t, xdm_exec_t)
-@@ -169,6 +229,8 @@
- manage_files_pattern(xdm_t, xdm_tmp_t, xdm_tmp_t)
- manage_sock_files_pattern(xdm_t, xdm_tmp_t, xdm_tmp_t)
- files_tmp_filetrans(xdm_t, xdm_tmp_t, { file dir sock_file })
-+relabelfrom_dirs_pattern(xdm_t, xdm_tmp_t, xdm_tmp_t)
-+relabelfrom_files_pattern(xdm_t, xdm_tmp_t, xdm_tmp_t)
-
- manage_dirs_pattern(xdm_t, xdm_tmpfs_t, xdm_tmpfs_t)
- manage_files_pattern(xdm_t, xdm_tmpfs_t, xdm_tmpfs_t)
-@@ -176,15 +238,32 @@
- manage_fifo_files_pattern(xdm_t, xdm_tmpfs_t, xdm_tmpfs_t)
- manage_sock_files_pattern(xdm_t, xdm_tmpfs_t, xdm_tmpfs_t)
- fs_tmpfs_filetrans(xdm_t, xdm_tmpfs_t,{ dir file lnk_file sock_file fifo_file })
-+fs_rw_tmpfs_files(xdm_xserver_t)
-+fs_getattr_all_fs(xdm_t)
-+fs_search_inotifyfs(xdm_t)
-+fs_list_all(xdm_t)
-+fs_read_noxattr_fs_files(xdm_t)
-+
-+manage_files_pattern(xdm_t, fonts_home_t, fonts_home_t)
-+
-+files_search_spool(xdm_t)
-+manage_dirs_pattern(xdm_t, xdm_spool_t, xdm_spool_t)
-+manage_files_pattern(xdm_t, xdm_spool_t, xdm_spool_t)
-+files_spool_filetrans(xdm_t, xdm_spool_t, { file dir })
-
- manage_dirs_pattern(xdm_t, xdm_var_lib_t, xdm_var_lib_t)
- manage_files_pattern(xdm_t, xdm_var_lib_t, xdm_var_lib_t)
--files_var_lib_filetrans(xdm_t, xdm_var_lib_t, file)
-+manage_lnk_files_pattern(xdm_t, xdm_var_lib_t, xdm_var_lib_t)
-+manage_sock_files_pattern(xdm_t, xdm_var_lib_t, xdm_var_lib_t)
-+files_var_lib_filetrans(xdm_t, xdm_var_lib_t, { file dir })
-+# Read machine-id
-+files_read_var_lib_files(xdm_t)
-
- manage_dirs_pattern(xdm_t, xdm_var_run_t, xdm_var_run_t)
- manage_files_pattern(xdm_t, xdm_var_run_t, xdm_var_run_t)
- manage_fifo_files_pattern(xdm_t, xdm_var_run_t, xdm_var_run_t)
--files_pid_filetrans(xdm_t, xdm_var_run_t, { dir file fifo_file })
-+manage_sock_files_pattern(xdm_t, xdm_var_run_t, xdm_var_run_t)
-+files_pid_filetrans(xdm_t, xdm_var_run_t, { dir file fifo_file sock_file })
-
- allow xdm_t xdm_xserver_t:process signal;
- allow xdm_t xdm_xserver_t:unix_stream_socket connectto;
-@@ -198,6 +277,7 @@
- allow xdm_t xdm_xserver_t:process { noatsecure siginh rlimitinh signal sigkill };
-
- allow xdm_t xdm_xserver_t:shm rw_shm_perms;
-+read_files_pattern(xdm_t, xdm_xserver_t, xdm_xserver_t)
-
- # connect to xdm xserver over stream socket
- stream_connect_pattern(xdm_t, xdm_xserver_tmp_t, xdm_xserver_tmp_t, xdm_xserver_t)
-@@ -229,6 +309,7 @@
- corenet_udp_sendrecv_all_ports(xdm_t)
- corenet_tcp_bind_all_nodes(xdm_t)
- corenet_udp_bind_all_nodes(xdm_t)
-+corenet_udp_bind_xdmcp_port(xdm_t)
- corenet_tcp_connect_all_ports(xdm_t)
- corenet_sendrecv_all_client_packets(xdm_t)
- # xdm tries to bind to biff_port_t
-@@ -241,6 +322,7 @@
- dev_getattr_mouse_dev(xdm_t)
- dev_setattr_mouse_dev(xdm_t)
- dev_rw_apm_bios(xdm_t)
-+dev_rw_input_dev(xdm_t)
- dev_setattr_apm_bios_dev(xdm_t)
- dev_rw_dri(xdm_t)
- dev_rw_agp(xdm_t)
-@@ -253,14 +335,17 @@
- dev_setattr_video_dev(xdm_t)
- dev_getattr_scanner_dev(xdm_t)
- dev_setattr_scanner_dev(xdm_t)
--dev_getattr_sound_dev(xdm_t)
--dev_setattr_sound_dev(xdm_t)
-+dev_read_sound(xdm_t)
-+dev_write_sound(xdm_t)
- dev_getattr_power_mgmt_dev(xdm_t)
- dev_setattr_power_mgmt_dev(xdm_t)
-+dev_getattr_null_dev(xdm_t)
-+dev_setattr_null_dev(xdm_t)
-
- domain_use_interactive_fds(xdm_t)
- # Do not audit denied probes of /proc.
- domain_dontaudit_read_all_domains_state(xdm_t)
-+domain_dontaudit_ptrace_all_domains(xdm_t)
-
- files_read_etc_files(xdm_t)
- files_read_var_files(xdm_t)
-@@ -271,9 +356,13 @@
- files_read_usr_files(xdm_t)
- # Poweroff wants to create the /poweroff file when run from xdm
- files_create_boot_flag(xdm_t)
-+files_dontaudit_getattr_boot_dirs(xdm_t)
-+files_dontaudit_write_usr_files(xdm_t)
-
- fs_getattr_all_fs(xdm_t)
- fs_search_auto_mountpoints(xdm_t)
-+fs_rw_anon_inodefs_files(xdm_t)
-+fs_mount_tmpfs(xdm_t)
-
- storage_dontaudit_read_fixed_disk(xdm_t)
- storage_dontaudit_write_fixed_disk(xdm_t)
-@@ -282,6 +371,7 @@
- storage_dontaudit_raw_write_removable_device(xdm_t)
- storage_dontaudit_setattr_removable_dev(xdm_t)
- storage_dontaudit_rw_scsi_generic(xdm_t)
-+storage_dontaudit_rw_fuse(xdm_t)
-
- term_setattr_console(xdm_t)
- term_use_unallocated_ttys(xdm_t)
-@@ -290,6 +380,7 @@
- auth_domtrans_pam_console(xdm_t)
- auth_manage_pam_pid(xdm_t)
- auth_manage_pam_console_data(xdm_t)
-+auth_signal_pam(xdm_t)
- auth_rw_faillog(xdm_t)
- auth_write_login_records(xdm_t)
-
-@@ -301,21 +392,26 @@
- libs_exec_lib_files(xdm_t)
-
- logging_read_generic_logs(xdm_t)
-+logging_send_audit_msgs(xdm_t)
-
-+miscfiles_dontaudit_write_fonts(xdm_t)
- miscfiles_read_localization(xdm_t)
- miscfiles_read_fonts(xdm_t)
--
--sysnet_read_config(xdm_t)
-+miscfiles_manage_localization(xdm_t)
-
- userdom_dontaudit_use_unpriv_user_fds(xdm_t)
- userdom_create_all_users_keys(xdm_t)
- # for .dmrc
--userdom_read_unpriv_users_home_content_files(xdm_t)
-+unprivuser_read_home_content_files(xdm_t)
-+unprivuser_dontaudit_write_home_content_files(xdm_t)
-+
- # Search /proc for any user domain processes.
- userdom_read_all_users_state(xdm_t)
- userdom_signal_all_users(xdm_t)
--
--sysadm_dontaudit_search_home_dirs(xdm_t)
-+#
-+# Wants to delete .xsession-errors file
-+#
-+userdom_unlink_unpriv_users_home_content_files(xdm_t)
-
- xserver_rw_session_template(xdm, xdm_t, xdm_tmpfs_t)
- xserver_unconfined(xdm_t)
-@@ -348,10 +444,12 @@
-
- optional_policy(`
- alsa_domtrans(xdm_t)
-+ alsa_read_rw_config(xdm_t)
- ')
-
- optional_policy(`
- consolekit_dbus_chat(xdm_t)
-+ consolekit_read_log(xdm_t)
- ')
-
- optional_policy(`
-@@ -359,6 +457,22 @@
- ')
-
- optional_policy(`
-+ # Use dbus to start other processes as xdm_t
-+ dbus_per_role_template(xdm, xdm_t, system_r)
-+ corecmd_bin_entry_type(xdm_t)
-+
-+ dbus_system_bus_client_template(xdm, xdm_t)
-+
-+ optional_policy(`
-+ hal_dbus_chat(xdm_t)
-+ ')
-+
-+ optional_policy(`
-+ networkmanager_dbus_chat(xdm_t)
-+ ')
-+')
-+
-+optional_policy(`
- # Talk to the console mouse server.
- gpm_stream_connect(xdm_t)
- gpm_setattr_gpmctl(xdm_t)
-@@ -382,16 +496,34 @@
- ')
-
- optional_policy(`
-+ polkit_domtrans_auth(xdm_t)
-+ polkit_read_lib(xdm_t)
-+')
-+
-+# On crash gdm execs gdb to dump stack
-+optional_policy(`
-+ rpm_exec(xdm_t)
-+ rpm_read_db(xdm_t)
-+ rpm_dontaudit_manage_db(xdm_t)
-+')
-+
-+optional_policy(`
- seutil_sigchld_newrole(xdm_t)
- ')
-
- optional_policy(`
-+ sysadm_dontaudit_search_home_dirs(xdm_t)
-+ sysadm_dontaudit_read_home_sym_links(xdm_t)
-+ sysadm_dontaudit_write_home_dirs(xdm_t)
-+')
-+
-+optional_policy(`
- udev_read_db(xdm_t)
- ')
-
- optional_policy(`
-- unconfined_domain(xdm_t)
- unconfined_domtrans(xdm_t)
-+ unconfined_signal(xdm_t)
-
- ifndef(`distro_redhat',`
- allow xdm_t self:process { execheap execmem };
-@@ -411,6 +543,10 @@
- ')
-
- optional_policy(`
-+ wm_exec(xdm_t)
-+')
-+
-+optional_policy(`
- xfs_stream_connect(xdm_t)
- ')
-
-@@ -427,7 +563,7 @@
- allow xdm_xserver_t xdm_var_lib_t:file { getattr read };
- dontaudit xdm_xserver_t xdm_var_lib_t:dir search;
-
--allow xdm_xserver_t xdm_var_run_t:file read_file_perms;
-+read_files_pattern(xdm_xserver_t, xdm_var_run_t, xdm_var_run_t)
-
- # Label pid and temporary files with derived types.
- manage_files_pattern(xdm_xserver_t, xdm_tmp_t, xdm_tmp_t)
-@@ -439,6 +575,15 @@
- can_exec(xdm_xserver_t, xkb_var_lib_t)
- files_search_var_lib(xdm_xserver_t)
-
-+manage_dirs_pattern(xdm_xserver_t, xserver_var_lib_t, xserver_var_lib_t)
-+manage_files_pattern(xdm_xserver_t, xserver_var_lib_t, xserver_var_lib_t)
-+files_var_lib_filetrans(xdm_xserver_t, xserver_var_lib_t, dir)
-+
-+manage_dirs_pattern(xdm_xserver_t, xserver_var_run_t, xserver_var_run_t)
-+manage_files_pattern(xdm_xserver_t, xserver_var_run_t, xserver_var_run_t)
-+manage_sock_files_pattern(xdm_xserver_t, xdm_var_run_t, xdm_var_run_t)
-+files_pid_filetrans(xdm_xserver_t, xserver_var_run_t, { dir file })
-+
- # VNC v4 module in X server
- corenet_tcp_bind_vnc_port(xdm_xserver_t)
-
-@@ -450,10 +595,19 @@
- # xdm_xserver_t may no longer have any reason
- # to read ROLE_home_t - examine this in more detail
- # (xauth?)
--userdom_read_unpriv_users_home_content_files(xdm_xserver_t)
-+unprivuser_read_home_content_files(xdm_xserver_t)
-+unprivuser_manage_tmp_files(xdm_xserver_t)
-
- xserver_use_all_users_fonts(xdm_xserver_t)
-
-+getty_use_fds(xdm_xserver_t)
-+locallogin_use_fds(xdm_xserver_t)
-+userdom_dontaudit_write_user_home_content_files(user, xdm_xserver_t)
-+
-+optional_policy(`
-+ userhelper_search_config(xdm_xserver_t)
-+')
-+
- tunable_policy(`use_nfs_home_dirs',`
- fs_manage_nfs_dirs(xdm_xserver_t)
- fs_manage_nfs_files(xdm_xserver_t)
-@@ -468,8 +622,19 @@
-
- optional_policy(`
- dbus_system_bus_client_template(xdm_xserver, xdm_xserver_t)
-+
-+ optional_policy(`
- hal_dbus_chat(xdm_xserver_t)
- ')
-+')
-+
-+optional_policy(`
-+ locallogin_use_fds(xdm_xserver_t)
-+')
-+
-+optional_policy(`
-+ mono_rw_shm(xdm_xserver_t)
-+')
-
- optional_policy(`
- resmgr_stream_connect(xdm_t)
-@@ -481,8 +646,25 @@
- ')
-
- optional_policy(`
-- unconfined_domain_noaudit(xdm_xserver_t)
-- unconfined_domtrans(xdm_xserver_t)
-+ rpm_dontaudit_rw_shm(xdm_xserver_t)
-+ rpm_rw_tmpfs_files(xdm_xserver_t)
-+')
-+
-+optional_policy(`
-+ unconfined_rw_shm(xdm_xserver_t)
-+ unconfined_execmem_rw_shm(xdm_xserver_t)
-+ unconfined_rw_tmpfs_files(xdm_xserver_t)
-+
-+ # xserver signals unconfined user on startx
-+ unconfined_signal(xdm_xserver_t)
-+ unconfined_getpgid(xdm_xserver_t)
-+ unconfined_domain(xdm_xserver_t)
-+')
-+
-+
-+tunable_policy(`allow_xserver_execmem',`
-+ allow xdm_xserver_t self:process { execheap execmem execstack };
-+')
-
- ifndef(`distro_redhat',`
- allow xdm_xserver_t self:process { execheap execmem };
-@@ -491,7 +673,6 @@
- ifdef(`distro_rhel4',`
- allow xdm_xserver_t self:process { execheap execmem };
- ')
--')
-
- ########################################
- #
-@@ -512,6 +693,27 @@
- allow xserver_unconfined_type { x_domain x_server_domain }:x_resource *;
- allow xserver_unconfined_type xevent_type:{ x_event x_synthetic_event } *;
-
-+
-+tunable_policy(`!xserver_object_manager',`
-+ gen_require(`
-+ attribute domain;
-+ ')
-+ # we want no X confinement
-+ allow domain domain:x_server *;
-+ allow domain domain:x_drawable *;
-+ allow domain domain:x_screen *;
-+ allow domain domain:x_gc *;
-+ allow domain domain:x_colormap *;
-+ allow domain domain:x_property *;
-+ allow domain domain:x_selection *;
-+ allow domain domain:x_cursor *;
-+ allow domain domain:x_client *;
-+ allow domain domain:x_device *;
-+ allow domain domain:x_extension *;
-+ allow domain domain:x_resource *;
-+ allow domain domain:{ x_event x_synthetic_event } *;
-+')
-+
- ifdef(`TODO',`
- # Need to further investigate these permissions and
- # perhaps define derived types.
-@@ -544,3 +746,70 @@
- #
- allow pam_t xdm_t:fifo_file { getattr ioctl write };
- ') dnl end TODO
-+
-+# Client write xserver shm
-+tunable_policy(`allow_write_xshm',`
-+ allow x_domain x_server_domain:shm rw_shm_perms;
-+ allow x_domain xdm_xserver_tmpfs_t:file rw_file_perms;
-+')
-+
-+##############################
-+#
-+# xauth_t Local policy
-+#
-+
-+allow xauth_t self:process signal;
-+allow xauth_t self:unix_stream_socket create_stream_socket_perms;
-+
-+allow xauth_t xauth_home_t:file manage_file_perms;
-+userdom_user_home_dir_filetrans($1, xauth_t, xauth_home_t, file)
-+
-+manage_dirs_pattern(xauth_t, xauth_tmp_t, xauth_tmp_t)
-+manage_files_pattern(xauth_t, xauth_tmp_t, xauth_tmp_t)
-+files_tmp_filetrans(xauth_t, xauth_tmp_t, { file dir })
-+
-+domain_use_interactive_fds(xauth_t)
-+
-+files_read_etc_files(xauth_t)
-+files_search_pids(xauth_t)
-+
-+fs_getattr_xattr_fs(xauth_t)
-+fs_search_auto_mountpoints(xauth_t)
-+
-+auth_use_nsswitch(xauth_t)
-+
-+libs_use_ld_so(xauth_t)
-+libs_use_shared_libs(xauth_t)
-+
-+files_search_pids(xauth_t)
-+rw_files_pattern(xauth_t, xdm_var_run_t, xdm_var_run_t)
-+
-+tunable_policy(`use_nfs_home_dirs',`
-+ fs_manage_nfs_files(xauth_t)
-+')
-+
-+tunable_policy(`use_samba_home_dirs',`
-+ fs_manage_cifs_files(xauth_t)
-+')
-+
-+optional_policy(`
-+ ssh_sigchld(xauth_t)
-+ ssh_read_pipes(xauth_t)
-+ ssh_dontaudit_rw_tcp_sockets(xauth_t)
-+')
-+
-+allow xdm_t iceauth_home_t:file read_file_perms;
-+
-+
-+# Hack to handle the problem of using the nvidia blobs
-+tunable_policy(`allow_execmem',`
-+ # Allow making anonymous memory executable, e.g.
-+ # for runtime-code generation or executable stack.
-+ allow xdm_t self:process execmem;
-+')
-+
-+tunable_policy(`allow_execstack',`
-+ # Allow making the stack executable via mprotect;
-+ # execstack implies execmem;
-+ allow xdm_t self:process { execstack execmem };
-+')
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/services/zebra.te serefpolicy-3.5.13/policy/modules/services/zebra.te
---- nsaserefpolicy/policy/modules/services/zebra.te 2008-10-16 17:21:16.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/services/zebra.te 2008-10-28 10:56:19.000000000 -0400
-@@ -41,7 +41,7 @@
- allow zebra_t self:capability { setgid setuid net_admin net_raw };
- dontaudit zebra_t self:capability sys_tty_config;
- allow zebra_t self:process { signal_perms getcap setcap };
--allow zebra_t self:file rw_file_perms;
-+allow zebra_t self:file { ioctl read write getattr lock append };
- allow zebra_t self:unix_dgram_socket create_socket_perms;
- allow zebra_t self:unix_stream_socket { connectto create_stream_socket_perms };
- allow zebra_t self:netlink_route_socket rw_netlink_socket_perms;
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/services/zosremote.fc serefpolicy-3.5.13/policy/modules/services/zosremote.fc
---- nsaserefpolicy/policy/modules/services/zosremote.fc 1969-12-31 19:00:00.000000000 -0500
-+++ serefpolicy-3.5.13/policy/modules/services/zosremote.fc 2008-10-28 10:56:19.000000000 -0400
-@@ -0,0 +1,2 @@
-+
-+/sbin/audispd-zos-remote -- gen_context(system_u:object_r:zos_remote_exec_t,s0)
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/services/zosremote.if serefpolicy-3.5.13/policy/modules/services/zosremote.if
---- nsaserefpolicy/policy/modules/services/zosremote.if 1969-12-31 19:00:00.000000000 -0500
-+++ serefpolicy-3.5.13/policy/modules/services/zosremote.if 2008-10-28 10:56:19.000000000 -0400
-@@ -0,0 +1,52 @@
-+## policy for z/OS Remote-services Audit dispatcher plugin
-+
-+########################################
-+##
-+## Execute a domain transition to run audispd-zos-remote.
-+##
-+##
-+##
-+## Domain allowed to transition.
-+##
-+##
-+#
-+interface(`zos_remote_domtrans',`
-+ gen_require(`
-+ type zos_remote_t;
-+ type zos_remote_exec_t;
-+ ')
-+
-+ domtrans_pattern($1, zos_remote_exec_t, zos_remote_t)
-+')
-+
-+########################################
-+##
-+## Allow specified type and role to transition and
-+## run in the zos_remote_t domain. Allow specified type
-+## to use zos_remote_t terminal.
-+##
-+##
-+##
-+## Domain allowed access
-+##
-+##
-+##
-+##
-+## The role to be allowed the zos_remote domain.
-+##
-+##
-+##
-+##
-+## The type of the role's terminal.
-+##
-+##
-+#
-+interface(`zos_remote_run',`
-+ gen_require(`
-+ type zos_remote_t;
-+ ')
-+
-+ zos_remote_domtrans($1)
-+ role $2 types zos_remote_t;
-+ dontaudit zos_remote_t $3:chr_file rw_term_perms;
-+')
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/services/zosremote.te serefpolicy-3.5.13/policy/modules/services/zosremote.te
---- nsaserefpolicy/policy/modules/services/zosremote.te 1969-12-31 19:00:00.000000000 -0500
-+++ serefpolicy-3.5.13/policy/modules/services/zosremote.te 2008-10-28 11:20:11.000000000 -0400
-@@ -0,0 +1,36 @@
-+policy_module(zosremote,1.0.0)
-+
-+########################################
-+#
-+# Declarations
-+#
-+
-+type zos_remote_t;
-+type zos_remote_exec_t;
-+logging_dispatcher_domain(zos_remote_t, zos_remote_exec_t)
-+
-+init_system_domain(zos_remote_t, zos_remote_exec_t)
-+
-+role system_r types zos_remote_t;
-+
-+
-+########################################
-+#
-+# zos_remote local policy
-+#
-+
-+allow zos_remote_t self:fifo_file rw_file_perms;
-+allow zos_remote_t self:unix_stream_socket create_stream_socket_perms;
-+
-+allow zos_remote_t self:process signal;
-+
-+files_read_etc_files(zos_remote_t)
-+
-+auth_use_nsswitch(zos_remote_t);
-+
-+libs_use_ld_so(zos_remote_t)
-+libs_use_shared_libs(zos_remote_t)
-+
-+miscfiles_read_localization(zos_remote_t)
-+
-+logging_send_syslog_msg(zos_remote_t)
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/application.te serefpolicy-3.5.13/policy/modules/system/application.te
---- nsaserefpolicy/policy/modules/system/application.te 2008-08-07 11:15:12.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/system/application.te 2008-10-28 10:56:19.000000000 -0400
-@@ -7,6 +7,12 @@
- # Executables to be run by user
- attribute application_exec_type;
-
-+unprivuser_append_home_content_files(application_domain_type)
-+unprivuser_write_tmp_files(application_domain_type)
-+logging_rw_all_logs(application_domain_type)
-+
-+files_dontaudit_search_all_dirs(application_domain_type)
-+
- optional_policy(`
- ssh_sigchld(application_domain_type)
- ssh_rw_stream_sockets(application_domain_type)
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/authlogin.fc serefpolicy-3.5.13/policy/modules/system/authlogin.fc
---- nsaserefpolicy/policy/modules/system/authlogin.fc 2008-08-07 11:15:12.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/system/authlogin.fc 2008-10-28 10:56:19.000000000 -0400
-@@ -7,12 +7,10 @@
- /etc/passwd\.lock -- gen_context(system_u:object_r:shadow_t,s0)
- /etc/shadow.* -- gen_context(system_u:object_r:shadow_t,s0)
-
--/lib/security/pam_krb5/pam_krb5_storetmp -- gen_context(system_u:object_r:pam_exec_t,s0)
--/lib64/security/pam_krb5/pam_krb5_storetmp -- gen_context(system_u:object_r:pam_exec_t,s0)
--
- /sbin/pam_console_apply -- gen_context(system_u:object_r:pam_console_exec_t,s0)
- /sbin/pam_timestamp_check -- gen_context(system_u:object_r:pam_exec_t,s0)
- /sbin/unix_chkpwd -- gen_context(system_u:object_r:chkpwd_exec_t,s0)
-+/usr/sbin/validate -- gen_context(system_u:object_r:chkpwd_exec_t,s0)
- /sbin/unix_update -- gen_context(system_u:object_r:updpwd_exec_t,s0)
- /sbin/unix_verify -- gen_context(system_u:object_r:chkpwd_exec_t,s0)
- ifdef(`distro_suse', `
-@@ -40,6 +38,10 @@
- /var/log/wtmp.* -- gen_context(system_u:object_r:wtmp_t,s0)
-
- /var/run/console(/.*)? gen_context(system_u:object_r:pam_var_console_t,s0)
--
- /var/run/pam_mount(/.*)? gen_context(system_u:object_r:pam_var_run_t,s0)
-+/var/run/sepermit(/.*)? gen_context(system_u:object_r:pam_var_run_t,s0)
-+
- /var/run/sudo(/.*)? gen_context(system_u:object_r:pam_var_run_t,s0)
-+/var/run/pam_ssh(/.*)? gen_context(system_u:object_r:var_auth_t,s0)
-+
-+/var/cache/coolkey(/.*)? gen_context(system_u:object_r:auth_cache_t,s0)
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/authlogin.if serefpolicy-3.5.13/policy/modules/system/authlogin.if
---- nsaserefpolicy/policy/modules/system/authlogin.if 2008-10-16 17:21:16.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/system/authlogin.if 2008-10-28 10:56:19.000000000 -0400
-@@ -56,10 +56,6 @@
- miscfiles_read_localization($1_chkpwd_t)
-
- seutil_read_config($1_chkpwd_t)
--
-- optional_policy(`
-- kerberos_use($1_chkpwd_t)
-- ')
- ')
-
- #######################################
-@@ -99,7 +95,7 @@
- template(`authlogin_per_role_template',`
-
- gen_require(`
-- type system_chkpwd_t, shadow_t;
-+ type system_chkpwd_t, shadow_t, updpwd_t;
- ')
-
- authlogin_common_auth_domain_template($1)
-@@ -169,6 +165,7 @@
- interface(`auth_login_pgm_domain',`
- gen_require(`
- type var_auth_t;
-+ type auth_cache_t;
- ')
-
- domain_type($1)
-@@ -177,12 +174,27 @@
- domain_obj_id_change_exemption($1)
- role system_r types $1;
-
-+ # Needed for pam_selinux_permit to cleanup properly
-+ domain_read_all_domains_state($1)
-+ domain_kill_all_domains($1)
-+
-+ # pam_keyring
-+ allow $1 self:capability ipc_lock;
-+ allow $1 self:process setkeycreate;
-+ allow $1 self:key manage_key_perms;
-+ userdom_manage_all_users_keys($1)
-+
- files_list_var_lib($1)
- manage_files_pattern($1, var_auth_t, var_auth_t)
-
- # needed for afs - https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=253321
- kernel_rw_afs_state($1)
-
-+ manage_dirs_pattern($1, auth_cache_t, auth_cache_t)
-+ manage_files_pattern($1, auth_cache_t, auth_cache_t)
-+ manage_sock_files_pattern($1, auth_cache_t, auth_cache_t)
-+ files_var_filetrans($1, auth_cache_t, dir)
-+
- # for SSP/ProPolice
- dev_read_urand($1)
- # for fingerprint readers
-@@ -216,6 +228,7 @@
- auth_rw_faillog($1)
- auth_exec_pam($1)
- auth_use_nsswitch($1)
-+ auth_manage_pam_pid($1)
-
- init_rw_utmp($1)
-
-@@ -226,8 +239,40 @@
- seutil_read_config($1)
- seutil_read_default_contexts($1)
-
-+ userdom_set_rlimitnh($1)
-+ userdom_read_all_users_home_content_symlinks($1)
-+ unprivuser_unlink_tmp_files($1)
-+ unprivuser_stream_connect($1)
-+
-+ optional_policy(`
-+ dbus_system_bus_client_template(notused, $1)
-+ optional_policy(`
-+ oddjob_dbus_chat($1)
-+ oddjob_domtrans_mkhomedir($1)
-+ ')
-+ ')
-+
-+ optional_policy(`
-+ corecmd_exec_bin($1)
-+ storage_getattr_fixed_disk_dev($1)
-+ mount_domtrans($1)
-+ ')
-+
-+ optional_policy(`
-+ nis_authenticate($1)
-+ ')
-+
-+ optional_policy(`
-+ ssh_agent_exec($1)
-+ userdom_read_all_users_home_content_files($1)
-+ ')
-+
- tunable_policy(`allow_polyinstantiation',`
- files_polyinstantiate_all($1)
-+ unprivuser_manage_home_content_dirs($1)
-+ unprivuser_manage_home_content_files($1)
-+ userdom_relabel_all_home_dirs($1)
-+ userdom_relabel_all_home_files($1)
- ')
- ')
-
-@@ -333,19 +378,15 @@
- dev_read_rand($1)
- dev_read_urand($1)
-
-+ auth_use_nsswitch($1)
-+
- logging_send_audit_msgs($1)
-
- miscfiles_read_certs($1)
-
-- sysnet_dns_name_resolve($1)
-- sysnet_use_ldap($1)
--
- optional_policy(`
-- kerberos_use($1)
-- ')
--
-- optional_policy(`
-- nis_use_ypbind($1)
-+ kerberos_read_keytab($1)
-+ kerberos_connect_524($1)
- ')
-
- optional_policy(`
-@@ -356,6 +397,28 @@
- optional_policy(`
- samba_stream_connect_winbind($1)
- ')
-+ auth_domtrans_upd_passwd($1)
-+')
-+
-+########################################
-+##
-+## Run unix_chkpwd to check a password.
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+#
-+interface(`auth_domtrans_chkpwd',`
-+ gen_require(`
-+ type system_chkpwd_t, chkpwd_exec_t, shadow_t;
-+ ')
-+
-+ corecmd_search_bin($1)
-+ domtrans_pattern($1, chkpwd_exec_t, system_chkpwd_t)
-+ dontaudit $1 shadow_t:file { getattr read };
-+ auth_domtrans_upd_passwd($1)
- ')
-
- ########################################
-@@ -369,12 +432,12 @@
- ##
- ##
- ##
--## The role to allow the chkpwd domain.
-+## The role to allow the updpwd domain.
- ##
- ##
- ##
- ##
--## The type of the terminal allow the chkpwd domain to use.
-+## The type of the terminal allow the updpwd domain to use.
- ##
- ##
- #
-@@ -386,6 +449,7 @@
- auth_domtrans_chk_passwd($1)
- role $2 types system_chkpwd_t;
- allow system_chkpwd_t $3:chr_file rw_file_perms;
-+ auth_run_upd_passwd($1, $2, $3)
- ')
-
- ########################################
-@@ -871,7 +935,7 @@
- files_search_var($1)
- allow $1 var_auth_t:dir manage_dir_perms;
- allow $1 var_auth_t:file rw_file_perms;
-- allow $1 var_auth_t:lnk_file rw_lnk_file_perms;
-+ allow $1 var_auth_t:lnk_file rw_file_perms;
- ')
-
- ########################################
-@@ -1447,6 +1511,10 @@
- ')
-
- optional_policy(`
-+ kerberos_use($1)
-+ ')
-+
-+ optional_policy(`
- nis_use_ypbind($1)
- ')
-
-@@ -1457,6 +1525,7 @@
- optional_policy(`
- samba_stream_connect_winbind($1)
- samba_read_var_files($1)
-+ samba_dontaudit_write_var_files($1)
- ')
- ')
-
-@@ -1491,3 +1560,59 @@
- typeattribute $1 can_write_shadow_passwords;
- typeattribute $1 can_relabelto_shadow_passwords;
- ')
-+
-+########################################
-+##
-+## Read authentication cache
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+##
-+#
-+interface(`auth_read_cache',`
-+ gen_require(`
-+ type auth_cache_t;
-+ ')
-+
-+ read_files_pattern($1, auth_cache_t, auth_cache_t)
-+')
-+
-+########################################
-+##
-+## Read/Write authentication cache
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+##
-+#
-+interface(`auth_rw_cache',`
-+ gen_require(`
-+ type auth_cache_t;
-+ ')
-+
-+ rw_files_pattern($1, auth_cache_t, auth_cache_t)
-+')
-+########################################
-+##
-+## Manage authentication cache
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+##
-+#
-+interface(`auth_manage_cache',`
-+ gen_require(`
-+ type auth_cache_t;
-+ ')
-+
-+ manage_files_pattern($1, auth_cache_t, auth_cache_t)
-+')
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/authlogin.te serefpolicy-3.5.13/policy/modules/system/authlogin.te
---- nsaserefpolicy/policy/modules/system/authlogin.te 2008-10-16 17:21:16.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/system/authlogin.te 2008-10-28 10:56:19.000000000 -0400
-@@ -59,6 +59,9 @@
- type utempter_exec_t;
- application_domain(utempter_t,utempter_exec_t)
-
-+type auth_cache_t;
-+logging_log_file(auth_cache_t)
-+
- #
- # var_auth_t is the type of /var/lib/auth, usually
- # used for auth data in pam_able
-@@ -73,6 +76,9 @@
- authlogin_common_auth_domain_template(system)
- role system_r types system_chkpwd_t;
-
-+# Read only version of updpwd
-+domain_entry_file(system_chkpwd_t, updpwd_exec_t)
-+
- ########################################
- #
- # PAM local policy
-@@ -111,7 +117,8 @@
- term_use_all_user_ttys(pam_t)
- term_use_all_user_ptys(pam_t)
-
--init_dontaudit_rw_utmp(pam_t)
-+init_read_utmp(pam_t)
-+init_dontaudit_write_utmp(pam_t)
-
- files_read_etc_files(pam_t)
-
-@@ -122,6 +129,12 @@
-
- userdom_use_unpriv_users_fds(pam_t)
-
-+userdom_write_unpriv_users_tmp_files(pam_t)
-+unprivuser_unlink_tmp_files(pam_t)
-+unprivuser_dontaudit_read_home_content_files(pam_t)
-+unprivuser_dontaudit_write_home_content_files(pam_t)
-+unprivuser_append_home_content_files(pam_t)
-+
- ifdef(`distro_ubuntu',`
- optional_policy(`
- unconfined_domain(pam_t)
-@@ -155,6 +168,8 @@
- dev_read_sysfs(pam_console_t)
- dev_getattr_apm_bios_dev(pam_console_t)
- dev_setattr_apm_bios_dev(pam_console_t)
-+dev_getattr_cpu_dev(pam_console_t)
-+dev_setattr_cpu_dev(pam_console_t)
- dev_getattr_dri_dev(pam_console_t)
- dev_setattr_dri_dev(pam_console_t)
- dev_getattr_input_dev(pam_console_t)
-@@ -179,6 +194,10 @@
- dev_setattr_video_dev(pam_console_t)
- dev_getattr_xserver_misc_dev(pam_console_t)
- dev_setattr_xserver_misc_dev(pam_console_t)
-+
-+dev_getattr_all_chr_files(pam_console_t)
-+dev_setattr_all_chr_files(pam_console_t)
-+
- dev_read_urand(pam_console_t)
-
- mls_file_read_all_levels(pam_console_t)
-@@ -283,6 +302,11 @@
- ')
- ')
-
-+optional_policy(`
-+ # apache leaks file descriptors
-+ apache_dontaudit_rw_tcp_sockets(system_chkpwd_t)
-+')
-+
- ########################################
- #
- # updpwd local policy
-@@ -298,8 +322,10 @@
- files_manage_etc_files(updpwd_t)
-
- term_dontaudit_use_console(updpwd_t)
--term_dontaudit_use_console(updpwd_t)
-+term_dontaudit_use_all_user_ptys(updpwd_t)
-+term_dontaudit_use_all_user_ttys(updpwd_t)
- term_dontaudit_use_unallocated_ttys(updpwd_t)
-+term_dontaudit_use_generic_ptys(updpwd_t)
-
- auth_manage_shadow(updpwd_t)
- auth_use_nsswitch(updpwd_t)
-@@ -360,11 +386,6 @@
- ')
-
- optional_policy(`
-- # Allow utemper to write to /tmp/.xses-*
-- unconfined_write_tmp_files(utempter_t)
--')
--
--optional_policy(`
- xserver_use_xdm_fds(utempter_t)
- xserver_rw_xdm_pipes(utempter_t)
- ')
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/fstools.fc serefpolicy-3.5.13/policy/modules/system/fstools.fc
---- nsaserefpolicy/policy/modules/system/fstools.fc 2008-08-07 11:15:12.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/system/fstools.fc 2008-10-28 10:56:19.000000000 -0400
-@@ -1,4 +1,3 @@
--/sbin/badblocks -- gen_context(system_u:object_r:fsadm_exec_t,s0)
- /sbin/blkid -- gen_context(system_u:object_r:fsadm_exec_t,s0)
- /sbin/blockdev -- gen_context(system_u:object_r:fsadm_exec_t,s0)
- /sbin/cfdisk -- gen_context(system_u:object_r:fsadm_exec_t,s0)
-@@ -21,7 +20,6 @@
- /sbin/mkfs.* -- gen_context(system_u:object_r:fsadm_exec_t,s0)
- /sbin/mkraid -- gen_context(system_u:object_r:fsadm_exec_t,s0)
- /sbin/mkreiserfs -- gen_context(system_u:object_r:fsadm_exec_t,s0)
--/sbin/mkswap -- gen_context(system_u:object_r:fsadm_exec_t,s0)
- /sbin/parted -- gen_context(system_u:object_r:fsadm_exec_t,s0)
- /sbin/partprobe -- gen_context(system_u:object_r:fsadm_exec_t,s0)
- /sbin/partx -- gen_context(system_u:object_r:fsadm_exec_t,s0)
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/fstools.te serefpolicy-3.5.13/policy/modules/system/fstools.te
---- nsaserefpolicy/policy/modules/system/fstools.te 2008-10-14 11:58:09.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/system/fstools.te 2008-10-28 10:56:19.000000000 -0400
-@@ -97,6 +97,10 @@
- fs_getattr_tmpfs_dirs(fsadm_t)
- fs_read_tmpfs_symlinks(fsadm_t)
-
-+fs_manage_nfs_files(fsadm_t)
-+
-+fs_manage_cifs_files(fsadm_t)
-+
- mls_file_read_all_levels(fsadm_t)
- mls_file_write_all_levels(fsadm_t)
-
-@@ -184,4 +188,9 @@
-
- optional_policy(`
- xen_append_log(fsadm_t)
-+ xen_rw_image_files(fsadm_t)
-+')
-+
-+optional_policy(`
-+ unconfined_domain(fsadm_t)
- ')
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/hostname.te serefpolicy-3.5.13/policy/modules/system/hostname.te
---- nsaserefpolicy/policy/modules/system/hostname.te 2008-08-07 11:15:12.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/system/hostname.te 2008-10-28 10:56:19.000000000 -0400
-@@ -8,7 +8,9 @@
-
- type hostname_t;
- type hostname_exec_t;
--init_system_domain(hostname_t,hostname_exec_t)
-+
-+#dont transition from initrc
-+application_domain(hostname_t, hostname_exec_t)
- role system_r types hostname_t;
-
- ########################################
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/init.fc serefpolicy-3.5.13/policy/modules/system/init.fc
---- nsaserefpolicy/policy/modules/system/init.fc 2008-08-07 11:15:12.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/system/init.fc 2008-10-28 10:56:19.000000000 -0400
-@@ -4,8 +4,7 @@
- /etc/init\.d/.* -- gen_context(system_u:object_r:initrc_exec_t,s0)
-
- /etc/rc\.d/rc -- gen_context(system_u:object_r:initrc_exec_t,s0)
--/etc/rc\.d/rc\.sysinit -- gen_context(system_u:object_r:initrc_exec_t,s0)
--/etc/rc\.d/rc\.local -- gen_context(system_u:object_r:initrc_exec_t,s0)
-+/etc/rc\.d/rc\.[^/]+ -- gen_context(system_u:object_r:initrc_exec_t,s0)
-
- /etc/rc\.d/init\.d/.* -- gen_context(system_u:object_r:initrc_exec_t,s0)
-
-@@ -46,6 +45,8 @@
- /usr/sbin/apachectl -- gen_context(system_u:object_r:initrc_exec_t,s0)
- /usr/sbin/open_init_pty -- gen_context(system_u:object_r:initrc_exec_t,s0)
-
-+/usr/share/system-config-services/system-config-services-mechanism\.py -- gen_context(system_u:object_r:initrc_exec_t,s0)
-+
- #
- # /var
- #
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/init.if serefpolicy-3.5.13/policy/modules/system/init.if
---- nsaserefpolicy/policy/modules/system/init.if 2008-10-16 17:21:16.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/system/init.if 2008-10-28 10:56:19.000000000 -0400
-@@ -278,6 +278,27 @@
- kernel_dontaudit_use_fds($1)
- ')
- ')
-+
-+ sysadm_dontaudit_search_home_dirs($1)
-+
-+ tunable_policy(`allow_daemons_use_tty',`
-+ term_use_all_user_ttys($1)
-+ term_use_all_user_ptys($1)
-+ ',`
-+ term_dontaudit_use_all_user_ttys($1)
-+ term_dontaudit_use_all_user_ptys($1)
-+ ')
-+
-+ # these apps are often redirect output to random log files
-+ logging_rw_all_logs($1)
-+
-+ optional_policy(`
-+ cron_rw_pipes($1)
-+ ')
-+
-+ optional_policy(`
-+ xserver_rw_xdm_home_files($1)
-+ ')
- ')
-
- ########################################
-@@ -617,18 +638,19 @@
- #
- interface(`init_spec_domtrans_script',`
- gen_require(`
-- type initrc_t, initrc_exec_t;
-+ type initrc_t;
-+ attribute init_script_file_type;
- ')
-
- files_list_etc($1)
-- spec_domtrans_pattern($1,initrc_exec_t,initrc_t)
-+ spec_domtrans_pattern($1, init_script_file_type, initrc_t)
-
- ifdef(`enable_mcs',`
-- range_transition $1 initrc_exec_t:process s0;
-+ range_transition $1 init_script_file_type:process s0;
- ')
-
- ifdef(`enable_mls',`
-- range_transition $1 initrc_exec_t:process s0 - mls_systemhigh;
-+ range_transition $1 init_script_file_type:process s0 - mls_systemhigh;
- ')
- ')
-
-@@ -644,23 +666,43 @@
- #
- interface(`init_domtrans_script',`
- gen_require(`
-- type initrc_t, initrc_exec_t;
-+ type initrc_t;
-+ attribute init_script_file_type;
- ')
-
- files_list_etc($1)
-- domtrans_pattern($1,initrc_exec_t,initrc_t)
-+ domtrans_pattern($1, init_script_file_type, initrc_t)
-
- ifdef(`enable_mcs',`
-- range_transition $1 initrc_exec_t:process s0;
-+ range_transition $1 init_script_file_type:process s0;
- ')
-
- ifdef(`enable_mls',`
-- range_transition $1 initrc_exec_t:process s0 - mls_systemhigh;
-+ range_transition $1 init_script_file_type:process s0 - mls_systemhigh;
- ')
- ')
-
- ########################################
- ##
-+## Execute a file in a bin directory
-+## in the initrc_t domain
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+#
-+interface(`init_bin_domtrans_spec',`
-+ gen_require(`
-+ type initrc_t;
-+ ')
-+
-+ corecmd_bin_domtrans($1, initrc_t)
-+')
-+
-+########################################
-+##
- ## Execute a init script in a specified domain.
- ##
- ##
-@@ -774,7 +816,7 @@
-
- allow $1 init_t:dir search_dir_perms;
- allow $1 init_t:file read_file_perms;
-- allow $1 init_t:lnk_file read_lnk_file_perms;
-+ allow $1 init_t:lnk_file read_file_perms;
- ')
-
- ########################################
-@@ -1296,6 +1338,25 @@
-
- ########################################
- ##
-+## Read init script temporary data.
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+#
-+interface(`init_read_script_tmp_files',`
-+ gen_require(`
-+ type initrc_tmp_t;
-+ ')
-+
-+ files_search_tmp($1)
-+ read_files_pattern($1, initrc_tmp_t, initrc_tmp_t)
-+')
-+
-+########################################
-+##
- ## Create files in a init script
- ## temporary data directory.
- ##
-@@ -1451,7 +1512,7 @@
- type initrc_var_run_t;
- ')
-
-- dontaudit $1 initrc_var_run_t:file { getattr read write append };
-+ dontaudit $1 initrc_var_run_t:file rw_file_perms;
- ')
-
- ########################################
-@@ -1507,3 +1568,51 @@
- ')
- corenet_udp_recvfrom_labeled($1, daemon)
- ')
-+
-+########################################
-+##
-+## Transition to system_r when execute an init script
-+##
-+##
-+##
-+## Execute a init script in a specified role
-+##
-+##
-+## No interprocess communication (signals, pipes,
-+## etc.) is provided by this interface since
-+## the domains are not owned by this module.
-+##
-+##
-+##
-+##
-+## Role to transition from.
-+##
-+##
-+#
-+interface(`init_script_role_transition',`
-+ gen_require(`
-+ attribute init_script_file_type;
-+ ')
-+
-+ role_transition $1 init_script_file_type system_r;
-+')
-+
-+########################################
-+##
-+## Send and receive unix_stream_messages with
-+## init
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+#
-+interface(`init_chat',`
-+ gen_require(`
-+ type init_t;
-+ ')
-+
-+ allow $1 init_t:unix_dgram_socket sendto;
-+ allow init_t $1:unix_dgram_socket sendto;
-+')
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/init.te serefpolicy-3.5.13/policy/modules/system/init.te
---- nsaserefpolicy/policy/modules/system/init.te 2008-10-14 11:58:09.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/system/init.te 2008-10-29 14:03:43.000000000 -0400
-@@ -17,6 +17,20 @@
- ##
- gen_tunable(init_upstart,false)
-
-+##
-+##
-+## Allow all daemons the ability to read/write terminals
-+##
-+##
-+gen_tunable(allow_daemons_use_tty, false)
-+
-+##
-+##
-+## Allow all daemons to write corefiles to /
-+##
-+##
-+gen_tunable(allow_daemons_dump_core, false)
-+
- # used for direct running of init scripts
- # by admin domains
- attribute direct_run_init;
-@@ -88,7 +102,7 @@
- #
-
- # Use capabilities. old rule:
--allow init_t self:capability ~sys_module;
-+allow init_t self:capability ~{ audit_control audit_write sys_module };
- # is ~sys_module really needed? observed:
- # sys_boot
- # sys_tty_config
-@@ -101,7 +115,7 @@
- # Re-exec itself
- can_exec(init_t,init_exec_t)
-
--allow init_t initrc_t:unix_stream_socket connectto;
-+allow init_t initrc_t:unix_stream_socket { connectto rw_stream_socket_perms };
-
- # For /var/run/shutdown.pid.
- allow init_t init_var_run_t:file manage_file_perms;
-@@ -117,6 +131,8 @@
- kernel_read_system_state(init_t)
- kernel_share_state(init_t)
-
-+fs_list_inotifyfs(init_t)
-+
- corecmd_exec_chroot(init_t)
- corecmd_exec_bin(init_t)
-
-@@ -169,6 +185,8 @@
-
- miscfiles_read_localization(init_t)
-
-+allow init_t self:process setsched;
-+
- ifdef(`distro_gentoo',`
- allow init_t self:process { getcap setcap };
- ')
-@@ -191,6 +209,14 @@
- ')
-
- optional_policy(`
-+ # /var/run/dovecot/login/ssl-parameters.dat is a hard link to
-+ # /var/lib/dovecot/ssl-parameters.dat and init tries to clean up
-+ # the directory. But we do not want to allow this.
-+ # The master process of dovecot will manage this file.
-+ dovecot_dontaudit_unlink_lib_files(initrc_t)
-+')
-+
-+optional_policy(`
- nscd_socket_use(init_t)
- ')
-
-@@ -204,9 +230,10 @@
- #
-
- allow initrc_t self:process { getpgid setsched setpgid setrlimit getsched };
--allow initrc_t self:capability ~{ sys_admin sys_module };
-+allow initrc_t self:capability ~{ audit_control audit_write sys_admin sys_module };
- dontaudit initrc_t self:capability sys_module; # sysctl is triggering this
- allow initrc_t self:passwd rootok;
-+allow initrc_t self:key { search };
-
- # Allow IPC with self
- allow initrc_t self:unix_dgram_socket create_socket_perms;
-@@ -219,7 +246,8 @@
- term_create_pty(initrc_t,initrc_devpts_t)
-
- # Going to single user mode
--init_exec(initrc_t)
-+init_telinit(initrc_t)
-+init_chat(initrc_t)
-
- can_exec(initrc_t, init_script_file_type)
-
-@@ -232,6 +260,7 @@
-
- allow initrc_t initrc_var_run_t:file manage_file_perms;
- files_pid_filetrans(initrc_t,initrc_var_run_t,file)
-+files_manage_generic_pids_symlinks(initrc_t)
-
- can_exec(initrc_t,initrc_tmp_t)
- allow initrc_t initrc_tmp_t:file manage_file_perms;
-@@ -253,6 +282,7 @@
- kernel_dontaudit_getattr_message_if(initrc_t)
-
- files_read_kernel_symbol_table(initrc_t)
-+files_exec_etc_files(initrc_t)
-
- corenet_all_recvfrom_unlabeled(initrc_t)
- corenet_all_recvfrom_netlabel(initrc_t)
-@@ -276,7 +306,7 @@
- dev_read_sound_mixer(initrc_t)
- dev_write_sound_mixer(initrc_t)
- dev_setattr_all_chr_files(initrc_t)
--dev_read_lvm_control(initrc_t)
-+dev_rw_lvm_control(initrc_t)
- dev_delete_lvm_control_dev(initrc_t)
- dev_manage_generic_symlinks(initrc_t)
- dev_manage_generic_files(initrc_t)
-@@ -330,7 +360,7 @@
- domain_sigchld_all_domains(initrc_t)
- domain_read_all_domains_state(initrc_t)
- domain_getattr_all_domains(initrc_t)
--domain_dontaudit_ptrace_all_domains(initrc_t)
-+domain_ptrace_all_domains(initrc_t)
- domain_getsession_all_domains(initrc_t)
- domain_use_interactive_fds(initrc_t)
- # for lsof which is used by alsa shutdown:
-@@ -371,6 +401,7 @@
- libs_use_shared_libs(initrc_t)
- libs_exec_lib_files(initrc_t)
-
-+logging_send_audit_msgs(initrc_t)
- logging_send_syslog_msg(initrc_t)
- logging_manage_generic_logs(initrc_t)
- logging_read_all_logs(initrc_t)
-@@ -503,6 +534,7 @@
- optional_policy(`
- #for /etc/rc.d/init.d/nfs to create /etc/exports
- rpc_write_exports(initrc_t)
-+ rpc_manage_nfs_state_data(initrc_t)
- ')
-
- optional_policy(`
-@@ -521,6 +553,31 @@
- ')
- ')
-
-+domain_dontaudit_use_interactive_fds(daemon)
-+
-+sysadm_dontaudit_search_home_dirs(daemon)
-+
-+tunable_policy(`allow_daemons_use_tty',`
-+ term_use_unallocated_ttys(daemon)
-+ term_use_generic_ptys(daemon)
-+ term_use_all_user_ttys(daemon)
-+ term_use_all_user_ptys(daemon)
-+',`
-+ term_dontaudit_use_unallocated_ttys(daemon)
-+ term_dontaudit_use_generic_ptys(daemon)
-+ term_dontaudit_use_all_user_ttys(daemon)
-+ term_dontaudit_use_all_user_ptys(daemon)
-+ ')
-+
-+# system-config-services causes avc messages that should be dontaudited
-+tunable_policy(`allow_daemons_dump_core',`
-+ files_dump_core(daemon)
-+')
-+
-+optional_policy(`
-+ unconfined_dontaudit_rw_pipes(daemon)
-+')
-+
- optional_policy(`
- amavis_search_lib(initrc_t)
- amavis_setattr_pid_files(initrc_t)
-@@ -575,6 +632,10 @@
- dbus_read_config(initrc_t)
-
- optional_policy(`
-+ consolekit_dbus_chat(initrc_t)
-+ ')
-+
-+ optional_policy(`
- networkmanager_dbus_chat(initrc_t)
- ')
- ')
-@@ -660,12 +721,6 @@
- mta_read_config(initrc_t)
- mta_dontaudit_read_spool_symlinks(initrc_t)
- ')
--# cjp: require doesnt work in the else of optionals :\
--# this also would result in a type transition
--# conflict if sendmail is enabled
--#optional_policy(`',`
--# mta_send_mail(initrc_t)
--#')
-
- optional_policy(`
- ifdef(`distro_redhat',`
-@@ -726,6 +781,9 @@
-
- # why is this needed:
- rpm_manage_db(initrc_t)
-+ # Allow SELinux aware applications to request rpm_script_t execution
-+ rpm_transition_script(initrc_t)
-+
- ')
-
- optional_policy(`
-@@ -738,10 +796,12 @@
- squid_manage_logs(initrc_t)
- ')
-
-+ifdef(`enabled_mls',`
- optional_policy(`
- # allow init scripts to su
- su_restricted_domain_template(initrc,initrc_t,system_r)
- ')
-+')
-
- optional_policy(`
- ssh_dontaudit_read_server_keys(initrc_t)
-@@ -759,6 +819,11 @@
- uml_setattr_util_sockets(initrc_t)
- ')
-
-+# Cron jobs used to start and stop services
-+optional_policy(`
-+ cron_rw_pipes(daemon)
-+')
-+
- optional_policy(`
- unconfined_domain(initrc_t)
-
-@@ -773,6 +838,10 @@
- ')
-
- optional_policy(`
-+ rpm_dontaudit_rw_pipes(daemon)
-+')
-+
-+optional_policy(`
- vmware_read_system_config(initrc_t)
- vmware_append_system_config(initrc_t)
- ')
-@@ -795,3 +864,11 @@
- optional_policy(`
- zebra_read_config(initrc_t)
- ')
-+
-+unprivuser_append_home_content_files(daemon)
-+unprivuser_write_tmp_files(daemon)
-+logging_append_all_logs(daemon)
-+
-+optional_policy(`
-+ xserver_rw_xdm_home_files(daemon)
-+')
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/ipsec.fc serefpolicy-3.5.13/policy/modules/system/ipsec.fc
---- nsaserefpolicy/policy/modules/system/ipsec.fc 2008-08-07 11:15:12.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/system/ipsec.fc 2008-11-05 10:40:04.000000000 -0500
-@@ -26,6 +26,7 @@
- /usr/local/lib(64)?/ipsec/pluto -- gen_context(system_u:object_r:ipsec_exec_t,s0)
- /usr/local/lib(64)?/ipsec/spi -- gen_context(system_u:object_r:ipsec_exec_t,s0)
-
-+/usr/sbin/ipsec -- gen_context(system_u:object_r:ipsec_mgmt_exec_t,s0)
- /usr/sbin/racoon -- gen_context(system_u:object_r:racoon_exec_t,s0)
- /usr/sbin/setkey -- gen_context(system_u:object_r:setkey_exec_t,s0)
-
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/ipsec.te serefpolicy-3.5.13/policy/modules/system/ipsec.te
---- nsaserefpolicy/policy/modules/system/ipsec.te 2008-10-16 17:21:16.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/system/ipsec.te 2008-10-28 10:56:19.000000000 -0400
-@@ -55,11 +55,12 @@
-
- allow ipsec_t self:capability { net_admin dac_override dac_read_search };
- dontaudit ipsec_t self:capability sys_tty_config;
--allow ipsec_t self:process signal;
--allow ipsec_t self:netlink_route_socket r_netlink_socket_perms;
-+allow ipsec_t self:process { signal setsched };
- allow ipsec_t self:tcp_socket create_stream_socket_perms;
--allow ipsec_t self:key_socket { create write read setopt };
--allow ipsec_t self:fifo_file read_file_perms;
-+allow ipsec_t self:udp_socket create_socket_perms;
-+allow ipsec_t self:key_socket create_socket_perms;
-+allow ipsec_t self:fifo_file read_fifo_file_perms;
-+allow ipsec_t self:netlink_xfrm_socket { create_netlink_socket_perms nlmsg_write };
-
- allow ipsec_t ipsec_conf_file_t:dir list_dir_perms;
- read_files_pattern(ipsec_t,ipsec_conf_file_t,ipsec_conf_file_t)
-@@ -104,6 +105,11 @@
- corenet_tcp_bind_all_nodes(ipsec_t)
- corenet_tcp_bind_reserved_port(ipsec_t)
- corenet_tcp_bind_isakmp_port(ipsec_t)
-+
-+corenet_udp_bind_all_nodes(ipsec_t)
-+corenet_udp_bind_isakmp_port(ipsec_t)
-+corenet_udp_bind_ipsecnat_port(ipsec_t)
-+
- corenet_sendrecv_generic_server_packets(ipsec_t)
- corenet_sendrecv_isakmp_server_packets(ipsec_t)
-
-@@ -127,6 +133,8 @@
- init_use_fds(ipsec_t)
- init_use_script_ptys(ipsec_t)
-
-+auth_use_nsswitch(ipsec_t)
-+
- libs_use_ld_so(ipsec_t)
- libs_use_shared_libs(ipsec_t)
-
-@@ -134,17 +142,11 @@
-
- miscfiles_read_localization(ipsec_t)
-
--sysnet_read_config(ipsec_t)
--
- userdom_dontaudit_use_unpriv_user_fds(ipsec_t)
-
- sysadm_dontaudit_search_home_dirs(ipsec_t)
-
- optional_policy(`
-- nis_use_ypbind(ipsec_t)
--')
--
--optional_policy(`
- seutil_sigchld_newrole(ipsec_t)
- ')
-
-@@ -160,9 +162,9 @@
- allow ipsec_mgmt_t self:capability { net_admin sys_tty_config dac_override dac_read_search };
- allow ipsec_mgmt_t self:process { signal setrlimit };
- allow ipsec_mgmt_t self:unix_stream_socket create_stream_socket_perms;
--allow ipsec_mgmt_t self:tcp_socket create_socket_perms;
-+allow ipsec_mgmt_t self:tcp_socket create_stream_socket_perms;
- allow ipsec_mgmt_t self:udp_socket create_socket_perms;
--allow ipsec_mgmt_t self:key_socket { create setopt };
-+allow ipsec_mgmt_t self:key_socket create_socket_perms;
- allow ipsec_mgmt_t self:fifo_file rw_file_perms;
-
- allow ipsec_mgmt_t ipsec_mgmt_lock_t:file manage_file_perms;
-@@ -171,6 +173,8 @@
- allow ipsec_mgmt_t ipsec_mgmt_var_run_t:file manage_file_perms;
- files_pid_filetrans(ipsec_mgmt_t,ipsec_mgmt_var_run_t,file)
-
-+logging_send_syslog_msg(ipsec_mgmt_t)
-+
- manage_files_pattern(ipsec_mgmt_t,ipsec_var_run_t,ipsec_var_run_t)
- manage_lnk_files_pattern(ipsec_mgmt_t,ipsec_var_run_t,ipsec_var_run_t)
-
-@@ -226,6 +230,7 @@
- # the ipsec wrapper wants to run /usr/bin/logger (should we put
- # it in its own domain?)
- corecmd_exec_bin(ipsec_mgmt_t)
-+corecmd_exec_shell(ipsec_mgmt_t)
-
- domain_use_interactive_fds(ipsec_mgmt_t)
- # denials when ps tries to search /proc. Do not audit these denials.
-@@ -283,7 +288,7 @@
- allow racoon_t self:unix_dgram_socket { connect create ioctl write };
- allow racoon_t self:netlink_selinux_socket { bind create read };
- allow racoon_t self:udp_socket create_socket_perms;
--allow racoon_t self:key_socket { create read setopt write };
-+allow racoon_t self:key_socket create_socket_perms;
-
- # manage pid file
- manage_files_pattern(racoon_t,ipsec_var_run_t,ipsec_var_run_t)
-@@ -305,6 +310,7 @@
- corenet_tcp_bind_all_nodes(racoon_t)
- corenet_udp_bind_all_nodes(racoon_t)
- corenet_udp_bind_isakmp_port(racoon_t)
-+corenet_udp_sendrecv_all_if(racoon_t)
- corenet_udp_bind_ipsecnat_port(racoon_t)
-
- dev_read_urand(racoon_t)
-@@ -319,6 +325,8 @@
-
- ipsec_setcontext_default_spd(racoon_t)
-
-+auth_use_nsswitch(racoon_t)
-+
- libs_use_ld_so(racoon_t)
- libs_use_shared_libs(racoon_t)
-
-@@ -335,7 +343,7 @@
- #
-
- allow setkey_t self:capability net_admin;
--allow setkey_t self:key_socket { create read setopt write };
-+allow setkey_t self:key_socket create_socket_perms;
- allow setkey_t self:netlink_route_socket create_netlink_socket_perms;
-
- allow setkey_t ipsec_conf_file_t:dir list_dir_perms;
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/iscsi.te serefpolicy-3.5.13/policy/modules/system/iscsi.te
---- nsaserefpolicy/policy/modules/system/iscsi.te 2008-10-16 17:21:16.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/system/iscsi.te 2008-10-28 10:56:19.000000000 -0400
-@@ -28,7 +28,7 @@
- # iscsid local policy
- #
-
--allow iscsid_t self:capability { dac_override ipc_lock net_admin sys_nice sys_resource };
-+allow iscsid_t self:capability { dac_override ipc_lock net_admin net_raw sys_admin sys_nice sys_resource };
- allow iscsid_t self:process { setrlimit setsched signal };
- allow iscsid_t self:fifo_file rw_fifo_file_perms;
- allow iscsid_t self:unix_stream_socket { create_stream_socket_perms connectto };
-@@ -39,7 +39,7 @@
- allow iscsid_t self:netlink_route_socket rw_netlink_socket_perms;
- allow iscsid_t self:tcp_socket create_stream_socket_perms;
-
--allow iscsid_t iscsi_lock_t:file manage_file_perms;
-+manage_files_pattern(iscsid_t, iscsi_lock_t, iscsi_lock_t)
- files_lock_filetrans(iscsid_t,iscsi_lock_t,file)
-
- allow iscsid_t iscsi_tmp_t:dir manage_dir_perms;
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/libraries.fc serefpolicy-3.5.13/policy/modules/system/libraries.fc
---- nsaserefpolicy/policy/modules/system/libraries.fc 2008-08-13 15:24:56.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/system/libraries.fc 2008-11-05 11:29:07.000000000 -0500
-@@ -60,12 +60,15 @@
- #
- # /opt
- #
-+/opt/.*\.so gen_context(system_u:object_r:lib_t,s0)
- /opt/(.*/)?lib(/.*)? gen_context(system_u:object_r:lib_t,s0)
- /opt/(.*/)?lib64(/.*)? gen_context(system_u:object_r:lib_t,s0)
- /opt/(.*/)?java/.+\.jar -- gen_context(system_u:object_r:lib_t,s0)
- /opt/(.*/)?jre.*/.+\.so(\.[^/]*)* -- gen_context(system_u:object_r:textrel_shlib_t,s0)
- /opt/(.*/)?jre/.+\.jar -- gen_context(system_u:object_r:lib_t,s0)
-
-+/opt/Acrobat[5-9]/Reader/intellinux/plugins/.*\.api -- gen_context(system_u:object_r:lib_t,s0)
-+
- ifdef(`distro_gentoo',`
- # despite the extensions, they are actually libs
- /opt/Acrobat[5-9]/Reader/intellinux/plug_ins/.*\.api -- gen_context(system_u:object_r:lib_t,s0)
-@@ -84,7 +87,8 @@
-
- ifdef(`distro_redhat',`
- /opt/Adobe(/.*?)/nppdf\.so -- gen_context(system_u:object_r:textrel_shlib_t,s0)
--/opt/Adobe/Reader8/Reader/intellinux/plug_ins/.*\.api -- gen_context(system_u:object_r:textrel_shlib_t,s0)
-+/opt/Adobe/Reader.?/Reader/intellinux/plug_ins/.*\.api -- gen_context(system_u:object_r:textrel_shlib_t,s0)
-+/opt/Adobe/Reader.?/Reader/intellinux/SPPlugins/.*\.ap[il] -- gen_context(system_u:object_r:lib_t,s0)
- /opt/cisco-vpnclient/lib/libvpnapi\.so -- gen_context(system_u:object_r:textrel_shlib_t,s0)
- /opt/cxoffice/lib/wine/.+\.so -- gen_context(system_u:object_r:textrel_shlib_t,s0)
- /opt/f-secure/fspms/libexec/librapi\.so(\.[^/]*)* -- gen_context(system_u:object_r:textrel_shlib_t,s0)
-@@ -115,9 +119,17 @@
-
- /usr/(.*/)?nvidia/.+\.so(\..*)? -- gen_context(system_u:object_r:textrel_shlib_t,s0)
-
-+/usr/lib/vlc/video_chroma/libi420_rgb_mmx_plugin\.so -- gen_context(system_u:object_r:textrel_shlib_t,s0)
-+/usr/lib/vlc/codec/librealvideo_plugin\.so -- gen_context(system_u:object_r:textrel_shlib_t,s0)
- /usr/lib/vlc/codec/libdmo_plugin\.so -- gen_context(system_u:object_r:textrel_shlib_t,s0)
- /usr/lib/vlc/codec/librealaudio_plugin\.so -- gen_context(system_u:object_r:textrel_shlib_t,s0)
-
-+/usr/lib64/vlc/codec/librealvideo_plugin\.so -- gen_context(system_u:object_r:textrel_shlib_t,s0)
-+/usr/lib64/vlc/codec/libdmo_plugin\.so -- gen_context(system_u:object_r:textrel_shlib_t,s0)
-+/usr/lib64/vlc/codec/librealaudio_plugin\.so -- gen_context(system_u:object_r:textrel_shlib_t,s0)
-+
-+/usr/lib(64)?/libavfilter\.so(\..*)? -- gen_context(system_u:object_r:textrel_shlib_t,s0)
-+
- /usr/(.*/)?lib(64)?(/.*)?/nvidia/.+\.so(\..*)? -- gen_context(system_u:object_r:textrel_shlib_t,s0)
- /usr/lib(64)?(/.*)?/nvidia/.+\.so(\..*)? -- gen_context(system_u:object_r:textrel_shlib_t,s0)
- /usr/lib(64)?/libsipphoneapi\.so.* -- gen_context(system_u:object_r:textrel_shlib_t,s0)
-@@ -133,6 +145,7 @@
- /usr/lib(64)?/nvidia-graphics(-[^/]*/)?libnvidia.*\.so(\.[^/]*)* -- gen_context(system_u:object_r:textrel_shlib_t,s0)
- /usr/lib(64)?/nvidia-graphics(-[^/]*/)?libXvMCNVIDIA\.so.* -- gen_context(system_u:object_r:textrel_shlib_t,s0)
- /usr/lib(64)?/xorg/libGL\.so(\.[^/]*)* -- gen_context(system_u:object_r:textrel_shlib_t,s0)
-+/usr/lib(64)?/xorg/modules/glesx\.so(\.[^/]*)* -- gen_context(system_u:object_r:textrel_shlib_t,s0)
- /usr/lib(64)?/xulrunner-[^/]*/libgtkembedmoz\.so -- gen_context(system_u:object_r:textrel_shlib_t,s0)
- /usr/lib(64)?/xulrunner-[^/]*/libxul\.so -- gen_context(system_u:object_r:textrel_shlib_t,s0)
-
-@@ -168,7 +181,8 @@
- # Fedora Core packages: gstreamer-plugins, compat-libstdc++, Glide3, libdv
- # HelixPlayer, SDL, xorg-x11, xorg-x11-libs, Hermes, valgrind, openoffice.org-libs, httpd - php
- /usr/lib(64)?/gstreamer-.*/[^/]*\.so.* -- gen_context(system_u:object_r:textrel_shlib_t,s0)
--HOME_DIR/.*/\.gstreamer-.*/plugins/*\.so.* -- gen_context(system_u:object_r:textrel_shlib_t,s0)
-+HOME_DIR/\.gstreamer-.*/plugins/.*\.so.* -- gen_context(system_u:object_r:textrel_shlib_t,s0)
-+HOME_DIR/.*/plugins/nppdf\.so.* -- gen_context(system_u:object_r:textrel_shlib_t,s0)
-
- /usr/lib/firefox-[^/]*/plugins/nppdf.so -- gen_context(system_u:object_r:textrel_shlib_t,s0)
- /usr/lib/libFLAC\.so.* -- gen_context(system_u:object_r:textrel_shlib_t,s0)
-@@ -187,6 +201,7 @@
- /usr/lib(64)?/libdv\.so.* -- gen_context(system_u:object_r:textrel_shlib_t,s0)
- /usr/lib(64)?/helix/plugins/[^/]*\.so -- gen_context(system_u:object_r:textrel_shlib_t,s0)
- /usr/lib(64)?/helix/codecs/[^/]*\.so -- gen_context(system_u:object_r:textrel_shlib_t,s0)
-+/usr/lib(64)?/libswscale\.so.* -- gen_context(system_u:object_r:textrel_shlib_t,s0)
- /usr/lib(64)?/libSDL-.*\.so.* -- gen_context(system_u:object_r:textrel_shlib_t,s0)
- /usr/lib(64)?/xorg/modules/dri/.+\.so -- gen_context(system_u:object_r:textrel_shlib_t,s0)
- /usr/X11R6/lib/modules/dri/.+\.so -- gen_context(system_u:object_r:textrel_shlib_t,s0)
-@@ -246,7 +261,7 @@
-
- # Flash plugin, Macromedia
- HOME_DIR/\.mozilla(/.*)?/plugins/libflashplayer\.so.* -- gen_context(system_u:object_r:textrel_shlib_t,s0)
--HOME_DIR/.*/plugins/libflashplayer\.so.* -- gen_context(system_u:object_r:textrel_shlib_t,s0)
-+HOME_DIR/.*/plugins/nppdf\.so -- gen_context(system_u:object_r:textrel_shlib_t,s0)
- /usr/lib(64)?/.*/libflashplayer\.so.* -- gen_context(system_u:object_r:textrel_shlib_t,s0)
- /usr/local/(.*/)?libflashplayer\.so.* -- gen_context(system_u:object_r:textrel_shlib_t,s0)
- HOME_DIR/.*/plugins/nprhapengine\.so.* -- gen_context(system_u:object_r:textrel_shlib_t,s0)
-@@ -267,6 +282,8 @@
- /usr/lib(64)?/vmware/lib(/.*)?/HConfig\.so -- gen_context(system_u:object_r:textrel_shlib_t,s0)
- /usr/lib(64)?/vmware/(.*/)?VmPerl\.so -- gen_context(system_u:object_r:textrel_shlib_t,s0)
-
-+/usr/lib(64)?/(virtualbox(-ose)?/)?(components/)?VBox.*\.so -- gen_context(system_u:object_r:textrel_shlib_t,s0)
-+
- # Java, Sun Microsystems (JPackage SRPM)
- /usr/(.*/)?jre.*/.*\.so(\.[^/]*)* -- gen_context(system_u:object_r:textrel_shlib_t,s0)
- /usr/local/(.*/)?jre.*/.*\.so(\.[^/]*)* -- gen_context(system_u:object_r:textrel_shlib_t,s0)
-@@ -291,6 +308,8 @@
- /usr/lib/acroread/(.*/)?lib/[^/]*\.so(\.[^/]*)* -- gen_context(system_u:object_r:textrel_shlib_t,s0)
- /usr/lib/acroread/.+\.api -- gen_context(system_u:object_r:textrel_shlib_t,s0)
- /usr/lib/acroread/(.*/)?ADMPlugin\.apl -- gen_context(system_u:object_r:textrel_shlib_t,s0)
-+/usr/lib/.*/program(/.*)?\.so gen_context(system_u:object_r:lib_t,s0)
-+/usr/lib64/.*/program(/.*)?\.so gen_context(system_u:object_r:lib_t,s0)
- ') dnl end distro_redhat
-
- #
-@@ -310,3 +329,18 @@
- /var/spool/postfix/lib(64)?(/.*)? gen_context(system_u:object_r:lib_t,s0)
- /var/spool/postfix/usr(/.*)? gen_context(system_u:object_r:lib_t,s0)
- /var/spool/postfix/lib(64)?/ld.*\.so.* -- gen_context(system_u:object_r:ld_so_t,s0)
-+
-+/usr/lib(64)?/libavdevice\.so.* -- gen_context(system_u:object_r:textrel_shlib_t,s0)
-+/usr/lib(64)?/libmythavcodec-[^/]+\.so.* -- gen_context(system_u:object_r:textrel_shlib_t,s0)
-+
-+/usr/lib/jvm/java(.*/)bin(/.*)?/.*\.so -- gen_context(system_u:object_r:textrel_shlib_t,s0)
-+/usr/lib64/jvm/java(.*/)bin(/.*)?/.*\.so -- gen_context(system_u:object_r:textrel_shlib_t,s0)
-+
-+/usr/lib/oracle/.*/lib/libnnz10\.so -- gen_context(system_u:object_r:textrel_shlib_t,s0)
-+
-+/opt/novell/groupwise/client/lib/libgwapijni\.so\.1 -- gen_context(system_u:object_r:textrel_shlib_t,s0)
-+
-+/usr/lib(64)?/libmpeg2\.so.* -- gen_context(system_u:object_r:textrel_shlib_t,s0)
-+
-+/usr/lib(64)?/libav.*\.so(\..*)? -- gen_context(system_u:object_r:textrel_shlib_t,s0)
-+/usr/lib/sse2/libav.*\.so(\..*)? -- gen_context(system_u:object_r:textrel_shlib_t,s0)
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/libraries.te serefpolicy-3.5.13/policy/modules/system/libraries.te
---- nsaserefpolicy/policy/modules/system/libraries.te 2008-10-14 11:58:09.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/system/libraries.te 2008-10-28 10:56:19.000000000 -0400
-@@ -52,11 +52,11 @@
- # ldconfig local policy
- #
-
--allow ldconfig_t self:capability sys_chroot;
-+allow ldconfig_t self:capability { dac_override sys_chroot };
-
- manage_files_pattern(ldconfig_t, ldconfig_cache_t, ldconfig_cache_t)
-
--allow ldconfig_t ld_so_cache_t:file manage_file_perms;
-+manage_files_pattern(ldconfig_t, ld_so_cache_t, ld_so_cache_t)
- files_etc_filetrans(ldconfig_t,ld_so_cache_t,file)
-
- manage_dirs_pattern(ldconfig_t,ldconfig_tmp_t,ldconfig_tmp_t)
-@@ -70,8 +70,11 @@
-
- fs_getattr_xattr_fs(ldconfig_t)
-
-+corecmd_search_bin(ldconfig_t)
-+
- domain_use_interactive_fds(ldconfig_t)
-
-+files_search_home(ldconfig_t)
- files_search_var_lib(ldconfig_t)
- files_read_etc_files(ldconfig_t)
- files_search_tmp(ldconfig_t)
-@@ -80,6 +83,7 @@
- files_delete_etc_files(ldconfig_t)
-
- init_use_script_ptys(ldconfig_t)
-+init_read_script_tmp_files(ldconfig_t)
-
- libs_use_ld_so(ldconfig_t)
- libs_use_shared_libs(ldconfig_t)
-@@ -96,6 +100,10 @@
- ')
- ')
-
-+unprivuser_dontaudit_write_home_content_files(ldconfig_t)
-+unprivuser_manage_tmp_files(ldconfig_t)
-+unprivuser_manage_tmp_symlinks(ldconfig_t)
-+
- ifdef(`hide_broken_symptoms',`
- optional_policy(`
- unconfined_dontaudit_rw_tcp_sockets(ldconfig_t)
-@@ -118,4 +126,10 @@
- # and executes ldconfig on it. If you dont allow this kernel installs
- # blow up.
- rpm_manage_script_tmp_files(ldconfig_t)
-+ # smart package manager needs the following for the same reason
-+ rpm_rw_tmp_files(ldconfig_t)
-+')
-+
-+optional_policy(`
-+ unconfined_domain(ldconfig_t)
- ')
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/locallogin.te serefpolicy-3.5.13/policy/modules/system/locallogin.te
---- nsaserefpolicy/policy/modules/system/locallogin.te 2008-10-14 11:58:09.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/system/locallogin.te 2008-10-28 10:56:19.000000000 -0400
-@@ -67,6 +67,7 @@
- dev_setattr_power_mgmt_dev(local_login_t)
- dev_getattr_sound_dev(local_login_t)
- dev_setattr_sound_dev(local_login_t)
-+dev_rw_generic_usb_dev(local_login_t)
- dev_dontaudit_getattr_apm_bios_dev(local_login_t)
- dev_dontaudit_setattr_apm_bios_dev(local_login_t)
- dev_dontaudit_read_framebuffer(local_login_t)
-@@ -100,7 +101,6 @@
-
- auth_rw_login_records(local_login_t)
- auth_rw_faillog(local_login_t)
--auth_manage_pam_pid(local_login_t)
- auth_manage_pam_console_data(local_login_t)
- auth_domtrans_pam_console(local_login_t)
-
-@@ -163,6 +163,11 @@
- fs_read_cifs_symlinks(local_login_t)
- ')
-
-+tunable_policy(`allow_console_login',`
-+ term_relabel_console(local_login_t)
-+ term_setattr_console(local_login_t)
-+')
-+
- optional_policy(`
- alsa_domtrans(local_login_t)
- ')
-@@ -192,7 +197,7 @@
- ')
-
- optional_policy(`
-- unconfined_domain(local_login_t)
-+ unconfined_shell_domtrans(local_login_t)
- ')
-
- optional_policy(`
-@@ -241,18 +246,25 @@
- seutil_read_default_contexts(sulogin_t)
-
- auth_read_shadow(sulogin_t)
-+auth_use_nsswitch(sulogin_t)
-
- userdom_use_unpriv_users_fds(sulogin_t)
-
--staff_search_home_dirs(sulogin_t)
--
-+ifdef(`enable_mls',`
- sysadm_shell_domtrans(sulogin_t)
-+',`
-+ optional_policy(`
-+ unconfined_shell_domtrans(sulogin_t)
-+ ')
-+')
-+
- sysadm_use_ptys(sulogin_t)
- sysadm_search_home_dirs(sulogin_t)
-
- # suse and debian do not use pam with sulogin...
- ifdef(`distro_suse', `define(`sulogin_no_pam')')
- ifdef(`distro_debian', `define(`sulogin_no_pam')')
-+ifdef(`distro_redhat',`define(`sulogin_no_pam')')
-
- ifdef(`sulogin_no_pam', `
- allow sulogin_t self:capability sys_tty_config;
-@@ -267,10 +279,4 @@
- selinux_compute_user_contexts(sulogin_t)
- ')
-
--optional_policy(`
-- nis_use_ypbind(sulogin_t)
--')
-
--optional_policy(`
-- nscd_socket_use(sulogin_t)
--')
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/logging.fc serefpolicy-3.5.13/policy/modules/system/logging.fc
---- nsaserefpolicy/policy/modules/system/logging.fc 2008-09-24 09:07:28.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/system/logging.fc 2008-10-28 10:56:19.000000000 -0400
-@@ -53,10 +53,10 @@
- /var/named/chroot/var/log -d gen_context(system_u:object_r:var_log_t,s0)
- ')
-
--/var/run/audit_events -s gen_context(system_u:object_r:auditd_var_run_t,s0)
--/var/run/audispd_events -s gen_context(system_u:object_r:audisp_var_run_t,s0)
--/var/run/auditd\.pid -- gen_context(system_u:object_r:auditd_var_run_t,s0)
--/var/run/auditd_sock -s gen_context(system_u:object_r:auditd_var_run_t,s0)
-+/var/run/audit_events -s gen_context(system_u:object_r:auditd_var_run_t,mls_systemhigh)
-+/var/run/audispd_events -s gen_context(system_u:object_r:audisp_var_run_t,mls_systemhigh)
-+/var/run/auditd\.pid -- gen_context(system_u:object_r:auditd_var_run_t,mls_systemhigh)
-+/var/run/auditd_sock -s gen_context(system_u:object_r:auditd_var_run_t,mls_systemhigh)
- /var/run/klogd\.pid -- gen_context(system_u:object_r:klogd_var_run_t,s0)
- /var/run/log -s gen_context(system_u:object_r:devlog_t,s0)
- /var/run/metalog\.pid -- gen_context(system_u:object_r:syslogd_var_run_t,s0)
-@@ -65,3 +65,5 @@
- /var/spool/postfix/pid -d gen_context(system_u:object_r:var_run_t,s0)
-
- /var/tinydns/log/main(/.*)? gen_context(system_u:object_r:var_log_t,s0)
-+
-+/var/spool/plymouth/boot.log gen_context(system_u:object_r:var_log_t,s0)
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/logging.if serefpolicy-3.5.13/policy/modules/system/logging.if
---- nsaserefpolicy/policy/modules/system/logging.if 2008-10-16 17:21:16.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/system/logging.if 2008-10-28 10:56:19.000000000 -0400
-@@ -451,7 +451,7 @@
- ')
-
- allow $1 devlog_t:lnk_file read;
-- allow $1 devlog_t:sock_file rw_sock_file_perms;
-+ allow $1 devlog_t:sock_file rw_file_perms;
-
- # the type of socket depends on the syslog daemon
- allow $1 syslogd_t:unix_dgram_socket sendto;
-@@ -719,6 +719,8 @@
- files_search_var($1)
- manage_files_pattern($1,logfile,logfile)
- read_lnk_files_pattern($1,logfile,logfile)
-+ allow $1 logfile:dir { relabelfrom relabelto };
-+ allow $1 logfile:file { relabelfrom relabelto };
- ')
-
- ########################################
-@@ -952,5 +954,5 @@
- #
- interface(`logging_admin',`
- logging_admin_audit($1, $2, $3)
-- logging_admin_syslog($1, $2)
-+ logging_admin_syslog($1, $2, $3)
- ')
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/logging.te serefpolicy-3.5.13/policy/modules/system/logging.te
---- nsaserefpolicy/policy/modules/system/logging.te 2008-10-16 17:21:16.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/system/logging.te 2008-10-28 10:56:19.000000000 -0400
-@@ -129,7 +129,7 @@
- allow auditd_t self:process { signal_perms setpgid setsched };
- allow auditd_t self:file rw_file_perms;
- allow auditd_t self:unix_dgram_socket create_socket_perms;
--allow auditd_t self:fifo_file rw_file_perms;
-+allow auditd_t self:fifo_file rw_fifo_file_perms;
- allow auditd_t self:tcp_socket create_stream_socket_perms;
-
- allow auditd_t auditd_etc_t:dir list_dir_perms;
-@@ -221,9 +221,9 @@
- # audit dispatcher local policy
- #
-
--allow audisp_t self:capability sys_nice;
-+allow audisp_t self:capability { dac_override sys_nice };
- allow audisp_t self:process setsched;
--allow audisp_t self:fifo_file rw_file_perms;
-+allow audisp_t self:fifo_file rw_fifo_file_perms;
- allow audisp_t self:unix_stream_socket create_stream_socket_perms;
- allow audisp_t self:unix_dgram_socket create_socket_perms;
-
-@@ -352,7 +352,7 @@
- allow syslogd_t self:unix_dgram_socket create_socket_perms;
- allow syslogd_t self:unix_stream_socket create_stream_socket_perms;
- allow syslogd_t self:unix_dgram_socket sendto;
--allow syslogd_t self:fifo_file rw_file_perms;
-+allow syslogd_t self:fifo_file rw_fifo_file_perms;
- allow syslogd_t self:udp_socket create_socket_perms;
- allow syslogd_t self:tcp_socket create_stream_socket_perms;
-
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/lvm.fc serefpolicy-3.5.13/policy/modules/system/lvm.fc
---- nsaserefpolicy/policy/modules/system/lvm.fc 2008-08-07 11:15:12.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/system/lvm.fc 2008-10-28 10:56:19.000000000 -0400
-@@ -55,6 +55,7 @@
- /sbin/lvs -- gen_context(system_u:object_r:lvm_exec_t,s0)
- /sbin/lvscan -- gen_context(system_u:object_r:lvm_exec_t,s0)
- /sbin/multipathd -- gen_context(system_u:object_r:lvm_exec_t,s0)
-+/sbin/multipath\.static -- gen_context(system_u:object_r:lvm_exec_t,s0)
- /sbin/pvchange -- gen_context(system_u:object_r:lvm_exec_t,s0)
- /sbin/pvcreate -- gen_context(system_u:object_r:lvm_exec_t,s0)
- /sbin/pvdata -- gen_context(system_u:object_r:lvm_exec_t,s0)
-@@ -97,3 +98,4 @@
- /var/lock/lvm(/.*)? gen_context(system_u:object_r:lvm_lock_t,s0)
- /var/run/multipathd\.sock -s gen_context(system_u:object_r:lvm_var_run_t,s0)
- /var/lib/multipath(/.*)? gen_context(system_u:object_r:lvm_var_lib_t,s0)
-+/var/run/dmevent.* gen_context(system_u:object_r:lvm_var_run_t,s0)
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/lvm.te serefpolicy-3.5.13/policy/modules/system/lvm.te
---- nsaserefpolicy/policy/modules/system/lvm.te 2008-08-07 11:15:12.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/system/lvm.te 2008-11-05 16:20:42.000000000 -0500
-@@ -10,6 +10,9 @@
- type clvmd_exec_t;
- init_daemon_domain(clvmd_t,clvmd_exec_t)
-
-+type clvmd_initrc_exec_t;
-+init_script_file(clvmd_initrc_exec_t)
-+
- type clvmd_var_run_t;
- files_pid_file(clvmd_var_run_t)
-
-@@ -22,7 +25,7 @@
- role system_r types lvm_t;
-
- type lvm_etc_t;
--files_type(lvm_etc_t)
-+files_config_file(lvm_etc_t)
-
- type lvm_lock_t;
- files_lock_file(lvm_lock_t)
-@@ -44,9 +47,9 @@
- # Cluster LVM daemon local policy
- #
-
--allow clvmd_t self:capability { sys_admin mknod };
-+allow clvmd_t self:capability { sys_nice chown ipc_lock sys_admin mknod };
- dontaudit clvmd_t self:capability sys_tty_config;
--allow clvmd_t self:process signal_perms;
-+allow clvmd_t self:process { signal_perms setsched };
- dontaudit clvmd_t self:process ptrace;
- allow clvmd_t self:socket create_socket_perms;
- allow clvmd_t self:fifo_file rw_fifo_file_perms;
-@@ -54,6 +57,8 @@
- allow clvmd_t self:tcp_socket create_stream_socket_perms;
- allow clvmd_t self:udp_socket create_socket_perms;
-
-+init_dontaudit_getattr_initctl(clvmd_t)
-+
- manage_files_pattern(clvmd_t,clvmd_var_run_t,clvmd_var_run_t)
- files_pid_filetrans(clvmd_t,clvmd_var_run_t,file)
-
-@@ -85,10 +90,15 @@
- corenet_sendrecv_generic_server_packets(clvmd_t)
-
- dev_read_sysfs(clvmd_t)
-+dev_manage_generic_symlinks(clvmd_t)
-+dev_relabel_generic_dev_dirs(clvmd_t)
-+dev_manage_generic_blk_files(clvmd_t)
- dev_manage_generic_chr_files(clvmd_t)
- dev_rw_lvm_control(clvmd_t)
- dev_dontaudit_getattr_all_blk_files(clvmd_t)
- dev_dontaudit_getattr_all_chr_files(clvmd_t)
-+dev_create_generic_dirs(clvmd_t)
-+dev_delete_generic_dirs(clvmd_t)
-
- files_read_etc_files(clvmd_t)
- files_list_usr(clvmd_t)
-@@ -99,9 +109,12 @@
- fs_dontaudit_read_removable_files(clvmd_t)
-
- storage_dontaudit_getattr_removable_dev(clvmd_t)
-+storage_dev_filetrans_fixed_disk(clvmd_t)
-+storage_manage_fixed_disk(clvmd_t)
-
- domain_use_interactive_fds(clvmd_t)
-
-+storage_relabel_fixed_disk(clvmd_t)
- storage_raw_read_fixed_disk(clvmd_t)
-
- auth_use_nsswitch(clvmd_t)
-@@ -115,9 +128,11 @@
-
- seutil_dontaudit_search_config(clvmd_t)
- seutil_sigchld_newrole(clvmd_t)
-+seutil_read_config(clvmd_t)
-+seutil_read_file_contexts(clvmd_t)
-+seutil_search_default_contexts(clvmd_t)
-
- userdom_dontaudit_use_unpriv_user_fds(clvmd_t)
--
- sysadm_dontaudit_search_home_dirs(clvmd_t)
-
- lvm_domtrans(clvmd_t)
-@@ -128,6 +143,14 @@
- ')
-
- optional_policy(`
-+ dbus_system_bus_client_template(lvm,lvm_t)
-+
-+ optional_policy(`
-+ hal_dbus_chat(lvm_t)
-+ ')
-+')
-+
-+optional_policy(`
- gpm_dontaudit_getattr_gpmctl(clvmd_t)
- ')
-
-@@ -137,6 +160,14 @@
- ')
-
- optional_policy(`
-+ unconfined_domain(clvmd_t)
-+')
-+
-+optional_policy(`
-+ unconfined_domain(lvm_t)
-+')
-+
-+optional_policy(`
- udev_read_db(clvmd_t)
- ')
-
-@@ -147,17 +178,19 @@
-
- # DAC overrides and mknod for modifying /dev entries (vgmknodes)
- # rawio needed for dmraid
--allow lvm_t self:capability { dac_override fowner ipc_lock sys_admin sys_nice mknod chown sys_resource sys_rawio };
-+allow lvm_t self:capability { dac_override fowner ipc_lock sys_admin sys_nice mknod chown sys_resource sys_rawio net_admin };
-+# lvm needs net_admin for multipath
- dontaudit lvm_t self:capability sys_tty_config;
- allow lvm_t self:process { sigchld sigkill sigstop signull signal };
- # LVM will complain a lot if it cannot set its priority.
- allow lvm_t self:process setsched;
- allow lvm_t self:file rw_file_perms;
--allow lvm_t self:fifo_file rw_file_perms;
-+allow lvm_t self:fifo_file manage_fifo_file_perms;
- allow lvm_t self:unix_dgram_socket create_socket_perms;
- allow lvm_t self:netlink_kobject_uevent_socket create_socket_perms;
-
--allow lvm_t clvmd_t:unix_stream_socket connectto;
-+allow lvm_t self:unix_stream_socket { connectto create_stream_socket_perms };
-+allow lvm_t clvmd_t:unix_stream_socket { connectto rw_socket_perms };
-
- manage_dirs_pattern(lvm_t,lvm_tmp_t,lvm_tmp_t)
- manage_files_pattern(lvm_t,lvm_tmp_t,lvm_tmp_t)
-@@ -189,6 +222,7 @@
- manage_files_pattern(lvm_t,lvm_metadata_t,lvm_metadata_t)
- filetrans_pattern(lvm_t,lvm_etc_t,lvm_metadata_t,file)
- files_etc_filetrans(lvm_t,lvm_metadata_t,file)
-+files_search_mnt(lvm_t)
-
- kernel_read_system_state(lvm_t)
- kernel_read_kernel_sysctls(lvm_t)
-@@ -225,6 +259,7 @@
- dev_dontaudit_getattr_generic_blk_files(lvm_t)
- dev_dontaudit_getattr_generic_pipes(lvm_t)
- dev_create_generic_dirs(lvm_t)
-+dev_rw_generic_files(lvm_t)
-
- fs_getattr_xattr_fs(lvm_t)
- fs_search_auto_mountpoints(lvm_t)
-@@ -243,6 +278,7 @@
- storage_dev_filetrans_fixed_disk(lvm_t)
- # Access raw devices and old /dev/lvm (c 109,0). Is this needed?
- storage_manage_fixed_disk(lvm_t)
-+mls_file_read_all_levels(lvm_t)
-
- term_getattr_all_user_ttys(lvm_t)
- term_list_ptys(lvm_t)
-@@ -252,6 +288,7 @@
-
- domain_use_interactive_fds(lvm_t)
-
-+files_read_usr_files(lvm_t)
- files_read_etc_files(lvm_t)
- files_read_etc_runtime_files(lvm_t)
- # for when /usr is not mounted:
-@@ -273,6 +310,8 @@
- seutil_search_default_contexts(lvm_t)
- seutil_sigchld_newrole(lvm_t)
-
-+sysadm_dontaudit_search_home_dirs(lvm_t)
-+
- ifdef(`distro_redhat',`
- # this is from the initrd:
- files_rw_isid_type_dirs(lvm_t)
-@@ -291,5 +330,18 @@
- ')
-
- optional_policy(`
-+ modutils_domtrans_insmod(lvm_t)
-+')
-+
-+optional_policy(`
- udev_read_db(lvm_t)
- ')
-+
-+optional_policy(`
-+ unconfined_domain(lvm_t)
-+')
-+
-+optional_policy(`
-+ xen_append_log(lvm_t)
-+ xen_dontaudit_rw_unix_stream_sockets(lvm_t)
-+')
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/miscfiles.if serefpolicy-3.5.13/policy/modules/system/miscfiles.if
---- nsaserefpolicy/policy/modules/system/miscfiles.if 2008-08-07 11:15:12.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/system/miscfiles.if 2008-11-03 17:18:22.000000000 -0500
-@@ -23,6 +23,45 @@
-
- ########################################
- ##
-+## manange system SSL certificates.
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+##
-+#
-+interface(`miscfiles_manage_cert_dirs',`
-+ gen_require(`
-+ type cert_t;
-+ ')
-+
-+ manage_dirs_pattern($1,cert_t,cert_t)
-+')
-+
-+########################################
-+##
-+## manange system SSL certificates.
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+##
-+#
-+interface(`miscfiles_manage_cert_files',`
-+ gen_require(`
-+ type cert_t;
-+ ')
-+
-+ manage_files_pattern($1,cert_t,cert_t)
-+ read_lnk_files_pattern($1,cert_t,cert_t)
-+')
-+
-+########################################
-+##
- ## Read fonts.
- ##
- ##
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/modutils.te serefpolicy-3.5.13/policy/modules/system/modutils.te
---- nsaserefpolicy/policy/modules/system/modutils.te 2008-10-14 11:58:09.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/system/modutils.te 2008-10-28 10:56:19.000000000 -0400
-@@ -42,7 +42,7 @@
- # insmod local policy
- #
-
--allow insmod_t self:capability { dac_override net_raw sys_tty_config };
-+allow insmod_t self:capability { dac_override mknod net_raw sys_nice sys_tty_config };
- allow insmod_t self:process { execmem sigchld sigkill sigstop signull signal };
-
- allow insmod_t self:udp_socket create_socket_perms;
-@@ -55,6 +55,7 @@
-
- kernel_load_module(insmod_t)
- kernel_read_system_state(insmod_t)
-+kernel_read_network_state(insmod_t)
- kernel_write_proc_files(insmod_t)
- kernel_mount_debugfs(insmod_t)
- kernel_mount_kvmfs(insmod_t)
-@@ -63,6 +64,7 @@
- kernel_read_kernel_sysctls(insmod_t)
- kernel_rw_kernel_sysctl(insmod_t)
- kernel_read_hotplug_sysctls(insmod_t)
-+kernel_setsched(insmod_t)
-
- files_read_kernel_modules(insmod_t)
- # for locking: (cjp: ????)
-@@ -76,9 +78,7 @@
- dev_read_sound(insmod_t)
- dev_write_sound(insmod_t)
- dev_rw_apm_bios(insmod_t)
--# cjp: why is this needed? insmod cannot mounton any dir
--# and it also transitions to mount
--dev_mount_usbfs(insmod_t)
-+dev_create_generic_chr_files(insmod_t)
-
- fs_getattr_xattr_fs(insmod_t)
-
-@@ -101,6 +101,8 @@
- init_use_fds(insmod_t)
- init_use_script_fds(insmod_t)
- init_use_script_ptys(insmod_t)
-+init_spec_domtrans_script(insmod_t)
-+init_rw_script_tmp_files(insmod_t)
-
- libs_use_ld_so(insmod_t)
- libs_use_shared_libs(insmod_t)
-@@ -112,17 +114,32 @@
-
- seutil_read_file_contexts(insmod_t)
-
--ifdef(`distro_ubuntu',`
- optional_policy(`
- unconfined_domain(insmod_t)
- ')
--')
-+
-+term_dontaudit_use_unallocated_ttys(insmod_t)
-+userdom_dontaudit_search_users_home_dirs(insmod_t)
-+sysadm_dontaudit_search_home_dirs(insmod_t)
-+fs_dontaudit_use_tmpfs_chr_dev(insmod_t)
-
- if( ! secure_mode_insmod ) {
- kernel_domtrans_to(insmod_t,insmod_exec_t)
- }
-
- optional_policy(`
-+ alsa_domtrans(insmod_t)
-+')
-+
-+optional_policy(`
-+ firstboot_dontaudit_rw_pipes(insmod_t)
-+')
-+
-+optional_policy(`
-+ hal_write_log(insmod_t)
-+')
-+
-+optional_policy(`
- hotplug_search_config(insmod_t)
- ')
-
-@@ -155,10 +172,12 @@
-
- optional_policy(`
- rpm_rw_pipes(insmod_t)
-+ rpm_read_script_tmp_files(insmod_t)
- ')
-
- optional_policy(`
- unconfined_dontaudit_rw_pipes(insmod_t)
-+ unconfined_dontaudit_use_terms(insmod_t)
- ')
-
- optional_policy(`
-@@ -185,6 +204,7 @@
-
- files_read_kernel_symbol_table(depmod_t)
- files_read_kernel_modules(depmod_t)
-+files_delete_kernel_modules(depmod_t)
-
- fs_getattr_xattr_fs(depmod_t)
-
-@@ -208,9 +228,11 @@
-
- # Read System.map from home directories.
- files_list_home(depmod_t)
--staff_read_home_content_files(depmod_t)
-+unprivuser_read_home_content_files(depmod_t)
- sysadm_read_home_content_files(depmod_t)
-
-+sysadm_dontaudit_use_terms(depmod_t)
-+
- ifdef(`distro_ubuntu',`
- optional_policy(`
- unconfined_domain(depmod_t)
-@@ -219,11 +241,13 @@
-
- optional_policy(`
- # Read System.map from home directories.
-- unconfined_read_home_content_files(depmod_t)
-+ unconfined_dontaudit_use_terms(depmod_t)
-+ unconfined_domain(depmod_t)
- ')
-
- optional_policy(`
- rpm_rw_pipes(depmod_t)
-+ rpm_manage_script_tmp_files(depmod_t)
- ')
-
- #################################
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/mount.fc serefpolicy-3.5.13/policy/modules/system/mount.fc
---- nsaserefpolicy/policy/modules/system/mount.fc 2008-08-07 11:15:12.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/system/mount.fc 2008-10-28 10:56:19.000000000 -0400
-@@ -1,4 +1,6 @@
- /bin/mount.* -- gen_context(system_u:object_r:mount_exec_t,s0)
- /bin/umount.* -- gen_context(system_u:object_r:mount_exec_t,s0)
--
-+/sbin/mount.* -- gen_context(system_u:object_r:mount_exec_t,s0)
-+/sbin/umount.* -- gen_context(system_u:object_r:mount_exec_t,s0)
-+/bin/fusermount -- gen_context(system_u:object_r:mount_exec_t,s0)
- /usr/bin/fusermount -- gen_context(system_u:object_r:mount_exec_t,s0)
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/mount.if serefpolicy-3.5.13/policy/modules/system/mount.if
---- nsaserefpolicy/policy/modules/system/mount.if 2008-08-07 11:15:12.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/system/mount.if 2008-10-28 10:56:19.000000000 -0400
-@@ -49,6 +49,8 @@
- mount_domtrans($1)
- role $2 types mount_t;
- allow mount_t $3:chr_file rw_file_perms;
-+ #Leaked File Descriptors
-+ dontaudit mount_t $1:unix_stream_socket rw_socket_perms;
-
- optional_policy(`
- samba_run_smbmount($1, $2, $3)
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/mount.te serefpolicy-3.5.13/policy/modules/system/mount.te
---- nsaserefpolicy/policy/modules/system/mount.te 2008-08-07 11:15:12.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/system/mount.te 2008-10-28 10:56:19.000000000 -0400
-@@ -18,17 +18,18 @@
- init_system_domain(mount_t,mount_exec_t)
- role system_r types mount_t;
-
-+typealias mount_t alias mount_ntfs_t;
-+typealias mount_exec_t alias mount_ntfs_exec_t;
-+
- type mount_loopback_t; # customizable
- files_type(mount_loopback_t)
-
- type mount_tmp_t;
- files_tmp_file(mount_tmp_t)
-
--# causes problems with interfaces when
--# this is optionally declared in monolithic
--# policy--duplicate type declaration
- type unconfined_mount_t;
- application_domain(unconfined_mount_t,mount_exec_t)
-+role system_r types unconfined_mount_t;
-
- ########################################
- #
-@@ -36,7 +37,8 @@
- #
-
- # setuid/setgid needed to mount cifs
--allow mount_t self:capability { ipc_lock sys_rawio sys_admin dac_override chown sys_tty_config setuid setgid };
-+allow mount_t self:capability { fsetid ipc_lock sys_rawio sys_resource sys_admin dac_override chown sys_tty_config setuid setgid };
-+allow mount_t self:process ptrace;
-
- allow mount_t mount_loopback_t:file read_file_perms;
-
-@@ -47,12 +49,17 @@
-
- files_tmp_filetrans(mount_t,mount_tmp_t,{ file dir })
-
-+# In order to mount reiserfs_t
-+kernel_list_unlabeled(mount_t)
- kernel_read_system_state(mount_t)
-+kernel_read_network_state(mount_t)
- kernel_read_kernel_sysctls(mount_t)
- kernel_dontaudit_getattr_core_if(mount_t)
-+kernel_search_debugfs(mount_t)
-
- dev_getattr_all_blk_files(mount_t)
- dev_list_all_dev_nodes(mount_t)
-+dev_read_usbfs(mount_t)
- dev_rw_lvm_control(mount_t)
- dev_dontaudit_getattr_all_chr_files(mount_t)
- dev_dontaudit_getattr_memory_dev(mount_t)
-@@ -62,16 +69,19 @@
- storage_raw_write_fixed_disk(mount_t)
- storage_raw_read_removable_device(mount_t)
- storage_raw_write_removable_device(mount_t)
-+storage_rw_fuse(mount_t)
-
--fs_getattr_xattr_fs(mount_t)
--fs_getattr_cifs(mount_t)
-+fs_list_all(mount_t)
-+fs_getattr_all_fs(mount_t)
- fs_mount_all_fs(mount_t)
- fs_unmount_all_fs(mount_t)
- fs_remount_all_fs(mount_t)
- fs_relabelfrom_all_fs(mount_t)
--fs_list_auto_mountpoints(mount_t)
- fs_rw_tmpfs_chr_files(mount_t)
-+fs_manage_tmpfs_dirs(mount_t)
- fs_read_tmpfs_symlinks(mount_t)
-+fs_read_fusefs_files(mount_t)
-+fs_manage_nfs_dirs(mount_t)
-
- term_use_all_terms(mount_t)
-
-@@ -79,6 +89,7 @@
- corecmd_exec_bin(mount_t)
-
- domain_use_interactive_fds(mount_t)
-+domain_dontaudit_search_all_domains_state(mount_t)
-
- files_search_all(mount_t)
- files_read_etc_files(mount_t)
-@@ -87,7 +98,7 @@
- files_mounton_all_mountpoints(mount_t)
- files_unmount_rootfs(mount_t)
- # These rules need to be generalized. Only admin, initrc should have it:
--files_relabelto_all_file_type_fs(mount_t)
-+files_relabel_all_file_type_fs(mount_t)
- files_mount_all_file_type_fs(mount_t)
- files_unmount_all_file_type_fs(mount_t)
- # for when /etc/mtab loses its type
-@@ -100,6 +111,8 @@
- init_use_fds(mount_t)
- init_use_script_ptys(mount_t)
- init_dontaudit_getattr_initctl(mount_t)
-+init_stream_connect_script(mount_t)
-+init_rw_script_stream_sockets(mount_t)
-
- auth_use_nsswitch(mount_t)
-
-@@ -119,6 +132,8 @@
- seutil_read_config(mount_t)
-
- userdom_use_all_users_fds(mount_t)
-+sysadm_read_home_content_files(mount_t)
-+unprivuser_manage_home_content_dirs(mount_t)
-
- ifdef(`distro_redhat',`
- optional_policy(`
-@@ -167,6 +182,8 @@
- fs_search_rpc(mount_t)
-
- rpc_stub(mount_t)
-+
-+ rpc_domtrans_rpcd(mount_t)
- ')
-
- optional_policy(`
-@@ -181,6 +198,11 @@
- ')
- ')
-
-+# Needed for mount crypt https://bugzilla.redhat.com/show_bug.cgi?id=418711
-+optional_policy(`
-+ lvm_domtrans(mount_t)
-+')
-+
- # for kernel package installation
- optional_policy(`
- rpm_rw_pipes(mount_t)
-@@ -188,6 +210,7 @@
-
- optional_policy(`
- samba_domtrans_smbmount(mount_t)
-+ samba_read_config(mount_t)
- ')
-
- ########################################
-@@ -198,4 +221,26 @@
- optional_policy(`
- files_etc_filetrans_etc_runtime(unconfined_mount_t,file)
- unconfined_domain(unconfined_mount_t)
-+ optional_policy(`
-+ hal_dbus_chat(unconfined_mount_t)
-+ ')
- ')
-+
-+########################################
-+#
-+# ntfs local policy
-+#
-+allow mount_t self:fifo_file rw_fifo_file_perms;
-+allow mount_t self:unix_stream_socket create_stream_socket_perms;
-+allow mount_t self:unix_dgram_socket create_socket_perms;
-+
-+corecmd_exec_shell(mount_t)
-+
-+modutils_domtrans_insmod(mount_t)
-+
-+optional_policy(`
-+ hal_write_log(mount_t)
-+ hal_use_fds(mount_t)
-+ hal_rw_pipes(mount_t)
-+')
-+
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/raid.te serefpolicy-3.5.13/policy/modules/system/raid.te
---- nsaserefpolicy/policy/modules/system/raid.te 2008-10-14 11:58:09.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/system/raid.te 2008-10-28 10:56:19.000000000 -0400
-@@ -39,6 +39,7 @@
- dev_dontaudit_getattr_generic_files(mdadm_t)
- dev_dontaudit_getattr_generic_chr_files(mdadm_t)
- dev_dontaudit_getattr_generic_blk_files(mdadm_t)
-+dev_read_realtime_clock(mdadm_t)
-
- fs_search_auto_mountpoints(mdadm_t)
- fs_dontaudit_list_tmpfs(mdadm_t)
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/selinuxutil.fc serefpolicy-3.5.13/policy/modules/system/selinuxutil.fc
---- nsaserefpolicy/policy/modules/system/selinuxutil.fc 2008-08-07 11:15:12.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/system/selinuxutil.fc 2008-10-28 10:56:19.000000000 -0400
-@@ -38,7 +38,7 @@
- /usr/sbin/restorecond -- gen_context(system_u:object_r:restorecond_exec_t,s0)
- /usr/sbin/run_init -- gen_context(system_u:object_r:run_init_exec_t,s0)
- /usr/sbin/setfiles.* -- gen_context(system_u:object_r:setfiles_exec_t,s0)
--/usr/sbin/setsebool -- gen_context(system_u:object_r:semanage_exec_t,s0)
-+/usr/sbin/setsebool -- gen_context(system_u:object_r:setsebool_exec_t,s0)
- /usr/sbin/semanage -- gen_context(system_u:object_r:semanage_exec_t,s0)
- /usr/sbin/semodule -- gen_context(system_u:object_r:semanage_exec_t,s0)
-
-@@ -46,3 +46,11 @@
- # /var/run
- #
- /var/run/restorecond\.pid -- gen_context(system_u:object_r:restorecond_var_run_t,s0)
-+
-+#
-+# /var/lib
-+#
-+/var/lib/selinux(/.*)? gen_context(system_u:object_r:selinux_var_lib_t,s0)
-+
-+/etc/share/selinux/targeted(/.*)? gen_context(system_u:object_r:semanage_store_t,s0)
-+/etc/share/selinux/mls(/.*)? gen_context(system_u:object_r:semanage_store_t,s0)
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/selinuxutil.if serefpolicy-3.5.13/policy/modules/system/selinuxutil.if
---- nsaserefpolicy/policy/modules/system/selinuxutil.if 2008-10-10 15:53:03.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/system/selinuxutil.if 2008-10-28 10:56:19.000000000 -0400
-@@ -555,6 +555,59 @@
-
- ########################################
- ##
-+## Execute setfiles in the setfiles domain.
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+#
-+interface(`seutil_domtrans_setfiles_mac',`
-+ gen_require(`
-+ type setfiles_mac_t, setfiles_exec_t;
-+ ')
-+
-+ files_search_usr($1)
-+ corecmd_search_bin($1)
-+ domtrans_pattern($1, setfiles_exec_t, setfiles_mac_t)
-+')
-+
-+########################################
-+##
-+## Execute setfiles in the setfiles_mac domain, and
-+## allow the specified role the setfiles_mac domain,
-+## and use the caller's terminal.
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+##
-+##
-+## The role to be allowed the setfiles_mac domain.
-+##
-+##
-+##
-+##
-+## The type of the terminal allow the setfiles_mac domain to use.
-+##
-+##
-+##
-+#
-+interface(`seutil_run_setfiles_mac',`
-+ gen_require(`
-+ type setfiles_mac_t;
-+ ')
-+
-+ seutil_domtrans_setfiles_mac($1)
-+ role $2 types setfiles_mac_t;
-+ allow setfiles_mac_t $3:chr_file rw_term_perms;
-+')
-+
-+########################################
-+##
- ## Execute setfiles in the caller domain.
- ##
- ##
-@@ -589,7 +642,7 @@
- type selinux_config_t;
- ')
-
-- dontaudit $1 selinux_config_t:dir search;
-+ dontaudit $1 selinux_config_t:dir search_dir_perms;
- ')
-
- ########################################
-@@ -608,7 +661,7 @@
- type selinux_config_t;
- ')
-
-- dontaudit $1 selinux_config_t:dir search;
-+ dontaudit $1 selinux_config_t:dir search_dir_perms;
- dontaudit $1 selinux_config_t:file { getattr read };
- ')
-
-@@ -700,6 +753,7 @@
- ')
-
- files_search_etc($1)
-+ manage_dirs_pattern($1, selinux_config_t, selinux_config_t)
- manage_files_pattern($1,selinux_config_t,selinux_config_t)
- read_lnk_files_pattern($1,selinux_config_t,selinux_config_t)
- ')
-@@ -1019,6 +1073,26 @@
-
- ########################################
- ##
-+## Execute a domain transition to run setsebool.
-+##
-+##
-+##
-+## Domain allowed to transition.
-+##
-+##
-+#
-+interface(`seutil_domtrans_setsebool',`
-+ gen_require(`
-+ type setsebool_t, setsebool_exec_t;
-+ ')
-+
-+ files_search_usr($1)
-+ corecmd_search_bin($1)
-+ domtrans_pattern($1, setsebool_exec_t, setsebool_t)
-+')
-+
-+########################################
-+##
- ## Execute semanage in the semanage domain, and
- ## allow the specified role the semanage domain,
- ## and use the caller's terminal.
-@@ -1030,7 +1104,7 @@
- ##
- ##
- ##
--## The role to be allowed the checkpolicy domain.
-+## The role to be allowed the semanage domain.
- ##
- ##
- ##
-@@ -1046,14 +1120,45 @@
- ')
-
- seutil_domtrans_semanage($1)
-- seutil_run_setfiles(semanage_t, $2, $3)
-- seutil_run_loadpolicy(semanage_t, $2, $3)
- role $2 types semanage_t;
- allow semanage_t $3:chr_file rw_term_perms;
- ')
-
- ########################################
- ##
-+## Execute setsebool in the semanage domain, and
-+## allow the specified role the semanage domain,
-+## and use the caller's terminal.
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+##
-+##
-+## The role to be allowed the semanage domain.
-+##
-+##
-+##
-+##
-+## The type of the terminal allow the semanage domain to use.
-+##
-+##
-+##
-+#
-+interface(`seutil_run_setsebool',`
-+ gen_require(`
-+ type semanage_t;
-+ ')
-+
-+ seutil_domtrans_setsebool($1)
-+ role $2 types setsebool_t;
-+ allow setsebool_t $3:chr_file rw_term_perms;
-+')
-+
-+########################################
-+##
- ## Full management of the semanage
- ## module store.
- ##
-@@ -1165,3 +1270,260 @@
- selinux_dontaudit_get_fs_mount($1)
- seutil_dontaudit_read_config($1)
- ')
-+
-+#######################################
-+##
-+## The per role template for the setsebool module.
-+##
-+##
-+##
-+## This template creates a derived domains which are used
-+## for setsebool plugins that are executed by a browser.
-+##
-+##
-+## This template is invoked automatically for each user, and
-+## generally does not need to be invoked directly
-+## by policy writers.
-+##
-+##
-+##
-+##
-+## The prefix of the user domain (e.g., user
-+## is the prefix for user_t).
-+##
-+##
-+##
-+##
-+## The type of the user domain.
-+##
-+##
-+##
-+##
-+## The role associated with the user domain.
-+##
-+##
-+#
-+template(`seutil_setsebool_per_role_template',`
-+ gen_require(`
-+ type setsebool_exec_t;
-+ ')
-+
-+ type $1_setsebool_t;
-+ domain_type($1_setsebool_t)
-+ domain_entry_file($1_setsebool_t, setsebool_exec_t)
-+ role $3 types $1_setsebool_t;
-+
-+ files_search_usr($2)
-+ corecmd_search_bin($2)
-+ domtrans_pattern($2, setsebool_exec_t, $1_setsebool_t)
-+ seutil_semanage_policy($1_setsebool_t)
-+
-+ # Need to define per type booleans
-+ selinux_set_boolean($1_setsebool_t)
-+
-+ # Bug in semanage
-+ seutil_domtrans_setfiles($1_setsebool_t)
-+ seutil_manage_file_contexts($1_setsebool_t)
-+ seutil_manage_default_contexts($1_setsebool_t)
-+ seutil_manage_config($1_setsebool_t)
-+')
-+
-+#######################################
-+##
-+## All rules necessary to run semanage command
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+#
-+interface(`seutil_semanage_policy',`
-+ gen_require(`
-+ type semanage_tmp_t;
-+ type policy_config_t;
-+ ')
-+ allow $1 self:capability { dac_override audit_write sys_resource };
-+ dontaudit $1 self:capability sys_tty_config;
-+ allow $1 self:unix_stream_socket create_stream_socket_perms;
-+ allow $1 self:unix_dgram_socket create_socket_perms;
-+ logging_send_audit_msgs($1)
-+
-+ # Running genhomedircon requires this for finding all users
-+ auth_use_nsswitch($1)
-+
-+ allow $1 policy_config_t:file { read write };
-+
-+ allow $1 semanage_tmp_t:dir manage_dir_perms;
-+ allow $1 semanage_tmp_t:file manage_file_perms;
-+ files_tmp_filetrans($1, semanage_tmp_t, { file dir })
-+
-+ kernel_read_system_state($1)
-+ kernel_read_kernel_sysctls($1)
-+
-+ corecmd_exec_bin($1)
-+ corecmd_exec_shell($1)
-+
-+ dev_read_urand($1)
-+
-+ domain_use_interactive_fds($1)
-+
-+ files_read_etc_files($1)
-+ files_read_etc_runtime_files($1)
-+ files_read_usr_files($1)
-+ files_list_pids($1)
-+ fs_list_inotifyfs($1)
-+ fs_getattr_all_fs($1)
-+
-+ mls_file_write_all_levels($1)
-+ mls_file_read_all_levels($1)
-+
-+ selinux_getattr_fs($1)
-+ selinux_validate_context($1)
-+ selinux_get_enforce_mode($1)
-+
-+ term_use_all_terms($1)
-+
-+ libs_use_ld_so($1)
-+ libs_use_shared_libs($1)
-+
-+ locallogin_use_fds($1)
-+
-+ logging_send_syslog_msg($1)
-+
-+ miscfiles_read_localization($1)
-+
-+ seutil_search_default_contexts($1)
-+ seutil_domtrans_loadpolicy($1)
-+ seutil_read_config($1)
-+ seutil_manage_bin_policy($1)
-+ seutil_use_newrole_fds($1)
-+ seutil_manage_module_store($1)
-+ seutil_get_semanage_trans_lock($1)
-+ seutil_get_semanage_read_lock($1)
-+
-+ userdom_dontaudit_write_unpriv_user_home_content_files($1)
-+
-+ optional_policy(`
-+ rpm_dontaudit_rw_tmp_files($1)
-+ rpm_dontaudit_rw_pipes($1)
-+ ')
-+')
-+
-+
-+#######################################
-+##
-+## All rules necessary to run setfiles command
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+#
-+interface(`seutil_setfiles',`
-+
-+allow $1 self:capability { dac_override dac_read_search fowner };
-+dontaudit $1 self:capability sys_tty_config;
-+allow $1 self:fifo_file rw_file_perms;
-+dontaudit $1 self:dir relabelfrom;
-+dontaudit $1 self:file relabelfrom;
-+dontaudit $1 self:lnk_file relabelfrom;
-+
-+
-+allow $1 { policy_src_t policy_config_t file_context_t default_context_t }:dir list_dir_perms;
-+allow $1 { policy_src_t policy_config_t file_context_t default_context_t }:file read_file_perms;
-+allow $1 { policy_src_t policy_config_t file_context_t default_context_t }:lnk_file { read_lnk_file_perms ioctl lock };
-+
-+logging_send_audit_msgs($1)
-+
-+kernel_read_system_state($1)
-+kernel_relabelfrom_unlabeled_dirs($1)
-+kernel_relabelfrom_unlabeled_files($1)
-+kernel_relabelfrom_unlabeled_symlinks($1)
-+kernel_relabelfrom_unlabeled_pipes($1)
-+kernel_relabelfrom_unlabeled_sockets($1)
-+kernel_use_fds($1)
-+kernel_rw_pipes($1)
-+kernel_rw_unix_dgram_sockets($1)
-+kernel_dontaudit_list_all_proc($1)
-+kernel_read_all_sysctls($1)
-+kernel_read_network_state_symlinks($1)
-+
-+dev_relabel_all_dev_nodes($1)
-+
-+domain_use_interactive_fds($1)
-+domain_read_all_domains_state($1)
-+
-+files_read_etc_runtime_files($1)
-+files_read_etc_files($1)
-+files_list_all($1)
-+files_relabel_all_files($1)
-+files_list_isid_type_dirs($1)
-+files_read_isid_type_files($1)
-+files_dontaudit_read_all_symlinks($1)
-+
-+fs_getattr_xattr_fs($1)
-+fs_list_all($1)
-+fs_getattr_all_files($1)
-+fs_search_auto_mountpoints($1)
-+fs_relabelfrom_noxattr_fs($1)
-+
-+mls_file_read_all_levels($1)
-+mls_file_write_all_levels($1)
-+mls_file_upgrade($1)
-+mls_file_downgrade($1)
-+
-+selinux_validate_context($1)
-+selinux_compute_access_vector($1)
-+selinux_compute_create_context($1)
-+selinux_compute_relabel_context($1)
-+selinux_compute_user_contexts($1)
-+
-+term_use_all_terms($1)
-+
-+# this is to satisfy the assertion:
-+auth_relabelto_shadow($1)
-+
-+init_use_fds($1)
-+init_use_script_fds($1)
-+init_use_script_ptys($1)
-+init_exec_script_files($1)
-+
-+libs_use_ld_so($1)
-+libs_use_shared_libs($1)
-+
-+logging_send_syslog_msg($1)
-+
-+miscfiles_read_localization($1)
-+
-+seutil_libselinux_linked($1)
-+
-+userdom_use_all_users_fds($1)
-+# for config files in a home directory
-+userdom_read_all_users_home_content_files($1)
-+
-+ifdef(`distro_debian',`
-+ # udev tmpfs is populated with static device nodes
-+ # and then relabeled afterwards; thus
-+ # /dev/console has the tmpfs type
-+ fs_rw_tmpfs_chr_files($1)
-+')
-+
-+ifdef(`distro_redhat',`
-+ fs_rw_tmpfs_chr_files($1)
-+ fs_rw_tmpfs_blk_files($1)
-+ fs_relabel_tmpfs_blk_file($1)
-+ fs_relabel_tmpfs_chr_file($1)
-+')
-+
-+ifdef(`distro_ubuntu',`
-+ optional_policy(`
-+ unconfined_domain($1)
-+ ')
-+')
-+
-+optional_policy(`
-+ hotplug_use_fds($1)
-+')
-+')
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/selinuxutil.te serefpolicy-3.5.13/policy/modules/system/selinuxutil.te
---- nsaserefpolicy/policy/modules/system/selinuxutil.te 2008-10-16 17:21:16.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/system/selinuxutil.te 2008-10-28 10:56:19.000000000 -0400
-@@ -23,6 +23,9 @@
- type selinux_config_t;
- files_type(selinux_config_t)
-
-+type selinux_var_lib_t;
-+files_type(selinux_var_lib_t)
-+
- type checkpolicy_t, can_write_binary_policy;
- type checkpolicy_exec_t;
- application_domain(checkpolicy_t, checkpolicy_exec_t)
-@@ -75,7 +78,6 @@
- type restorecond_exec_t;
- init_daemon_domain(restorecond_t,restorecond_exec_t)
- domain_obj_id_change_exemption(restorecond_t)
--role system_r types restorecond_t;
-
- type restorecond_var_run_t;
- files_pid_file(restorecond_var_run_t)
-@@ -92,6 +94,10 @@
- domain_interactive_fd(semanage_t)
- role system_r types semanage_t;
-
-+type setsebool_t;
-+type setsebool_exec_t;
-+init_system_domain(setsebool_t, setsebool_exec_t)
-+
- type semanage_store_t;
- files_type(semanage_store_t)
-
-@@ -109,6 +115,11 @@
- init_system_domain(setfiles_t,setfiles_exec_t)
- domain_obj_id_change_exemption(setfiles_t)
-
-+type setfiles_mac_t;
-+domain_type(setfiles_mac_t)
-+domain_entry_file(setfiles_mac_t, setfiles_exec_t)
-+domain_obj_id_change_exemption(setfiles_mac_t)
-+
- ########################################
- #
- # Checkpolicy local policy
-@@ -168,6 +179,7 @@
- files_read_etc_runtime_files(load_policy_t)
-
- fs_getattr_xattr_fs(load_policy_t)
-+fs_list_inotifyfs(load_policy_t)
-
- mls_file_read_all_levels(load_policy_t)
-
-@@ -195,15 +207,6 @@
- ')
- ')
-
--ifdef(`hide_broken_symptoms',`
-- # cjp: cover up stray file descriptors.
-- dontaudit load_policy_t selinux_config_t:file write;
--
-- optional_policy(`
-- unconfined_dontaudit_read_pipes(load_policy_t)
-- ')
--')
--
- ########################################
- #
- # Newrole local policy
-@@ -221,7 +224,7 @@
- allow newrole_t self:msg { send receive };
- allow newrole_t self:unix_dgram_socket sendto;
- allow newrole_t self:unix_stream_socket { create_stream_socket_perms connectto };
--allow newrole_t self:netlink_audit_socket { create_netlink_socket_perms nlmsg_relay };
-+logging_send_audit_msgs(newrole_t)
-
- read_files_pattern(newrole_t,default_context_t,default_context_t)
- read_lnk_files_pattern(newrole_t,default_context_t,default_context_t)
-@@ -277,6 +280,7 @@
- libs_use_ld_so(newrole_t)
- libs_use_shared_libs(newrole_t)
-
-+logging_send_audit_msgs(newrole_t)
- logging_send_syslog_msg(newrole_t)
-
- miscfiles_read_localization(newrole_t)
-@@ -347,6 +351,8 @@
-
- seutil_libselinux_linked(restorecond_t)
-
-+userdom_read_all_users_home_content_symlinks(restorecond_t)
-+
- ifdef(`distro_ubuntu',`
- optional_policy(`
- unconfined_domain(restorecond_t)
-@@ -365,7 +371,7 @@
- allow run_init_t self:process setexec;
- allow run_init_t self:capability setuid;
- allow run_init_t self:fifo_file rw_file_perms;
--allow run_init_t self:netlink_audit_socket { create_netlink_socket_perms nlmsg_relay };
-+logging_send_audit_msgs(run_init_t)
-
- # often the administrator runs such programs from a directory that is owned
- # by a different user or has restrictive SE permissions, do not want to audit
-@@ -396,7 +402,6 @@
-
- auth_use_nsswitch(run_init_t)
- auth_domtrans_chk_passwd(run_init_t)
--auth_domtrans_upd_passwd(run_init_t)
- auth_dontaudit_read_shadow(run_init_t)
-
- init_spec_domtrans_script(run_init_t)
-@@ -435,64 +440,22 @@
- # semodule local policy
- #
-
--allow semanage_t self:capability { dac_override audit_write };
--allow semanage_t self:unix_stream_socket create_stream_socket_perms;
--allow semanage_t self:unix_dgram_socket create_socket_perms;
--allow semanage_t self:netlink_audit_socket { create_netlink_socket_perms nlmsg_relay };
--
--allow semanage_t policy_config_t:file rw_file_perms;
--
--allow semanage_t semanage_tmp_t:dir manage_dir_perms;
--allow semanage_t semanage_tmp_t:file manage_file_perms;
--files_tmp_filetrans(semanage_t, semanage_tmp_t, { file dir })
--
--kernel_read_system_state(semanage_t)
--kernel_read_kernel_sysctls(semanage_t)
--
--corecmd_exec_bin(semanage_t)
-+seutil_semanage_policy(semanage_t)
-+allow semanage_t self:fifo_file rw_fifo_file_perms;
-
--dev_read_urand(semanage_t)
-+manage_dirs_pattern(semanage_t, selinux_var_lib_t, selinux_var_lib_t)
-+manage_files_pattern(semanage_t, selinux_var_lib_t, selinux_var_lib_t)
-
--domain_use_interactive_fds(semanage_t)
--
--files_read_etc_files(semanage_t)
--files_read_etc_runtime_files(semanage_t)
--files_read_usr_files(semanage_t)
--files_list_pids(semanage_t)
--
--mls_file_write_all_levels(semanage_t)
--mls_file_read_all_levels(semanage_t)
--
--selinux_validate_context(semanage_t)
--selinux_get_enforce_mode(semanage_t)
--selinux_getattr_fs(semanage_t)
--# for setsebool:
- selinux_set_boolean(semanage_t)
-+can_exec(semanage_t, semanage_exec_t)
-
--term_use_all_terms(semanage_t)
--
--# Running genhomedircon requires this for finding all users
--auth_use_nsswitch(semanage_t)
--
--libs_use_ld_so(semanage_t)
--libs_use_shared_libs(semanage_t)
--
--locallogin_use_fds(semanage_t)
-+# Admins are creating pp files in random locations
-+auth_read_all_files_except_shadow(semanage_t)
-
--logging_send_syslog_msg(semanage_t)
--
--miscfiles_read_localization(semanage_t)
--
--seutil_libselinux_linked(semanage_t)
- seutil_manage_file_contexts(semanage_t)
- seutil_manage_config(semanage_t)
- seutil_domtrans_setfiles(semanage_t)
--seutil_domtrans_loadpolicy(semanage_t)
--seutil_manage_bin_policy(semanage_t)
--seutil_use_newrole_fds(semanage_t)
--seutil_manage_module_store(semanage_t)
--seutil_get_semanage_trans_lock(semanage_t)
--seutil_get_semanage_read_lock(semanage_t)
-+
- # netfilter_contexts:
- seutil_manage_default_contexts(semanage_t)
-
-@@ -501,12 +464,27 @@
- files_read_var_lib_symlinks(semanage_t)
- ')
-
-+optional_policy(`
-+ setrans_initrc_domtrans(semanage_t)
-+ domain_system_change_exemption(semanage_t)
-+ consoletype_exec(semanage_t)
-+')
-+
-+optional_policy(`
-+ sysadm_search_home_dirs(semanage_t)
-+')
-+
- ifdef(`distro_ubuntu',`
- optional_policy(`
- unconfined_domain(semanage_t)
- ')
- ')
-
-+optional_policy(`
-+ #signal mcstrans on reload
-+ init_spec_domtrans_script(semanage_t)
-+')
-+
- # cjp: need a more general way to handle this:
- ifdef(`enable_mls',`
- # read secadm tmp files
-@@ -514,121 +492,42 @@
- # Handle pp files created in homedir and /tmp
- sysadm_read_home_content_files(semanage_t)
- sysadm_read_tmp_files(semanage_t)
--
-- optional_policy(`
-- unconfined_read_home_content_files(semanage_t)
-- unconfined_read_tmp_files(semanage_t)
-- ')
-+ userdom_read_unpriv_users_home_content_files(semanage_t)
-+ userdom_read_unpriv_users_tmp_files(semanage_t)
- ')
-
- ########################################
- #
--# Setfiles local policy
-+# setsebool local policy
- #
-+seutil_semanage_policy(setsebool_t)
-+selinux_set_boolean(setsebool_t)
-
--allow setfiles_t self:capability { dac_override dac_read_search fowner };
--dontaudit setfiles_t self:capability sys_tty_config;
--allow setfiles_t self:fifo_file rw_file_perms;
--
--allow setfiles_t { policy_src_t policy_config_t file_context_t default_context_t }:dir list_dir_perms;
--allow setfiles_t { policy_src_t policy_config_t file_context_t default_context_t }:file read_file_perms;
--allow setfiles_t { policy_src_t policy_config_t file_context_t default_context_t }:lnk_file { read_lnk_file_perms ioctl lock };
--
--kernel_read_system_state(setfiles_t)
--kernel_relabelfrom_unlabeled_dirs(setfiles_t)
--kernel_relabelfrom_unlabeled_files(setfiles_t)
--kernel_relabelfrom_unlabeled_symlinks(setfiles_t)
--kernel_relabelfrom_unlabeled_pipes(setfiles_t)
--kernel_relabelfrom_unlabeled_sockets(setfiles_t)
--kernel_use_fds(setfiles_t)
--kernel_rw_pipes(setfiles_t)
--kernel_rw_unix_dgram_sockets(setfiles_t)
--kernel_dontaudit_list_all_proc(setfiles_t)
--kernel_dontaudit_list_all_sysctls(setfiles_t)
--
--dev_relabel_all_dev_nodes(setfiles_t)
--
--domain_use_interactive_fds(setfiles_t)
--domain_dontaudit_search_all_domains_state(setfiles_t)
--
--files_read_etc_runtime_files(setfiles_t)
--files_read_etc_files(setfiles_t)
--files_list_all(setfiles_t)
--files_relabel_all_files(setfiles_t)
--
--fs_getattr_xattr_fs(setfiles_t)
--fs_list_all(setfiles_t)
--fs_search_auto_mountpoints(setfiles_t)
--fs_relabelfrom_noxattr_fs(setfiles_t)
--
--mls_file_read_all_levels(setfiles_t)
--mls_file_write_all_levels(setfiles_t)
--mls_file_upgrade(setfiles_t)
--mls_file_downgrade(setfiles_t)
--
--selinux_validate_context(setfiles_t)
--selinux_compute_access_vector(setfiles_t)
--selinux_compute_create_context(setfiles_t)
--selinux_compute_relabel_context(setfiles_t)
--selinux_compute_user_contexts(setfiles_t)
--
--term_use_all_user_ttys(setfiles_t)
--term_use_all_user_ptys(setfiles_t)
--term_use_unallocated_ttys(setfiles_t)
--
--# this is to satisfy the assertion:
--auth_relabelto_shadow(setfiles_t)
--
--init_use_fds(setfiles_t)
--init_use_script_fds(setfiles_t)
--init_use_script_ptys(setfiles_t)
--init_exec_script_files(setfiles_t)
--
--libs_use_ld_so(setfiles_t)
--libs_use_shared_libs(setfiles_t)
--
--logging_send_syslog_msg(setfiles_t)
--
--miscfiles_read_localization(setfiles_t)
--
--seutil_libselinux_linked(setfiles_t)
--
--userdom_use_all_users_fds(setfiles_t)
--# for config files in a home directory
--userdom_read_all_users_home_content_files(setfiles_t)
-+init_dontaudit_use_fds(setsebool_t)
-
--ifdef(`distro_debian',`
-- # udev tmpfs is populated with static device nodes
-- # and then relabeled afterwards; thus
-- # /dev/console has the tmpfs type
-- fs_rw_tmpfs_chr_files(setfiles_t)
--')
-+# Bug in semanage
-+seutil_domtrans_setfiles(setsebool_t)
-+seutil_manage_file_contexts(setsebool_t)
-+seutil_manage_default_contexts(setsebool_t)
-+seutil_manage_config(setsebool_t)
-
--ifdef(`distro_redhat', `
-- fs_rw_tmpfs_chr_files(setfiles_t)
-- fs_rw_tmpfs_blk_files(setfiles_t)
-- fs_relabel_tmpfs_blk_file(setfiles_t)
-- fs_relabel_tmpfs_chr_file(setfiles_t)
--')
-+########################################
-+#
-+# Setfiles local policy
-+#
-
--ifdef(`distro_ubuntu',`
-- optional_policy(`
-- unconfined_domain(setfiles_t)
-- ')
--')
-+seutil_setfiles(setfiles_t)
-+# During boot in Rawhide
-+term_use_generic_ptys(setfiles_t)
-
--ifdef(`hide_broken_symptoms',`
- optional_policy(`
-- udev_dontaudit_rw_dgram_sockets(setfiles_t)
-+ cron_system_entry(setfiles_t, setfiles_exec_t)
- ')
-
-- # cjp: cover up stray file descriptors.
-- optional_policy(`
-- unconfined_dontaudit_read_pipes(setfiles_t)
-- unconfined_dontaudit_rw_tcp_sockets(setfiles_t)
-- ')
--')
-+seutil_setfiles(setfiles_mac_t)
-+allow setfiles_mac_t self:capability2 mac_admin;
-+kernel_relabelto_unlabeled(setfiles_mac_t)
-
- optional_policy(`
-- hotplug_use_fds(setfiles_t)
-+ unconfined_domain(setfiles_mac_t)
- ')
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/setrans.if serefpolicy-3.5.13/policy/modules/system/setrans.if
---- nsaserefpolicy/policy/modules/system/setrans.if 2008-08-07 11:15:12.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/system/setrans.if 2008-10-28 10:56:19.000000000 -0400
-@@ -21,3 +21,23 @@
- stream_connect_pattern($1,setrans_var_run_t,setrans_var_run_t,setrans_t)
- files_list_pids($1)
- ')
-+
-+########################################
-+##
-+## Execute setrans server in the setrans domain.
-+##
-+##
-+##
-+## The type of the process performing this action.
-+##
-+##
-+#
-+#
-+interface(`setrans_initrc_domtrans',`
-+ gen_require(`
-+ type setrans_initrc_exec_t;
-+ ')
-+
-+ init_labeled_script_domtrans($1, setrans_initrc_exec_t)
-+')
-+
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/sysnetwork.fc serefpolicy-3.5.13/policy/modules/system/sysnetwork.fc
---- nsaserefpolicy/policy/modules/system/sysnetwork.fc 2008-08-07 11:15:12.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/system/sysnetwork.fc 2008-10-28 10:56:19.000000000 -0400
-@@ -11,6 +11,7 @@
- /etc/dhclient-script -- gen_context(system_u:object_r:dhcp_etc_t,s0)
- /etc/dhcpc.* gen_context(system_u:object_r:dhcp_etc_t,s0)
- /etc/dhcpd\.conf -- gen_context(system_u:object_r:dhcp_etc_t,s0)
-+/etc/hosts -- gen_context(system_u:object_r:net_conf_t,s0)
- /etc/resolv\.conf.* -- gen_context(system_u:object_r:net_conf_t,s0)
- /etc/yp\.conf.* -- gen_context(system_u:object_r:net_conf_t,s0)
-
-@@ -20,6 +21,7 @@
- ifdef(`distro_redhat',`
- /etc/sysconfig/network-scripts/.*resolv\.conf -- gen_context(system_u:object_r:net_conf_t,s0)
- /etc/sysconfig/networking/profiles/.*/resolv\.conf -- gen_context(system_u:object_r:net_conf_t,s0)
-+/etc/sysconfig/networking/profiles/.*/hosts -- gen_context(system_u:object_r:net_conf_t,s0)
- ')
-
- #
-@@ -57,3 +59,5 @@
- ifdef(`distro_gentoo',`
- /var/lib/dhcpc(/.*)? gen_context(system_u:object_r:dhcpc_state_t,s0)
- ')
-+
-+/etc/firestarter/firestarter\.sh gen_context(system_u:object_r:dhcpc_helper_exec_t,s0)
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/sysnetwork.if serefpolicy-3.5.13/policy/modules/system/sysnetwork.if
---- nsaserefpolicy/policy/modules/system/sysnetwork.if 2008-08-07 11:15:12.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/system/sysnetwork.if 2008-10-28 10:56:19.000000000 -0400
-@@ -553,6 +553,7 @@
- type net_conf_t;
- ')
-
-+ allow $1 self:netlink_route_socket r_netlink_socket_perms;
- allow $1 self:tcp_socket create_socket_perms;
- allow $1 self:udp_socket create_socket_perms;
-
-@@ -569,6 +570,10 @@
-
- files_search_etc($1)
- allow $1 net_conf_t:file read_file_perms;
-+
-+ optional_policy(`
-+ avahi_stream_connect($1)
-+ ')
- ')
-
- ########################################
-@@ -598,6 +603,8 @@
-
- files_search_etc($1)
- allow $1 net_conf_t:file read_file_perms;
-+ # LDAP Configuration using encrypted requires
-+ dev_read_urand($1)
- ')
-
- ########################################
-@@ -632,3 +639,49 @@
- files_search_etc($1)
- allow $1 net_conf_t:file read_file_perms;
- ')
-+
-+########################################
-+##
-+## Do not audit attempts to use
-+## the dhcp file descriptors.
-+##
-+##
-+##
-+## The domain sending the SIGCHLD.
-+##
-+##
-+#
-+interface(`sysnet_dontaudit_dhcpc_use_fds',`
-+ gen_require(`
-+ type dhcpc_t;
-+ ')
-+
-+ dontaudit $1 dhcpc_t:fd use;
-+')
-+
-+########################################
-+##
-+## Transition to system_r when execute an dhclient script
-+##
-+##
-+##
-+## Execute dhclient script in a specified role
-+##
-+##
-+## No interprocess communication (signals, pipes,
-+## etc.) is provided by this interface since
-+## the domains are not owned by this module.
-+##
-+##
-+##
-+##
-+## Role to transition from.
-+##
-+##
-+interface(`sysnet_role_transition_dhcpc',`
-+ gen_require(`
-+ type dhcpc_exec_t;
-+ ')
-+
-+ role_transition $1 dhcpc_exec_t system_r;
-+')
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/sysnetwork.te serefpolicy-3.5.13/policy/modules/system/sysnetwork.te
---- nsaserefpolicy/policy/modules/system/sysnetwork.te 2008-10-16 17:21:16.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/system/sysnetwork.te 2008-11-03 13:42:28.000000000 -0500
-@@ -20,6 +20,9 @@
- init_daemon_domain(dhcpc_t,dhcpc_exec_t)
- role system_r types dhcpc_t;
-
-+type dhcpc_helper_exec_t;
-+init_script_file(dhcpc_helper_exec_t)
-+
- type dhcpc_state_t;
- files_type(dhcpc_state_t)
-
-@@ -41,21 +44,22 @@
- #
- # DHCP client local policy
- #
--allow dhcpc_t self:capability { dac_override fsetid net_admin net_raw net_bind_service sys_resource sys_tty_config };
-+allow dhcpc_t self:capability { dac_override fsetid net_admin net_raw net_bind_service sys_nice sys_resource sys_tty_config };
- dontaudit dhcpc_t self:capability sys_tty_config;
- # for access("/etc/bashrc", X_OK) on Red Hat
- dontaudit dhcpc_t self:capability { dac_read_search sys_module };
--allow dhcpc_t self:process signal_perms;
--allow dhcpc_t self:fifo_file rw_file_perms;
-+allow dhcpc_t self:process { setfscreate ptrace signal_perms };
-+allow dhcpc_t self:fifo_file rw_fifo_file_perms;
- allow dhcpc_t self:tcp_socket create_stream_socket_perms;
- allow dhcpc_t self:udp_socket create_socket_perms;
- allow dhcpc_t self:packet_socket create_socket_perms;
--allow dhcpc_t self:netlink_route_socket { create_socket_perms nlmsg_read nlmsg_write };
-+allow dhcpc_t self:netlink_route_socket { create_socket_perms nlmsg_read };
-
- allow dhcpc_t dhcp_etc_t:dir list_dir_perms;
- read_lnk_files_pattern(dhcpc_t,dhcp_etc_t,dhcp_etc_t)
- exec_files_pattern(dhcpc_t,dhcp_etc_t,dhcp_etc_t)
-
-+allow dhcpc_t dhcp_state_t:file read_file_perms;
- manage_files_pattern(dhcpc_t,dhcpc_state_t,dhcpc_state_t)
- filetrans_pattern(dhcpc_t,dhcp_state_t,dhcpc_state_t,file)
-
-@@ -116,7 +120,7 @@
- corecmd_exec_shell(dhcpc_t)
-
- domain_use_interactive_fds(dhcpc_t)
--domain_dontaudit_list_all_domains_state(dhcpc_t)
-+domain_dontaudit_read_all_domains_state(dhcpc_t)
-
- files_read_etc_files(dhcpc_t)
- files_read_etc_runtime_files(dhcpc_t)
-@@ -135,8 +139,6 @@
-
- modutils_domtrans_insmod(dhcpc_t)
-
--staff_dontaudit_search_home_dirs(dhcpc_t)
--
- ifdef(`distro_redhat', `
- files_exec_etc_files(dhcpc_t)
- ')
-@@ -185,25 +187,22 @@
- ')
-
- optional_policy(`
-- nis_use_ypbind(dhcpc_t)
-- nis_signal_ypbind(dhcpc_t)
-- nis_read_ypbind_pid(dhcpc_t)
-- nis_delete_ypbind_pid(dhcpc_t)
--
-- # dhclient sometimes starts ypbind
-- init_exec_script_files(dhcpc_t)
-- nis_domtrans_ypbind(dhcpc_t)
-+ networkmanager_domtrans(dhcpc_t)
-+ networkmanager_read_pid_files(dhcpc_t)
-+')
-+
-+optional_policy(`
-+ nis_ypbind_initrc_domtrans(dhcpc_t)
- ')
-
- optional_policy(`
-+ nscd_initrc_domtrans(dhcpc_t)
- nscd_domtrans(dhcpc_t)
- nscd_read_pid(dhcpc_t)
- ')
-
- optional_policy(`
-- # dhclient sometimes starts ntpd
-- init_exec_script_files(dhcpc_t)
-- ntp_domtrans(dhcpc_t)
-+ ntp_initrc_domtrans(dhcpc_t)
- ')
-
- optional_policy(`
-@@ -214,6 +213,11 @@
- optional_policy(`
- seutil_sigchld_newrole(dhcpc_t)
- seutil_dontaudit_search_config(dhcpc_t)
-+ seutil_domtrans_setfiles(dhcpc_t)
-+')
-+
-+optional_policy(`
-+ sysadm_dontaudit_search_home_dirs(dhcpc_t)
- ')
-
- optional_policy(`
-@@ -225,6 +229,10 @@
- ')
-
- optional_policy(`
-+ vmware_append_log(dhcpc_t)
-+')
-+
-+optional_policy(`
- kernel_read_xen_state(dhcpc_t)
- kernel_write_xen_state(dhcpc_t)
- xen_append_log(dhcpc_t)
-@@ -238,7 +246,6 @@
-
- allow ifconfig_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem execheap execstack };
- allow ifconfig_t self:capability { net_raw net_admin sys_tty_config };
--dontaudit ifconfig_t self:capability sys_module;
-
- allow ifconfig_t self:fd use;
- allow ifconfig_t self:fifo_file rw_fifo_file_perms;
-@@ -252,6 +259,7 @@
- allow ifconfig_t self:sem create_sem_perms;
- allow ifconfig_t self:msgq create_msgq_perms;
- allow ifconfig_t self:msg { send receive };
-+allow ifconfig_t net_conf_t:file read_file_perms;
-
- # Create UDP sockets, necessary when called from dhcpc
- allow ifconfig_t self:udp_socket create_socket_perms;
-@@ -261,13 +269,20 @@
- allow ifconfig_t self:netlink_route_socket create_netlink_socket_perms;
- allow ifconfig_t self:netlink_xfrm_socket { create_netlink_socket_perms nlmsg_read };
- allow ifconfig_t self:tcp_socket { create ioctl };
-+
-+read_files_pattern(ifconfig_t, dhcpc_state_t, dhcpc_state_t)
-+
- files_read_etc_files(ifconfig_t);
-+files_read_etc_runtime_files(ifconfig_t);
-
- kernel_use_fds(ifconfig_t)
- kernel_read_system_state(ifconfig_t)
- kernel_read_network_state(ifconfig_t)
- kernel_search_network_sysctl(ifconfig_t)
-+kernel_search_debugfs(ifconfig_t)
- kernel_rw_net_sysctls(ifconfig_t)
-+# This should be put inside a boolean, but can not because of attributes
-+kernel_load_module(ifconfig_t)
-
- corenet_rw_tun_tap_dev(ifconfig_t)
-
-@@ -278,8 +293,13 @@
- fs_getattr_xattr_fs(ifconfig_t)
- fs_search_auto_mountpoints(ifconfig_t)
-
-+selinux_dontaudit_getattr_fs(ifconfig_t)
-+
-+term_dontaudit_use_console(ifconfig_t)
- term_dontaudit_use_all_user_ttys(ifconfig_t)
- term_dontaudit_use_all_user_ptys(ifconfig_t)
-+term_dontaudit_use_ptmx(ifconfig_t)
-+term_dontaudit_use_generic_ptys(ifconfig_t)
-
- domain_use_interactive_fds(ifconfig_t)
-
-@@ -335,6 +355,14 @@
- ')
-
- optional_policy(`
-+ unconfined_dontaudit_rw_pipes(ifconfig_t)
-+')
-+
-+optional_policy(`
-+ vmware_append_log(ifconfig_t)
-+')
-+
-+optional_policy(`
- kernel_read_xen_state(ifconfig_t)
- kernel_write_xen_state(ifconfig_t)
- xen_append_log(ifconfig_t)
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/udev.fc serefpolicy-3.5.13/policy/modules/system/udev.fc
---- nsaserefpolicy/policy/modules/system/udev.fc 2008-08-07 11:15:12.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/system/udev.fc 2008-11-03 11:39:49.000000000 -0500
-@@ -13,8 +13,11 @@
- /sbin/start_udev -- gen_context(system_u:object_r:udev_exec_t,s0)
- /sbin/udev -- gen_context(system_u:object_r:udev_exec_t,s0)
- /sbin/udevd -- gen_context(system_u:object_r:udev_exec_t,s0)
-+/sbin/udevadm -- gen_context(system_u:object_r:udev_exec_t,s0)
- /sbin/udevsend -- gen_context(system_u:object_r:udev_exec_t,s0)
- /sbin/udevstart -- gen_context(system_u:object_r:udev_exec_t,s0)
- /sbin/wait_for_sysfs -- gen_context(system_u:object_r:udev_exec_t,s0)
-
- /usr/bin/udevinfo -- gen_context(system_u:object_r:udev_exec_t,s0)
-+
-+/var/run/PackageKit/udev(/.*)? gen_context(system_u:object_r:rpm_var_run_t,s0)
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/udev.if serefpolicy-3.5.13/policy/modules/system/udev.if
---- nsaserefpolicy/policy/modules/system/udev.if 2008-08-07 11:15:12.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/system/udev.if 2008-10-28 10:56:19.000000000 -0400
-@@ -96,6 +96,24 @@
-
- ########################################
- ##
-+## dontaudit process read list of devices.
-+##
-+##
-+##
-+## The type of the process performing this action.
-+##
-+##
-+#
-+interface(`udev_dontaudit_search_db',`
-+ gen_require(`
-+ type udev_tbl_t;
-+ ')
-+
-+ dontaudit $1 udev_tbl_t:dir search_dir_perms;
-+')
-+
-+########################################
-+##
- ## Allow process to read list of devices.
- ##
- ##
-@@ -106,11 +124,13 @@
- #
- interface(`udev_read_db',`
- gen_require(`
-- type udev_tdb_t;
-+ type udev_tbl_t;
- ')
-
- dev_list_all_dev_nodes($1)
-- allow $1 udev_tdb_t:file read_file_perms;
-+ allow $1 udev_tbl_t:dir list_dir_perms;
-+ read_files_pattern($1, udev_tbl_t, udev_tbl_t)
-+ read_lnk_files_pattern($1, udev_tbl_t, udev_tbl_t)
- ')
-
- ########################################
-@@ -125,9 +145,9 @@
- #
- interface(`udev_rw_db',`
- gen_require(`
-- type udev_tdb_t;
-+ type udev_tbl_t;
- ')
-
- dev_list_all_dev_nodes($1)
-- allow $1 udev_tdb_t:file rw_file_perms;
-+ allow $1 udev_tbl_t:file rw_file_perms;
- ')
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/udev.te serefpolicy-3.5.13/policy/modules/system/udev.te
---- nsaserefpolicy/policy/modules/system/udev.te 2008-10-16 17:21:16.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/system/udev.te 2008-11-03 11:41:29.000000000 -0500
-@@ -83,6 +83,7 @@
- kernel_rw_unix_dgram_sockets(udev_t)
- kernel_dgram_send(udev_t)
- kernel_signal(udev_t)
-+kernel_search_debugfs(udev_t)
-
- #https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=235182
- kernel_rw_net_sysctls(udev_t)
-@@ -142,6 +143,7 @@
-
- logging_search_logs(udev_t)
- logging_send_syslog_msg(udev_t)
-+logging_send_audit_msgs(udev_t)
-
- miscfiles_read_localization(udev_t)
-
-@@ -189,6 +191,7 @@
-
- optional_policy(`
- alsa_domtrans(udev_t)
-+ alsa_read_lib(udev_t)
- alsa_read_rw_config(udev_t)
- ')
-
-@@ -197,6 +200,10 @@
- ')
-
- optional_policy(`
-+ clock_domtrans(udev_t)
-+')
-+
-+optional_policy(`
- consoletype_exec(udev_t)
- ')
-
-@@ -233,6 +240,10 @@
- ')
-
- optional_policy(`
-+ rpm_search_log(udev_t)
-+')
-+
-+optional_policy(`
- kernel_write_xen_state(udev_t)
- kernel_read_xen_state(udev_t)
- xen_manage_log(udev_t)
-@@ -240,5 +251,9 @@
- ')
-
- optional_policy(`
-+ unconfined_domain(udev_t)
-+')
-+
-+optional_policy(`
- xserver_read_xdm_pid(udev_t)
- ')
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/unconfined.fc serefpolicy-3.5.13/policy/modules/system/unconfined.fc
---- nsaserefpolicy/policy/modules/system/unconfined.fc 2008-09-11 16:42:49.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/system/unconfined.fc 2008-10-28 10:56:19.000000000 -0400
-@@ -2,15 +2,28 @@
- # e.g.:
- # /usr/local/bin/appsrv -- gen_context(system_u:object_r:unconfined_exec_t,s0)
- # For the time being until someone writes a sane policy, we need initrc to transition to unconfined_t
--/usr/bin/qemu.* -- gen_context(system_u:object_r:unconfined_execmem_exec_t,s0)
--/usr/bin/valgrind -- gen_context(system_u:object_r:unconfined_execmem_exec_t,s0)
--/usr/bin/vncserver -- gen_context(system_u:object_r:unconfined_exec_t,s0)
--
--/usr/lib/ia32el/ia32x_loader -- gen_context(system_u:object_r:unconfined_execmem_exec_t,s0)
--/usr/lib/openoffice\.org.*/program/.+\.bin -- gen_context(system_u:object_r:unconfined_execmem_exec_t,s0)
--
--/usr/local/RealPlayer/realplay\.bin -- gen_context(system_u:object_r:unconfined_execmem_exec_t,s0)
-+/usr/bin/valgrind -- gen_context(system_u:object_r:execmem_exec_t,s0)
-+/usr/bin/vncserver -- gen_context(system_u:object_r:unconfined_notrans_exec_t,s0)
-
-+/usr/lib/ia32el/ia32x_loader -- gen_context(system_u:object_r:execmem_exec_t,s0)
-+/usr/local/RealPlayer/realplay\.bin -- gen_context(system_u:object_r:execmem_exec_t,s0)
- ifdef(`distro_gentoo',`
--/usr/lib32/openoffice/program/[^/]+\.bin -- gen_context(system_u:object_r:unconfined_execmem_exec_t,s0)
-+/usr/lib32/openoffice/program/[^/]+\.bin -- gen_context(system_u:object_r:execmem_exec_t,s0)
- ')
-+/usr/bin/sbcl -- gen_context(system_u:object_r:execmem_exec_t,s0)
-+
-+/usr/sbin/mock -- gen_context(system_u:object_r:unconfined_notrans_exec_t,s0)
-+/usr/sbin/sysreport -- gen_context(system_u:object_r:unconfined_notrans_exec_t,s0)
-+
-+/usr/lib64/erlang/erts-[^/]+/bin/beam.smp -- gen_context(system_u:object_r:execmem_exec_t,s0)
-+/usr/lib/erlang/erts-[^/]+/bin/beam.smp -- gen_context(system_u:object_r:execmem_exec_t,s0)
-+
-+/usr/bin/haddock.* -- gen_context(system_u:object_r:unconfined_execmem_exec_t,s0)
-+/usr/bin/hasktags -- gen_context(system_u:object_r:unconfined_execmem_exec_t,s0)
-+/usr/bin/runghc -- gen_context(system_u:object_r:unconfined_execmem_exec_t,s0)
-+/usr/bin/runhaskell -- gen_context(system_u:object_r:unconfined_execmem_exec_t,s0)
-+/usr/libexec/ghc-[^/]+/.*bin -- gen_context(system_u:object_r:unconfined_execmem_exec_t,s0)
-+/usr/libexec/ghc-[^/]+/ghc-.* -- gen_context(system_u:object_r:unconfined_execmem_exec_t,s0)
-+/usr/lib(64)?/ghc-[^/]+/ghc-.* -- gen_context(system_u:object_r:unconfined_execmem_exec_t,s0)
-+
-+/opt/real/(.*/)?realplay\.bin -- gen_context(system_u:object_r:unconfined_execmem_exec_t,s0)
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/unconfined.if serefpolicy-3.5.13/policy/modules/system/unconfined.if
---- nsaserefpolicy/policy/modules/system/unconfined.if 2008-09-11 16:42:49.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/system/unconfined.if 2008-10-29 13:21:22.000000000 -0400
-@@ -12,14 +12,13 @@
- #
- interface(`unconfined_domain_noaudit',`
- gen_require(`
-- type unconfined_t;
- class dbus all_dbus_perms;
- class nscd all_nscd_perms;
- class passwd all_passwd_perms;
- ')
-
- # Use any Linux capability.
-- allow $1 self:capability *;
-+ allow $1 self:capability all_capabilities;
- allow $1 self:fifo_file manage_fifo_file_perms;
-
- # Transition to myself, to make get_ordered_context_list happy.
-@@ -27,12 +26,13 @@
-
- # Write access is for setting attributes under /proc/self/attr.
- allow $1 self:file rw_file_perms;
-+ allow $1 self:dir rw_dir_perms;
-
- # Userland object managers
-- allow $1 self:nscd *;
-- allow $1 self:dbus *;
-- allow $1 self:passwd *;
-- allow $1 self:association *;
-+ allow $1 self:nscd all_nscd_perms;
-+ allow $1 self:dbus all_dbus_perms;
-+ allow $1 self:passwd all_passwd_perms;
-+ allow $1 self:association all_association_perms;
-
- kernel_unconfined($1)
- corenet_unconfined($1)
-@@ -44,6 +44,11 @@
- fs_unconfined($1)
- selinux_unconfined($1)
-
-+ domain_mmap_low_type($1)
-+ tunable_policy(`allow_unconfined_mmap_low',`
-+ domain_mmap_low($1)
-+ ')
-+
- tunable_policy(`allow_execheap',`
- # Allow making the stack executable via mprotect.
- allow $1 self:process execheap;
-@@ -70,6 +75,7 @@
- optional_policy(`
- # Communicate via dbusd.
- dbus_system_bus_unconfined($1)
-+ dbus_unconfined($1)
- ')
-
- optional_policy(`
-@@ -380,6 +386,24 @@
-
- ########################################
- ##
-+## Send a SIGNULL signal to the unconfined execmem domain.
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+#
-+interface(`unconfined_execmem_signull',`
-+ gen_require(`
-+ type unconfined_execmem_t;
-+ ')
-+
-+ allow $1 unconfined_execmem_t:process signull;
-+')
-+
-+########################################
-+##
- ## Send generic signals to the unconfined domain.
- ##
- ##
-@@ -654,3 +678,248 @@
-
- allow $1 unconfined_tmp_t:file { getattr write append };
- ')
-+
-+########################################
-+##
-+## Allow ptrace of unconfined domain
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+#
-+interface(`unconfined_ptrace',`
-+ gen_require(`
-+ type unconfined_t;
-+ ')
-+
-+ allow $1 unconfined_t:process ptrace;
-+')
-+
-+########################################
-+##
-+## Read and write to unconfined shared memory.
-+##
-+##
-+##
-+## The type of the process performing this action.
-+##
-+##
-+#
-+interface(`unconfined_rw_shm',`
-+ gen_require(`
-+ type unconfined_t;
-+ ')
-+
-+ allow $1 unconfined_t:shm rw_shm_perms;
-+')
-+
-+########################################
-+##
-+## Read and write to unconfined execmem shared memory.
-+##
-+##
-+##
-+## The type of the process performing this action.
-+##
-+##
-+#
-+interface(`unconfined_execmem_rw_shm',`
-+ gen_require(`
-+ type unconfined_execmem_t;
-+ ')
-+
-+ allow $1 unconfined_execmem_t:shm rw_shm_perms;
-+')
-+
-+########################################
-+##
-+## Transition to the unconfined_execmem domain.
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+#
-+interface(`unconfined_execmem_domtrans',`
-+
-+ gen_require(`
-+ type unconfined_execmem_t, execmem_exec_t;
-+ ')
-+
-+ domtrans_pattern($1, execmem_exec_t, unconfined_execmem_t)
-+')
-+
-+########################################
-+##
-+## allow attempts to use unconfined ttys and ptys.
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+#
-+interface(`unconfined_use_terms',`
-+ gen_require(`
-+ type unconfined_devpts_t;
-+ type unconfined_tty_device_t;
-+ ')
-+
-+ allow $1 unconfined_tty_device_t:chr_file rw_term_perms;
-+ allow $1 unconfined_devpts_t:chr_file rw_term_perms;
-+')
-+
-+########################################
-+##
-+## Do not audit attempts to use unconfined ttys and ptys.
-+##
-+##
-+##
-+## Domain to not audit.
-+##
-+##
-+#
-+interface(`unconfined_dontaudit_use_terms',`
-+ gen_require(`
-+ type unconfined_devpts_t;
-+ type unconfined_tty_device_t;
-+ ')
-+
-+ dontaudit $1 unconfined_tty_device_t:chr_file rw_term_perms;
-+ dontaudit $1 unconfined_devpts_t:chr_file rw_term_perms;
-+')
-+
-+########################################
-+##
-+## Allow apps to set rlimits on userdomain
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+#
-+interface(`unconfined_set_rlimitnh',`
-+ gen_require(`
-+ type unconfined_t;
-+ ')
-+
-+ allow $1 unconfined_t:process rlimitinh;
-+')
-+
-+########################################
-+##
-+## Read/write unconfined tmpfs files.
-+##
-+##
-+##
-+## Read/write unconfined tmpfs files.
-+##
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+#
-+interface(`unconfined_rw_tmpfs_files',`
-+ gen_require(`
-+ type unconfined_tmpfs_t;
-+ ')
-+
-+ fs_search_tmpfs($1)
-+ allow $1 unconfined_tmpfs_t:dir list_dir_perms;
-+ rw_files_pattern($1, unconfined_tmpfs_t, unconfined_tmpfs_t)
-+ read_lnk_files_pattern($1, unconfined_tmpfs_t, unconfined_tmpfs_t)
-+')
-+
-+########################################
-+##
-+## Delete unconfined tmpfs files.
-+##
-+##
-+##
-+## Read/write unconfined tmpfs files.
-+##
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+#
-+interface(`unconfined_delete_tmpfs_files',`
-+ gen_require(`
-+ type unconfined_tmpfs_t;
-+ ')
-+
-+ fs_search_tmpfs($1)
-+ allow $1 unconfined_tmpfs_t:dir list_dir_perms;
-+ delete_files_pattern($1, unconfined_tmpfs_t, unconfined_tmpfs_t)
-+ read_lnk_files_pattern($1, unconfined_tmpfs_t, unconfined_tmpfs_t)
-+')
-+
-+########################################
-+##
-+## Get the process group of unconfined.
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+#
-+interface(`unconfined_getpgid',`
-+ gen_require(`
-+ type unconfined_t;
-+ ')
-+
-+ allow $1 unconfined_t:process getpgid;
-+')
-+
-+########################################
-+##
-+## Change to the unconfined role.
-+##
-+##
-+##
-+## The prefix of the user role (e.g., user
-+## is the prefix for user_r).
-+##
-+##
-+##
-+#
-+template(`unconfined_role_change_template',`
-+ userdom_role_change_template($1, unconfined)
-+')
-+
-+########################################
-+##
-+## Change from the unconfined role.
-+##
-+##
-+##
-+## Change from the unconfined role to
-+## the specified role.
-+##
-+##
-+## This is a template to support third party modules
-+## and its use is not allowed in upstream reference
-+## policy.
-+##
-+##
-+##
-+##
-+## The prefix of the user role (e.g., user
-+## is the prefix for user_r).
-+##
-+##
-+##
-+#
-+template(`unconfined_role_change_to_template',`
-+ userdom_role_change_template(unconfined, $1)
-+')
-+
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/unconfined.te serefpolicy-3.5.13/policy/modules/system/unconfined.te
---- nsaserefpolicy/policy/modules/system/unconfined.te 2008-10-14 11:58:09.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/system/unconfined.te 2008-10-28 11:00:08.000000000 -0400
-@@ -6,35 +6,76 @@
- # Declarations
- #
-
-+##
-+##
-+## Transition to confined nsplugin domains from unconfined user
-+##
-+##
-+gen_tunable(allow_unconfined_nsplugin_transition, false)
-+
-+##
-+##
-+## Allow unconfined domain to map low memory in the kernel
-+##
-+##
-+gen_tunable(allow_unconfined_mmap_low, false)
-+
-+##
-+##
-+## Transition to confined qemu domains from unconfined user
-+##
-+##
-+gen_tunable(allow_unconfined_qemu_transition, false)
-+
- # usage in this module of types created by these
- # calls is not correct, however we dont currently
- # have another method to add access to these types
--userdom_base_user_template(unconfined)
--userdom_manage_home_template(unconfined)
--userdom_manage_tmp_template(unconfined)
--userdom_manage_tmpfs_template(unconfined)
-+userdom_restricted_user_template(unconfined)
-+#userdom_common_user_template(unconfined)
-+#userdom_xwindows_client_template(unconfined)
-
- type unconfined_exec_t;
- init_system_domain(unconfined_t, unconfined_exec_t)
-+role unconfined_r types unconfined_t;
-+
-+domain_user_exemption_target(unconfined_t)
-+allow system_r unconfined_r;
-+allow unconfined_r system_r;
-+init_script_role_transition(unconfined_r)
-+role system_r types unconfined_t;
-
- type unconfined_execmem_t;
--type unconfined_execmem_exec_t;
--init_system_domain(unconfined_execmem_t, unconfined_execmem_exec_t)
-+type execmem_exec_t;
-+init_system_domain(unconfined_execmem_t, execmem_exec_t)
- role unconfined_r types unconfined_execmem_t;
-+typealias execmem_exec_t alias unconfined_execmem_exec_t;
-+
-+type unconfined_notrans_t;
-+type unconfined_notrans_exec_t;
-+init_system_domain(unconfined_notrans_t, unconfined_notrans_exec_t)
-+role unconfined_r types unconfined_notrans_t;
-
- ########################################
- #
- # Local policy
- #
-
--domtrans_pattern(unconfined_t, unconfined_execmem_exec_t, unconfined_execmem_t)
-+dontaudit unconfined_t self:dir write;
-+
-+allow unconfined_t self:system syslog_read;
-+dontaudit unconfined_t self:capability sys_module;
-+
-+domtrans_pattern(unconfined_t, execmem_exec_t, unconfined_execmem_t)
-
- files_create_boot_flag(unconfined_t)
-+files_create_default_dir(unconfined_t)
-
- mcs_killall(unconfined_t)
- mcs_ptrace_all(unconfined_t)
-
- init_run_daemon(unconfined_t, unconfined_r, { unconfined_devpts_t unconfined_tty_device_t })
-+init_domtrans_script(unconfined_t)
-+init_chat(unconfined_t)
-
- libs_run_ldconfig(unconfined_t, unconfined_r, { unconfined_devpts_t unconfined_tty_device_t })
-
-@@ -42,28 +83,39 @@
- logging_run_auditctl(unconfined_t, unconfined_r, { unconfined_devpts_t unconfined_tty_device_t })
-
- mount_run_unconfined(unconfined_t, unconfined_r, { unconfined_devpts_t unconfined_tty_device_t })
-+# Unconfined running as system_r
-+mount_domtrans_unconfined(unconfined_t)
-
-+seutil_run_setsebool(unconfined_t, unconfined_r, { unconfined_devpts_t unconfined_tty_device_t })
- seutil_run_setfiles(unconfined_t, unconfined_r, { unconfined_devpts_t unconfined_tty_device_t })
- seutil_run_semanage(unconfined_t, unconfined_r, { unconfined_devpts_t unconfined_tty_device_t })
-
- unconfined_domain(unconfined_t)
-+domain_mmap_low(unconfined_t)
-
- userdom_priveleged_home_dir_manager(unconfined_t)
-
-+optional_policy(`
-+ nsplugin_per_role_template_notrans(unconfined, unconfined_t, unconfined_r)
-+ tunable_policy(`allow_unconfined_nsplugin_transition',`
-+ nsplugin_domtrans_user(unconfined, unconfined_execmem_t)
-+ nsplugin_domtrans_user_config(unconfined, unconfined_execmem_t)
-+ nsplugin_domtrans_user(unconfined, unconfined_t)
-+ nsplugin_domtrans_user_config(unconfined, unconfined_t)
-+ ')
-+')
-+
- ifdef(`distro_gentoo',`
- seutil_run_runinit(unconfined_t, unconfined_r, { unconfined_tty_device_t unconfined_devpts_t })
- seutil_init_script_run_runinit(unconfined_t, unconfined_r, { unconfined_tty_device_t unconfined_devpts_t })
- ')
-
- optional_policy(`
-- ada_domtrans(unconfined_t)
-+ ada_run(unconfined_t, unconfined_r, { unconfined_devpts_t unconfined_tty_device_t })
- ')
-
- optional_policy(`
- apache_run_helper(unconfined_t, unconfined_r, { unconfined_devpts_t unconfined_tty_device_t })
-- apache_per_role_template(unconfined, unconfined_t, unconfined_r)
-- # this is disallowed usage:
-- unconfined_domain(httpd_unconfined_script_t)
- ')
-
- optional_policy(`
-@@ -75,12 +127,6 @@
- ')
-
- optional_policy(`
-- cron_per_role_template(unconfined, unconfined_t, unconfined_r)
-- # this is disallowed usage:
-- unconfined_domain(unconfined_crond_t)
--')
--
--optional_policy(`
- init_dbus_chat_script(unconfined_t)
-
- dbus_stub(unconfined_t)
-@@ -106,12 +152,24 @@
- ')
-
- optional_policy(`
-+ gnomeclock_dbus_chat(unconfined_t)
-+ ')
-+
-+ optional_policy(`
-+ kerneloops_dbus_chat(unconfined_t)
-+')
-+
-+optional_policy(`
- networkmanager_dbus_chat(unconfined_t)
- ')
-
- optional_policy(`
- oddjob_dbus_chat(unconfined_t)
- ')
-+
-+optional_policy(`
-+ vpnc_dbus_chat(unconfined_t)
-+ ')
- ')
-
- optional_policy(`
-@@ -123,31 +181,33 @@
- ')
-
- optional_policy(`
-- inn_domtrans(unconfined_t)
-+ iptables_run(unconfined_t, unconfined_r, { unconfined_devpts_t unconfined_tty_device_t })
- ')
-
- optional_policy(`
-- java_domtrans(unconfined_t)
-+ java_run(unconfined_t, unconfined_r, { unconfined_devpts_t unconfined_tty_device_t })
- ')
-
- optional_policy(`
-- lpd_run_checkpc(unconfined_t, unconfined_r, { unconfined_devpts_t unconfined_tty_device_t })
-+ kismet_run(unconfined_t, unconfined_r, { unconfined_tty_device_t unconfined_devpts_t })
- ')
-
- optional_policy(`
-- modutils_run_update_mods(unconfined_t, unconfined_r, { unconfined_devpts_t unconfined_tty_device_t })
-+ livecd_run(unconfined_t, unconfined_r, { unconfined_devpts_t unconfined_tty_device_t })
- ')
-
- optional_policy(`
-- mono_domtrans(unconfined_t)
-+ lpd_run_checkpc(unconfined_t, unconfined_r, { unconfined_devpts_t unconfined_tty_device_t })
- ')
-
- optional_policy(`
-- mta_per_role_template(unconfined, unconfined_t, unconfined_r)
-+ modutils_run_update_mods(unconfined_t, unconfined_r, { unconfined_devpts_t unconfined_tty_device_t })
- ')
-
- optional_policy(`
-- oddjob_domtrans_mkhomedir(unconfined_t)
-+ mono_per_role_template(unconfined, unconfined_t, unconfined_r)
-+ unconfined_domain(unconfined_mono_t)
-+ role system_r types unconfined_mono_t;
- ')
-
- optional_policy(`
-@@ -159,43 +219,48 @@
- ')
-
- optional_policy(`
-- postfix_per_role_template(unconfined, unconfined_t, unconfined_r)
-- postfix_run_map(unconfined_t, unconfined_r, { unconfined_devpts_t unconfined_tty_device_t })
-- # cjp: this should probably be removed:
-- postfix_domtrans_master(unconfined_t)
--')
-+ qemu_per_role_template_notrans(unconfined, unconfined_t, unconfined_r)
-
--
--optional_policy(`
-- pyzor_per_role_template(unconfined)
-+ tunable_policy(`allow_unconfined_qemu_transition',`
-+ qemu_runas(unconfined_t, unconfined_r, { unconfined_devpts_t unconfined_tty_device_t })
-+ ',`
-+ qemu_runas_unconfined(unconfined_t, unconfined_r, { unconfined_devpts_t unconfined_tty_device_t })
- ')
--
--optional_policy(`
-- qmail_per_role_template(unconfined, unconfined_t, unconfined_r)
-+ qemu_role(unconfined_r)
-+ qemu_unconfined_role(unconfined_r)
- ')
-
- optional_policy(`
-- # cjp: this should probably be removed:
-- rpc_domtrans_nfsd(unconfined_t)
-+ rpm_run(unconfined_t, unconfined_r, { unconfined_devpts_t unconfined_tty_device_t })
-+ # Allow SELinux aware applications to request rpm_script execution
-+ rpm_transition_script(unconfined_t)
-+ rpm_role_transition(unconfined_r)
- ')
-
- optional_policy(`
-- rpm_run(unconfined_t, unconfined_r, { unconfined_devpts_t unconfined_tty_device_t })
-+ cron_per_role_template(unconfined, unconfined_t, unconfined_r)
-+ # this is disallowed usage:
-+ unconfined_domain(unconfined_crond_t)
-+ unconfined_domain(unconfined_crontab_t)
-+ role system_r types unconfined_crontab_t;
-+ rpm_transition_script(unconfined_crond_t)
- ')
-
- optional_policy(`
- samba_per_role_template(unconfined)
-- samba_run_net(unconfined_t, unconfined_r, { unconfined_devpts_t unconfined_tty_device_t })
-+ samba_run_unconfined_net(unconfined_t, unconfined_r, { unconfined_devpts_t unconfined_tty_device_t })
- samba_run_winbind_helper(unconfined_t, unconfined_r, { unconfined_devpts_t unconfined_tty_device_t })
-+ samba_run_smbcontrol(unconfined_t, unconfined_r, { unconfined_devpts_t unconfined_tty_device_t })
- ')
-
- optional_policy(`
-- spamassassin_per_role_template(unconfined, unconfined_t, unconfined_r)
-+ sendmail_run_unconfined(unconfined_t, unconfined_r, { unconfined_devpts_t unconfined_tty_device_t })
- ')
-
- optional_policy(`
- sysnet_run_dhcpc(unconfined_t, unconfined_r, { unconfined_devpts_t unconfined_tty_device_t })
- sysnet_dbus_chat_dhcpc(unconfined_t)
-+ sysnet_role_transition_dhcpc(unconfined_r)
- ')
-
- optional_policy(`
-@@ -203,7 +268,7 @@
- ')
-
- optional_policy(`
-- usermanage_run_admin_passwd(unconfined_t, unconfined_r, { unconfined_devpts_t unconfined_tty_device_t })
-+ vbetool_run(unconfined_t, unconfined_r, { unconfined_tty_device_t unconfined_devpts_t })
- ')
-
- optional_policy(`
-@@ -215,11 +280,12 @@
- ')
-
- optional_policy(`
-- wine_domtrans(unconfined_t)
-+ wine_run(unconfined_t, unconfined_r, { unconfined_devpts_t unconfined_tty_device_t })
- ')
-
- optional_policy(`
-- xserver_domtrans_xdm_xserver(unconfined_t)
-+ xserver_run_xdm_xserver(unconfined_t, unconfined_r, { unconfined_devpts_t unconfined_tty_device_t })
-+ xserver_rw_xdm_xserver_shm(unconfined_t)
- ')
-
- ########################################
-@@ -229,14 +295,58 @@
-
- allow unconfined_execmem_t self:process { execstack execmem };
- unconfined_domain_noaudit(unconfined_execmem_t)
-+allow unconfined_execmem_t unconfined_t:process transition;
-
- optional_policy(`
-- dbus_stub(unconfined_execmem_t)
--
- init_dbus_chat_script(unconfined_execmem_t)
-+ dbus_system_bus_client_template(unconfined_execmem, unconfined_execmem_t)
- unconfined_dbus_chat(unconfined_execmem_t)
-+ unconfined_dbus_connect(unconfined_execmem_t)
-+')
-+
-+optional_policy(`
-+ avahi_dbus_chat(unconfined_execmem_t)
-+')
-
- optional_policy(`
- hal_dbus_chat(unconfined_execmem_t)
- ')
-+
-+optional_policy(`
-+ xserver_rw_xdm_xserver_shm(unconfined_execmem_t)
- ')
-+
-+########################################
-+#
-+# Unconfined notrans Local policy
-+#
-+
-+allow unconfined_notrans_t self:process { execstack execmem };
-+unconfined_domain_noaudit(unconfined_notrans_t)
-+domtrans_pattern(unconfined_t, unconfined_notrans_exec_t, unconfined_notrans_t)
-+# Allow SELinux aware applications to request rpm_script execution
-+rpm_transition_script(unconfined_notrans_t)
-+domain_ptrace_all_domains(unconfined_notrans_t)
-+
-+optional_policy(`
-+ gen_require(`
-+ type mplayer_exec_t;
-+ ')
-+ domtrans_pattern(unconfined_t, mplayer_exec_t, unconfined_execmem_t)
-+')
-+
-+tunable_policy(`allow_unconfined_nsplugin_transition',`', `
-+ gen_require(`
-+ type mozilla_exec_t;
-+ ')
-+ domtrans_pattern(unconfined_t, mozilla_exec_t, unconfined_execmem_t)
-+')
-+
-+optional_policy(`
-+ gen_require(`
-+ type openoffice_exec_t;
-+ ')
-+ domtrans_pattern(unconfined_t, openoffice_exec_t, unconfined_execmem_t)
-+')
-+
-+gen_user(unconfined_u, user, unconfined_r system_r, s0, s0 - mls_systemhigh, mcs_allcats)
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdomain.fc serefpolicy-3.5.13/policy/modules/system/userdomain.fc
---- nsaserefpolicy/policy/modules/system/userdomain.fc 2008-08-07 11:15:12.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/system/userdomain.fc 2008-10-28 10:56:19.000000000 -0400
-@@ -1,4 +1,5 @@
--HOME_DIR -d gen_context(system_u:object_r:ROLE_home_dir_t,s0-mls_systemhigh)
--HOME_DIR/.+ gen_context(system_u:object_r:ROLE_home_t,s0)
--
--/tmp/gconfd-USER -d gen_context(system_u:object_r:ROLE_tmp_t,s0)
-+HOME_DIR -d gen_context(system_u:object_r:user_home_dir_t,s0-mls_systemhigh)
-+HOME_DIR -l gen_context(system_u:object_r:user_home_dir_t,s0-mls_systemhigh)
-+HOME_DIR/.+ gen_context(system_u:object_r:user_home_t,s0)
-+/tmp/gconfd-USER -d gen_context(system_u:object_r:user_tmp_t,s0)
-+/root(/.*)? gen_context(system_u:object_r:admin_home_t,s0)
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdomain.if serefpolicy-3.5.13/policy/modules/system/userdomain.if
---- nsaserefpolicy/policy/modules/system/userdomain.if 2008-08-07 11:15:12.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/system/userdomain.if 2008-11-03 17:15:19.000000000 -0500
-@@ -28,10 +28,14 @@
- class context contains;
- ')
-
-- attribute $1_file_type;
-+ attribute $1_usertype;
-
-- type $1_t, userdomain;
-+ type $1_t, userdomain, $1_usertype;
- domain_type($1_t)
-+ ifndef(`enable_mls',`
-+ # ignore user componant labeling on homedir entry
-+ domain_obj_id_change_exemption($1_t)
-+ ')
- corecmd_shell_entry_type($1_t)
- corecmd_bin_entry_type($1_t)
- domain_user_exemption_target($1_t)
-@@ -45,66 +49,82 @@
- type $1_tty_device_t;
- term_user_tty($1_t,$1_tty_device_t)
-
-- allow $1_t self:process { signal_perms getsched setsched share getpgid setpgid setcap getsession getattr };
-- allow $1_t self:fd use;
-- allow $1_t self:fifo_file rw_fifo_file_perms;
-- allow $1_t self:unix_dgram_socket { create_socket_perms sendto };
-- allow $1_t self:unix_stream_socket { create_stream_socket_perms connectto };
-- allow $1_t self:shm create_shm_perms;
-- allow $1_t self:sem create_sem_perms;
-- allow $1_t self:msgq create_msgq_perms;
-- allow $1_t self:msg { send receive };
-- allow $1_t self:context contains;
-- dontaudit $1_t self:socket create;
-+ allow $1_usertype $1_usertype:process { ptrace signal_perms getsched setsched share getpgid setpgid getcap setcap getsession getattr };
-+ allow $1_usertype $1_usertype:fd use;
-+ allow $1_usertype $1_t:key { create view read write search link setattr };
-+
-+ allow $1_usertype $1_usertype:fifo_file rw_fifo_file_perms;
-+ allow $1_usertype $1_usertype:unix_dgram_socket { create_socket_perms sendto };
-+ allow $1_usertype $1_usertype:unix_stream_socket { create_stream_socket_perms connectto };
-+ allow $1_usertype $1_usertype:shm create_shm_perms;
-+ allow $1_usertype $1_usertype:sem create_sem_perms;
-+ allow $1_usertype $1_usertype:msgq create_msgq_perms;
-+ allow $1_usertype $1_usertype:msg { send receive };
-+ allow $1_usertype $1_usertype:context contains;
-+ dontaudit $1_usertype $1_usertype:socket create;
-
-- allow $1_t $1_devpts_t:chr_file { setattr ioctl read getattr lock write append };
-- term_create_pty($1_t,$1_devpts_t)
-+ allow $1_usertype $1_devpts_t:chr_file { setattr ioctl read getattr lock write append };
-+ term_create_pty($1_usertype, $1_devpts_t)
-
-- allow $1_t $1_tty_device_t:chr_file { setattr rw_chr_file_perms };
-+ allow $1_usertype $1_tty_device_t:chr_file { setattr rw_chr_file_perms };
-
-- kernel_read_kernel_sysctls($1_t)
-- kernel_dontaudit_list_unlabeled($1_t)
-- kernel_dontaudit_getattr_unlabeled_files($1_t)
-- kernel_dontaudit_getattr_unlabeled_symlinks($1_t)
-- kernel_dontaudit_getattr_unlabeled_pipes($1_t)
-- kernel_dontaudit_getattr_unlabeled_sockets($1_t)
-- kernel_dontaudit_getattr_unlabeled_blk_files($1_t)
-- kernel_dontaudit_getattr_unlabeled_chr_files($1_t)
-+ application_exec_all($1_usertype)
-
-- dev_dontaudit_getattr_all_blk_files($1_t)
-- dev_dontaudit_getattr_all_chr_files($1_t)
-+ files_exec_usr_files($1_t)
-+
-+ kernel_read_kernel_sysctls($1_usertype)
-+ kernel_read_all_sysctls($1_usertype)
-+
-+ kernel_dontaudit_list_unlabeled($1_usertype)
-+ kernel_dontaudit_getattr_unlabeled_files($1_usertype)
-+ kernel_dontaudit_getattr_unlabeled_symlinks($1_usertype)
-+ kernel_dontaudit_getattr_unlabeled_pipes($1_usertype)
-+ kernel_dontaudit_getattr_unlabeled_sockets($1_usertype)
-+ kernel_dontaudit_getattr_unlabeled_blk_files($1_usertype)
-+ kernel_dontaudit_getattr_unlabeled_chr_files($1_usertype)
-+ kernel_dontaudit_list_proc($1_usertype)
-
- # When the user domain runs ps, there will be a number of access
- # denials when ps tries to search /proc. Do not audit these denials.
-- domain_dontaudit_read_all_domains_state($1_t)
-- domain_dontaudit_getattr_all_domains($1_t)
-- domain_dontaudit_getsession_all_domains($1_t)
--
-- files_read_etc_files($1_t)
-- files_read_etc_runtime_files($1_t)
-- files_read_usr_files($1_t)
-+ domain_dontaudit_read_all_domains_state($1_usertype)
-+ domain_dontaudit_getattr_all_domains($1_usertype)
-+ domain_dontaudit_getsession_all_domains($1_usertype)
-+
-+ files_read_etc_files($1_usertype)
-+ files_read_mnt_files($1_usertype)
-+ files_read_etc_runtime_files($1_usertype)
-+ files_read_usr_files($1_usertype)
- # Read directories and files with the readable_t type.
- # This type is a general type for "world"-readable files.
-- files_list_world_readable($1_t)
-- files_read_world_readable_files($1_t)
-- files_read_world_readable_symlinks($1_t)
-- files_read_world_readable_pipes($1_t)
-- files_read_world_readable_sockets($1_t)
-+ files_list_world_readable($1_usertype)
-+ files_read_world_readable_files($1_usertype)
-+ files_read_world_readable_symlinks($1_usertype)
-+ files_read_world_readable_pipes($1_usertype)
-+ files_read_world_readable_sockets($1_usertype)
- # old broswer_domain():
-- files_dontaudit_list_non_security($1_t)
-- files_dontaudit_getattr_non_security_files($1_t)
-- files_dontaudit_getattr_non_security_symlinks($1_t)
-- files_dontaudit_getattr_non_security_pipes($1_t)
-- files_dontaudit_getattr_non_security_sockets($1_t)
--
-- libs_use_ld_so($1_t)
-- libs_use_shared_libs($1_t)
-- libs_exec_ld_so($1_t)
-+ files_dontaudit_getattr_all_dirs($1_usertype)
-+ files_dontaudit_list_non_security($1_usertype)
-+ files_dontaudit_getattr_non_security_files($1_usertype)
-+ files_dontaudit_getattr_non_security_symlinks($1_usertype)
-+ files_dontaudit_getattr_non_security_pipes($1_usertype)
-+ files_dontaudit_getattr_non_security_sockets($1_usertype)
-+
-+ dev_dontaudit_getattr_all_blk_files($1_usertype)
-+ dev_dontaudit_getattr_all_chr_files($1_usertype)
-+ dev_getattr_mtrr_dev($1_t)
-+
-+ storage_rw_fuse($1_usertype)
-
-- miscfiles_read_localization($1_t)
-- miscfiles_read_certs($1_t)
-+ auth_use_nsswitch($1_usertype)
-
-- sysnet_read_config($1_t)
-+ libs_use_ld_so($1_usertype)
-+ libs_use_shared_libs($1_usertype)
-+ libs_exec_ld_so($1_usertype)
-+
-+ miscfiles_read_certs($1_usertype)
-+ miscfiles_read_localization($1_usertype)
-+ miscfiles_read_man_pages($1_usertype)
-+ miscfiles_read_public_files($1_usertype)
-
- tunable_policy(`allow_execmem',`
- # Allow loading DSOs that require executable stack.
-@@ -115,6 +135,11 @@
- # Allow making the stack executable via mprotect.
- allow $1_t self:process execstack;
- ')
-+
-+ optional_policy(`
-+ ssh_rw_stream_sockets($1_usertype)
-+ ssh_delete_tmp($1_t)
-+ ')
- ')
-
- #######################################
-@@ -141,33 +166,13 @@
- #
- template(`userdom_ro_home_template',`
- gen_require(`
-- attribute home_type, home_dir_type, $1_file_type;
-+ type user_home_t, user_home_dir_t;
- ')
-
-- # type for contents of home directory
-- type $1_home_t, $1_file_type, home_type;
-- files_type($1_home_t)
-- files_associate_tmp($1_home_t)
-- fs_associate_tmpfs($1_home_t)
-- files_mountpoint($1_home_t)
--
-- # type of home directory
-- type $1_home_dir_t, home_dir_type, home_type;
-- files_type($1_home_dir_t)
-- files_mountpoint($1_home_dir_t)
-- files_associate_tmp($1_home_dir_t)
-- fs_associate_tmpfs($1_home_dir_t)
-- files_poly_member($1_home_dir_t)
--
-- ##############################
-- #
-- # User home directory file rules
-- #
--
-- allow $1_file_type $1_home_t:filesystem associate;
--
-- # Rules used to associate a homedir as a mountpoint
-- allow $1_home_t self:filesystem associate;
-+ ifelse(`$1',`user',`',`
-+ typealias user_home_t alias $1_home_t;
-+ typealias user_home_dir_t alias $1_home_dir_t;
-+ ')
-
- ##############################
- #
-@@ -175,13 +180,14 @@
- #
-
- # read-only home directory
-- allow $1_t $1_home_dir_t:dir list_dir_perms;
-- allow $1_t $1_home_t:dir list_dir_perms;
-- allow $1_t $1_home_t:file entrypoint;
-- read_files_pattern($1_t,{ $1_home_t $1_home_dir_t },$1_home_t)
-- read_lnk_files_pattern($1_t,{ $1_home_t $1_home_dir_t },$1_home_t)
-- read_fifo_files_pattern($1_t,{ $1_home_t $1_home_dir_t },$1_home_t)
-- read_sock_files_pattern($1_t,{ $1_home_t $1_home_dir_t },$1_home_t)
-+ allow $1_t user_home_dir_t:dir list_dir_perms;
-+ allow $1_t user_home_t:dir list_dir_perms;
-+ allow $1_t user_home_t:file entrypoint;
-+
-+ read_files_pattern($1_t, { user_home_t user_home_dir_t }, user_home_t)
-+ read_lnk_files_pattern($1_t, { user_home_t user_home_dir_t }, user_home_t)
-+ read_fifo_files_pattern($1_t, { user_home_t user_home_dir_t }, user_home_t)
-+ read_sock_files_pattern($1_t, { user_home_t user_home_dir_t }, user_home_t)
- files_list_home($1_t)
-
- tunable_policy(`use_nfs_home_dirs',`
-@@ -190,9 +196,6 @@
- fs_read_nfs_symlinks($1_t)
- fs_read_nfs_named_sockets($1_t)
- fs_read_nfs_named_pipes($1_t)
-- ',`
-- fs_dontaudit_list_nfs($1_t)
-- fs_dontaudit_read_nfs_files($1_t)
- ')
-
- tunable_policy(`use_samba_home_dirs',`
-@@ -201,9 +204,6 @@
- fs_read_cifs_symlinks($1_t)
- fs_read_cifs_named_sockets($1_t)
- fs_read_cifs_named_pipes($1_t)
-- ',`
-- fs_dontaudit_list_cifs($1_t)
-- fs_dontaudit_read_cifs_files($1_t)
- ')
- ')
-
-@@ -231,30 +231,14 @@
- #
- template(`userdom_manage_home_template',`
- gen_require(`
-- attribute home_type, home_dir_type, $1_file_type;
-+ attribute home_type, home_dir_type, user_home_type;
-+ type user_home_t, user_home_dir_t;
- ')
-
-- # type for contents of home directory
-- type $1_home_t, $1_file_type, home_type;
-- files_type($1_home_t)
-- files_associate_tmp($1_home_t)
-- fs_associate_tmpfs($1_home_t)
--
-- # type of home directory
-- type $1_home_dir_t, home_dir_type, home_type;
-- files_type($1_home_dir_t)
-- files_associate_tmp($1_home_dir_t)
-- fs_associate_tmpfs($1_home_dir_t)
--
-- ##############################
-- #
-- # User home directory file rules
-- #
--
-- allow $1_file_type $1_home_t:filesystem associate;
--
-- # Rules used to associate a homedir as a mountpoint
-- allow $1_home_t self:filesystem associate;
-+ ifelse(`$1',`user',`',`
-+ typealias user_home_t alias $1_home_t;
-+ typealias user_home_dir_t alias $1_home_dir_t;
-+ ')
-
- ##############################
- #
-@@ -262,43 +246,44 @@
- #
-
- # full control of the home directory
-- allow $1_t $1_home_t:file entrypoint;
-- manage_dirs_pattern($1_t,{ $1_home_dir_t $1_home_t },$1_home_t)
-- manage_files_pattern($1_t,{ $1_home_dir_t $1_home_t },$1_home_t)
-- manage_lnk_files_pattern($1_t,{ $1_home_dir_t $1_home_t },$1_home_t)
-- manage_sock_files_pattern($1_t,{ $1_home_dir_t $1_home_t },$1_home_t)
-- manage_fifo_files_pattern($1_t,{ $1_home_dir_t $1_home_t },$1_home_t)
-- relabel_dirs_pattern($1_t,{ $1_home_dir_t $1_home_t },$1_home_t)
-- relabel_files_pattern($1_t,{ $1_home_dir_t $1_home_t },$1_home_t)
-- relabel_lnk_files_pattern($1_t,{ $1_home_dir_t $1_home_t },$1_home_t)
-- relabel_sock_files_pattern($1_t,{ $1_home_dir_t $1_home_t },$1_home_t)
-- relabel_fifo_files_pattern($1_t,{ $1_home_dir_t $1_home_t },$1_home_t)
-- filetrans_pattern($1_t,$1_home_dir_t,$1_home_t,{ dir file lnk_file sock_file fifo_file })
-- files_list_home($1_t)
-+ allow $1_t user_home_t:dir mounton;
-+ allow $1_t user_home_t:file entrypoint;
-+
-+ allow $1_usertype user_home_type:dir_file_class_set { relabelto relabelfrom };
-+ manage_dirs_pattern($1_usertype, { user_home_dir_t user_home_t }, user_home_type)
-+ manage_files_pattern($1_usertype, { user_home_dir_t user_home_t }, user_home_type)
-+ manage_lnk_files_pattern($1_usertype, { user_home_dir_t user_home_t }, user_home_type)
-+ manage_sock_files_pattern($1_usertype, { user_home_dir_t user_home_t }, user_home_type)
-+ manage_fifo_files_pattern($1_usertype, { user_home_dir_t user_home_t }, user_home_type)
-+ relabel_dirs_pattern($1_usertype, { user_home_dir_t user_home_t }, user_home_type)
-+ relabel_files_pattern($1_usertype, { user_home_dir_t user_home_t }, user_home_type)
-+ relabel_lnk_files_pattern($1_usertype, { user_home_dir_t user_home_t }, user_home_type)
-+ relabel_sock_files_pattern($1_usertype, { user_home_dir_t user_home_t }, user_home_type)
-+ relabel_fifo_files_pattern($1_usertype, { user_home_dir_t user_home_t }, user_home_type)
-+ filetrans_pattern($1_usertype, user_home_dir_t, user_home_t, { dir file lnk_file sock_file fifo_file })
-+ files_list_home($1_usertype)
-
- # cjp: this should probably be removed:
-- allow $1_t $1_home_dir_t:dir { manage_dir_perms relabel_dir_perms };
-+ allow $1_usertype user_home_dir_t:dir { manage_dir_perms relabel_dir_perms };
-
- tunable_policy(`use_nfs_home_dirs',`
-- fs_manage_nfs_dirs($1_t)
-- fs_manage_nfs_files($1_t)
-- fs_manage_nfs_symlinks($1_t)
-- fs_manage_nfs_named_sockets($1_t)
-- fs_manage_nfs_named_pipes($1_t)
-- ',`
-- fs_dontaudit_manage_nfs_dirs($1_t)
-- fs_dontaudit_manage_nfs_files($1_t)
-+ fs_mount_nfs($1_t)
-+ fs_mounton_nfs($1_t)
-+ fs_manage_nfs_dirs($1_usertype)
-+ fs_manage_nfs_files($1_usertype)
-+ fs_manage_nfs_symlinks($1_usertype)
-+ fs_manage_nfs_named_sockets($1_usertype)
-+ fs_manage_nfs_named_pipes($1_usertype)
- ')
-
- tunable_policy(`use_samba_home_dirs',`
-- fs_manage_cifs_dirs($1_t)
-- fs_manage_cifs_files($1_t)
-- fs_manage_cifs_symlinks($1_t)
-- fs_manage_cifs_named_sockets($1_t)
-- fs_manage_cifs_named_pipes($1_t)
-- ',`
-- fs_dontaudit_manage_cifs_dirs($1_t)
-- fs_dontaudit_manage_cifs_files($1_t)
-+ fs_mount_cifs($1_t)
-+ fs_mounton_cifs($1_t)
-+ fs_manage_cifs_dirs($1_usertype)
-+ fs_manage_cifs_files($1_usertype)
-+ fs_manage_cifs_symlinks($1_usertype)
-+ fs_manage_cifs_named_sockets($1_usertype)
-+ fs_manage_cifs_named_pipes($1_usertype)
- ')
- ')
-
-@@ -316,14 +301,20 @@
- ##
- #
- template(`userdom_exec_home_template',`
-- can_exec($1_t,$1_home_t)
-
-- tunable_policy(`use_nfs_home_dirs',`
-- fs_exec_nfs_files($1_t)
-+ tunable_policy(`allow_$1_exec_content',`
-+ can_exec($1_usertype, user_home_type)
-+ ',`
-+ dontaudit $1_usertype user_home_type:file execute;
- ')
-
-- tunable_policy(`use_samba_home_dirs',`
-- fs_exec_cifs_files($1_t)
-+
-+ tunable_policy(`allow_$1_exec_content && use_nfs_home_dirs',`
-+ fs_exec_nfs_files($1_usertype)
-+ ')
-+
-+ tunable_policy(`allow_$1_exec_content && use_samba_home_dirs',`
-+ fs_exec_cifs_files($1_usertype)
- ')
- ')
-
-@@ -341,11 +332,10 @@
- ##
- #
- template(`userdom_poly_home_template',`
-- type_member $1_t $1_home_dir_t:dir $1_home_dir_t;
-- files_poly($1_home_dir_t)
-- files_poly_parent($1_home_dir_t)
-- files_poly_parent($1_home_t)
-- files_poly_member($1_home_t)
-+ gen_require(`
-+ type user_home_dir_t;
-+ ')
-+ type_member $1_t user_home_dir_t:dir user_home_dir_t;
- ')
-
- #######################################
-@@ -369,18 +359,19 @@
- #
- template(`userdom_manage_tmp_template',`
- gen_require(`
-- attribute $1_file_type;
-+ type user_tmp_t;
- ')
-
-- type $1_tmp_t, $1_file_type;
-- files_tmp_file($1_tmp_t)
--
-- manage_dirs_pattern($1_t,$1_tmp_t,$1_tmp_t)
-- manage_files_pattern($1_t,$1_tmp_t,$1_tmp_t)
-- manage_lnk_files_pattern($1_t,$1_tmp_t,$1_tmp_t)
-- manage_sock_files_pattern($1_t,$1_tmp_t,$1_tmp_t)
-- manage_fifo_files_pattern($1_t,$1_tmp_t,$1_tmp_t)
-- files_tmp_filetrans($1_t, $1_tmp_t, { dir file lnk_file sock_file fifo_file })
-+ ifelse(`$1',`user',`',`
-+ typealias user_tmp_t alias $1_tmp_t;
-+ ')
-+ manage_dirs_pattern($1_usertype, user_tmp_t, user_tmp_t)
-+ manage_files_pattern($1_usertype, user_tmp_t, user_tmp_t)
-+ manage_lnk_files_pattern($1_usertype, user_tmp_t, user_tmp_t)
-+ manage_sock_files_pattern($1_usertype, user_tmp_t, user_tmp_t)
-+ manage_fifo_files_pattern($1_usertype, user_tmp_t, user_tmp_t)
-+ files_tmp_filetrans($1_usertype, user_tmp_t, { dir file lnk_file sock_file fifo_file })
-+ relabel_files_pattern($1_usertype, user_tmp_t, user_tmp_t)
- ')
-
- #######################################
-@@ -396,7 +387,13 @@
- ##
- #
- template(`userdom_exec_tmp_template',`
-- exec_files_pattern($1_t,$1_tmp_t,$1_tmp_t)
-+ gen_require(`
-+ type user_tmp_t;
-+ ')
-+
-+ tunable_policy(`allow_$1_exec_content',`
-+ exec_files_pattern($1_usertype, user_tmp_t, user_tmp_t)
-+ ')
- ')
-
- #######################################
-@@ -439,18 +436,15 @@
- #
- template(`userdom_manage_tmpfs_template',`
- gen_require(`
-- attribute $1_file_type;
-+ attribute $1_usertype;
-+ type user_tmpfs_t;
- ')
-
-- type $1_tmpfs_t, $1_file_type;
-- files_tmpfs_file($1_tmpfs_t)
-+ ifelse(`$1',`user',`',`
-+ typealias user_tmpfs_t alias $1_tmpfs_t;
-+ ')
-
-- manage_dirs_pattern($1_t,$1_tmpfs_t,$1_tmpfs_t)
-- manage_files_pattern($1_t,$1_tmpfs_t,$1_tmpfs_t)
-- manage_lnk_files_pattern($1_t,$1_tmpfs_t,$1_tmpfs_t)
-- manage_sock_files_pattern($1_t,$1_tmpfs_t,$1_tmpfs_t)
-- manage_fifo_files_pattern($1_t,$1_tmpfs_t,$1_tmpfs_t)
-- fs_tmpfs_filetrans($1_t,$1_tmpfs_t, { dir file lnk_file sock_file fifo_file })
-+ userdom_manage_tmpfs($1_usertype)
- ')
-
- #######################################
-@@ -468,17 +462,17 @@
- #
- template(`userdom_untrusted_content_template',`
- gen_require(`
-- attribute $1_file_type;
-+ attribute user_file_type;
- attribute untrusted_content_type, untrusted_content_tmp_type;
- type $1_t;
- ')
-
- # types for network-obtained content
-- type $1_untrusted_content_t, $1_file_type, untrusted_content_type; #, customizable
-+ type $1_untrusted_content_t, user_file_type, untrusted_content_type; #, customizable
- files_type($1_untrusted_content_t)
- files_poly_member($1_untrusted_content_t)
-
-- type $1_untrusted_content_tmp_t, $1_file_type, untrusted_content_tmp_type; # customizable
-+ type $1_untrusted_content_tmp_t, user_file_type, untrusted_content_tmp_type; # customizable
- files_tmp_file($1_untrusted_content_tmp_t)
-
- # Allow user to relabel untrusted content
-@@ -510,10 +504,6 @@
- ##
- #
- template(`userdom_exec_generic_pgms_template',`
-- gen_require(`
-- type $1_t;
-- ')
--
- corecmd_exec_bin($1_t)
- ')
-
-@@ -531,34 +521,20 @@
- ##
- #
- template(`userdom_basic_networking_template',`
-- gen_require(`
-- type $1_t;
-- ')
--
-- allow $1_t self:tcp_socket create_stream_socket_perms;
-- allow $1_t self:udp_socket create_socket_perms;
-
-- corenet_all_recvfrom_unlabeled($1_t)
-- corenet_all_recvfrom_netlabel($1_t)
-- corenet_tcp_sendrecv_all_if($1_t)
-- corenet_udp_sendrecv_all_if($1_t)
-- corenet_tcp_sendrecv_all_nodes($1_t)
-- corenet_udp_sendrecv_all_nodes($1_t)
-- corenet_tcp_sendrecv_all_ports($1_t)
-- corenet_udp_sendrecv_all_ports($1_t)
-- corenet_tcp_connect_all_ports($1_t)
-- corenet_sendrecv_all_client_packets($1_t)
-+ allow $1_usertype self:tcp_socket create_stream_socket_perms;
-+ allow $1_usertype self:udp_socket create_socket_perms;
-
-- corenet_all_recvfrom_labeled($1_t, $1_t)
--
-- optional_policy(`
-- init_tcp_recvfrom_all_daemons($1_t)
-- init_udp_recvfrom_all_daemons($1_t)
-- ')
--
-- optional_policy(`
-- ipsec_match_default_spd($1_t)
-- ')
-+ corenet_all_recvfrom_unlabeled($1_usertype)
-+ corenet_all_recvfrom_netlabel($1_usertype)
-+ corenet_tcp_sendrecv_all_if($1_usertype)
-+ corenet_udp_sendrecv_all_if($1_usertype)
-+ corenet_tcp_sendrecv_all_nodes($1_usertype)
-+ corenet_udp_sendrecv_all_nodes($1_usertype)
-+ corenet_tcp_sendrecv_all_ports($1_usertype)
-+ corenet_udp_sendrecv_all_ports($1_usertype)
-+ corenet_tcp_connect_all_ports($1_usertype)
-+ corenet_sendrecv_all_client_packets($1_usertype)
- ')
-
- #######################################
-@@ -575,30 +551,33 @@
- #
- template(`userdom_xwindows_client_template',`
- gen_require(`
-- type $1_t, $1_tmpfs_t;
-+ type user_tmpfs_t;
- ')
-
-- dev_rw_xserver_misc($1_t)
-- dev_rw_power_management($1_t)
-- dev_read_input($1_t)
-- dev_read_misc($1_t)
-- dev_write_misc($1_t)
-+ dev_rwx_zero($1_usertype)
-+ dev_rw_xserver_misc($1_usertype)
-+ dev_rw_power_management($1_usertype)
-+ dev_read_input($1_usertype)
-+ dev_read_misc($1_usertype)
-+ dev_write_misc($1_usertype)
- # open office is looking for the following
-- dev_getattr_agp_dev($1_t)
-- dev_dontaudit_rw_dri($1_t)
-+ dev_getattr_agp_dev($1_usertype)
-+ dev_dontaudit_rw_dri($1_usertype)
- # GNOME checks for usb and other devices:
-- dev_rw_usbfs($1_t)
-+ dev_rw_usbfs($1_usertype)
-+ dev_rw_generic_usb_dev($1_usertype)
-
-- xserver_user_client_template($1,$1_t,$1_tmpfs_t)
-- xserver_xsession_entry_type($1_t)
-- xserver_dontaudit_write_log($1_t)
-- xserver_stream_connect_xdm($1_t)
-+ xserver_per_role_template($1, $1_usertype, $1_r)
-+ xserver_xsession_entry_type($1_usertype)
-+ xserver_dontaudit_write_log($1_usertype)
-+ xserver_stream_connect_xdm($1_usertype)
- # certain apps want to read xdm.pid file
-- xserver_read_xdm_pid($1_t)
-+ xserver_read_xdm_pid($1_usertype)
- # gnome-session creates socket under /tmp/.ICE-unix/
-- xserver_create_xdm_tmp_sockets($1_t)
-+ xserver_create_xdm_tmp_sockets($1_usertype)
- # Needed for escd, remove if we get escd policy
-- xserver_manage_xdm_tmp_files($1_t)
-+ xserver_manage_xdm_tmp_files($1_usertype)
-+ xserver_stream_connect_xdm_xserver($1_usertype)
- ')
-
- #######################################
-@@ -629,13 +608,7 @@
- ##
- ## The template for allowing the user to change roles.
- ##
--##
--##
--## The prefix of the user domain (e.g., user
--## is the prefix for user_t).
--##
--##
--##
-+##
- ##
- ## The prefix of the user domain (e.g., user
- ## is the prefix for user_t).
-@@ -686,10 +659,6 @@
-
- userdom_exec_generic_pgms_template($1)
-
-- optional_policy(`
-- userdom_xwindows_client_template($1)
-- ')
--
- ##############################
- #
- # User domain Local policy
-@@ -699,188 +668,199 @@
- dontaudit $1_t self:netlink_socket { create ioctl read getattr write setattr append bind connect getopt setopt shutdown };
- dontaudit $1_t self:netlink_route_socket { create ioctl read getattr write setattr append bind connect getopt setopt shutdown nlmsg_read nlmsg_write };
-
-- allow $1_t unpriv_userdomain:fd use;
-+ allow $1_usertype unpriv_userdomain:fd use;
-
-- kernel_read_system_state($1_t)
-- kernel_read_network_state($1_t)
-- kernel_read_net_sysctls($1_t)
-+ kernel_read_system_state($1_usertype)
-+ kernel_read_network_state($1_usertype)
-+ kernel_read_net_sysctls($1_usertype)
- # Very permissive allowing every domain to see every type:
-- kernel_get_sysvipc_info($1_t)
-+ kernel_get_sysvipc_info($1_usertype)
- # Find CDROM devices:
-- kernel_read_device_sysctls($1_t)
-+ kernel_read_device_sysctls($1_usertype)
-
-- corenet_udp_bind_all_nodes($1_t)
-- corenet_udp_bind_generic_port($1_t)
-+ corenet_udp_bind_all_nodes($1_usertype)
-+ corenet_udp_bind_generic_port($1_usertype)
-
-- dev_read_rand($1_t)
-- dev_write_sound($1_t)
-- dev_read_sound($1_t)
-- dev_read_sound_mixer($1_t)
-- dev_write_sound_mixer($1_t)
-+ dev_read_rand($1_usertype)
-+ dev_write_sound($1_usertype)
-+ dev_read_sound($1_usertype)
-+ dev_read_sound_mixer($1_usertype)
-+ dev_write_sound_mixer($1_usertype)
-
-- files_exec_etc_files($1_t)
-- files_search_locks($1_t)
-+ files_exec_etc_files($1_usertype)
-+ files_search_locks($1_usertype)
- # Check to see if cdrom is mounted
-- files_search_mnt($1_t)
-+ files_search_mnt($1_usertype)
- # cjp: perhaps should cut back on file reads:
-- files_read_var_files($1_t)
-- files_read_var_symlinks($1_t)
-- files_read_generic_spool($1_t)
-- files_read_var_lib_files($1_t)
-+ files_read_var_files($1_usertype)
-+ files_read_var_symlinks($1_usertype)
-+ files_read_generic_spool($1_usertype)
-+ files_read_var_lib_files($1_usertype)
- # Stat lost+found.
-- files_getattr_lost_found_dirs($1_t)
-+ files_getattr_lost_found_dirs($1_usertype)
-+ files_read_config_files($1_usertype)
-+ fs_read_noxattr_fs_files($1_usertype)
-+ fs_read_noxattr_fs_symlinks($1_usertype)
-+
-+ logging_send_syslog_msg($1_usertype)
-+ logging_send_audit_msgs($1_usertype)
-+ selinux_get_enforce_mode($1_usertype)
-
- # cjp: some of this probably can be removed
-- selinux_get_fs_mount($1_t)
-- selinux_validate_context($1_t)
-- selinux_compute_access_vector($1_t)
-- selinux_compute_create_context($1_t)
-- selinux_compute_relabel_context($1_t)
-- selinux_compute_user_contexts($1_t)
-+ selinux_get_fs_mount($1_usertype)
-+ selinux_validate_context($1_usertype)
-+ selinux_compute_access_vector($1_usertype)
-+ selinux_compute_create_context($1_usertype)
-+ selinux_compute_relabel_context($1_usertype)
-+ selinux_compute_user_contexts($1_usertype)
-
- # for eject
-- storage_getattr_fixed_disk_dev($1_t)
-+ storage_getattr_fixed_disk_dev($1_usertype)
-
-- auth_use_nsswitch($1_t)
-- auth_read_login_records($1_t)
-- auth_search_pam_console_data($1_t)
-+ auth_read_login_records($1_usertype)
- auth_run_pam($1_t,$1_r,{ $1_tty_device_t $1_devpts_t })
- auth_run_utempter($1_t,$1_r,{ $1_tty_device_t $1_devpts_t })
-
-- init_read_utmp($1_t)
-+ init_read_utmp($1_usertype)
-
-- seutil_read_file_contexts($1_t)
-- seutil_read_default_contexts($1_t)
-+ seutil_read_file_contexts($1_usertype)
-+ seutil_read_default_contexts($1_usertype)
- seutil_run_newrole($1_t,$1_r,{ $1_devpts_t $1_tty_device_t })
- seutil_exec_checkpolicy($1_t)
-- seutil_exec_setfiles($1_t)
-+ seutil_exec_setfiles($1_usertype)
- # for when the network connection is killed
- # this is needed when a login role can change
- # to this one.
- seutil_dontaudit_signal_newrole($1_t)
-
- tunable_policy(`read_default_t',`
-- files_list_default($1_t)
-- files_read_default_files($1_t)
-- files_read_default_symlinks($1_t)
-- files_read_default_sockets($1_t)
-- files_read_default_pipes($1_t)
-+ files_list_default($1_usertype)
-+ files_read_default_files($1_usertype)
-+ files_read_default_symlinks($1_usertype)
-+ files_read_default_sockets($1_usertype)
-+ files_read_default_pipes($1_usertype)
- ')
-
- tunable_policy(`user_direct_mouse',`
-- dev_read_mouse($1_t)
-- ')
--
-- tunable_policy(`user_ttyfile_stat',`
-- term_getattr_all_user_ttys($1_t)
-+ dev_read_mouse($1_usertype)
- ')
-
- optional_policy(`
-- alsa_read_rw_config($1_t)
-+ alsa_read_rw_config($1_usertype)
- ')
-
- optional_policy(`
- # Allow graphical boot to check battery lifespan
-- apm_stream_connect($1_t)
-+ apm_stream_connect($1_usertype)
- ')
-
- optional_policy(`
-- canna_stream_connect($1_t)
-+ canna_stream_connect($1_usertype)
- ')
-
- optional_policy(`
-- dbus_system_bus_client_template($1,$1_t)
-+ dbus_system_bus_client_template($1, $1_usertype)
-
- optional_policy(`
-- bluetooth_dbus_chat($1_t)
-+ avahi_dbus_chat($1_usertype)
- ')
-
- optional_policy(`
-- evolution_dbus_chat($1,$1_t)
-- evolution_alarm_dbus_chat($1,$1_t)
-+ bluetooth_dbus_chat($1_usertype)
- ')
-
- optional_policy(`
-- cups_dbus_chat_config($1_t)
-+ consolekit_dbus_chat($1_usertype)
-+ consolekit_read_log($1_usertype)
- ')
-
- optional_policy(`
-- hal_dbus_chat($1_t)
-+ evolution_dbus_chat($1, $1_usertype)
-+ evolution_alarm_dbus_chat($1, $1_usertype)
- ')
-
- optional_policy(`
-- networkmanager_dbus_chat($1_t)
-- ')
-+ networkmanager_dbus_chat($1_usertype)
- ')
-
- optional_policy(`
-- inetd_use_fds($1_t)
-- inetd_rw_tcp_sockets($1_t)
-+ vpnc_dbus_chat($1_usertype)
- ')
-
- optional_policy(`
-- inn_read_config($1_t)
-- inn_read_news_lib($1_t)
-- inn_read_news_spool($1_t)
-+ hal_dbus_chat($1_usertype)
- ')
-
- optional_policy(`
-- locate_read_lib_files($1_t)
-+ nsplugin_per_role_template($1, $1_usertype, $1_r)
-+ ')
- ')
-
-- # for running depmod as part of the kernel packaging process
- optional_policy(`
-- modutils_read_module_config($1_t)
-+ inetd_use_fds($1_usertype)
-+ inetd_rw_tcp_sockets($1_usertype)
- ')
-
- optional_policy(`
-- mta_rw_spool($1_t)
-+ inn_read_config($1_usertype)
-+ inn_read_news_lib($1_usertype)
-+ inn_read_news_spool($1_usertype)
- ')
-
--
- optional_policy(`
-- tunable_policy(`allow_user_mysql_connect',`
-- mysql_stream_connect($1_t)
-+ locate_read_lib_files($1_usertype)
- ')
-+
-+ # for running depmod as part of the kernel packaging process
-+ optional_policy(`
-+ modutils_read_module_config($1_usertype)
- ')
-
- optional_policy(`
-- # to allow monitoring of pcmcia status
-- pcmcia_read_pid($1_t)
-+ mta_rw_spool($1_usertype)
- ')
-
- optional_policy(`
-- pcscd_read_pub_files($1_t)
-- pcscd_stream_connect($1_t)
-+ alsa_read_rw_config($1_usertype)
- ')
-
- optional_policy(`
- tunable_policy(`allow_user_postgresql_connect',`
-- postgresql_stream_connect($1_t)
-- postgresql_tcp_connect($1_t)
-+ postgresql_stream_connect($1_usertype)
-+ ')
-+ ')
-+
-+ tunable_policy(`user_ttyfile_stat',`
-+ term_getattr_all_user_ttys($1_usertype)
- ')
-+
-+ optional_policy(`
-+ # to allow monitoring of pcmcia status
-+ pcmcia_read_pid($1_usertype)
- ')
-
- optional_policy(`
-- resmgr_stream_connect($1_t)
-+ pcscd_read_pub_files($1_usertype)
-+ pcscd_stream_connect($1_usertype)
- ')
-
- optional_policy(`
-- rpc_dontaudit_getattr_exports($1_t)
-- rpc_manage_nfs_rw_content($1_t)
-+ resmgr_stream_connect($1_usertype)
- ')
-
- optional_policy(`
-- samba_stream_connect_winbind($1_t)
-+ rpc_dontaudit_getattr_exports($1_usertype)
-+ rpc_manage_nfs_rw_content($1_usertype)
- ')
-
- optional_policy(`
-- slrnpull_search_spool($1_t)
-+ samba_stream_connect_winbind($1_usertype)
- ')
-
- optional_policy(`
-- usernetctl_run($1_t,$1_r,{ $1_devpts_t $1_tty_device_t })
-+ slrnpull_search_spool($1_usertype)
- ')
-+
- ')
-
- #######################################
-@@ -902,9 +882,7 @@
- ##
- #
- template(`userdom_login_user_template', `
-- gen_require(`
-- class context contains;
-- ')
-+ gen_tunable(allow_$1_exec_content, true)
-
- userdom_base_user_template($1)
-
-@@ -930,74 +908,77 @@
-
- allow $1_t self:process ~{ setcurrent setexec setrlimit execmem execstack execheap };
- dontaudit $1_t self:process setrlimit;
-+
- dontaudit $1_t self:netlink_route_socket { create ioctl read getattr write setattr append bind connect getopt setopt shutdown nlmsg_read nlmsg_write };
-
- allow $1_t self:context contains;
-
-- kernel_dontaudit_read_system_state($1_t)
-+ kernel_dontaudit_read_system_state($1_usertype)
-
-- dev_read_sysfs($1_t)
-- dev_read_urand($1_t)
-+ dev_read_sysfs($1_usertype)
-+ dev_read_urand($1_usertype)
-
-- domain_use_interactive_fds($1_t)
-+ domain_use_interactive_fds($1_usertype)
- # Command completion can fire hundreds of denials
-- domain_dontaudit_exec_all_entry_files($1_t)
-+ domain_dontaudit_exec_all_entry_files($1_usertype)
-
-- files_dontaudit_list_default($1_t)
-- files_dontaudit_read_default_files($1_t)
- # Stat lost+found.
-- files_getattr_lost_found_dirs($1_t)
-+ files_getattr_lost_found_dirs($1_usertype)
-
-- fs_get_all_fs_quotas($1_t)
-- fs_getattr_all_fs($1_t)
-- fs_getattr_all_dirs($1_t)
-- fs_search_auto_mountpoints($1_t)
-- fs_list_inotifyfs($1_t)
-- fs_rw_anon_inodefs_files($1_t)
-+ files_dontaudit_list_default($1_usertype)
-+ files_dontaudit_read_default_files($1_usertype)
-
-- auth_dontaudit_write_login_records($1_t)
-+ fs_get_all_fs_quotas($1_usertype)
-+ fs_getattr_all_fs($1_usertype)
-+ fs_search_all($1_usertype)
-+ fs_list_inotifyfs($1_usertype)
-+ fs_rw_anon_inodefs_files($1_usertype)
-
-- application_exec_all($1_t)
-+ auth_dontaudit_write_login_records($1_t)
-+ auth_rw_cache($1_t)
-
- # The library functions always try to open read-write first,
- # then fall back to read-only if it fails.
-- init_dontaudit_rw_utmp($1_t)
-+ init_dontaudit_rw_utmp($1_usertype)
- # Stop warnings about access to /dev/console
-- init_dontaudit_use_fds($1_t)
-- init_dontaudit_use_script_fds($1_t)
-+ init_dontaudit_use_fds($1_usertype)
-+ init_dontaudit_use_script_fds($1_usertype)
-
-- libs_exec_lib_files($1_t)
-+ libs_exec_lib_files($1_usertype)
-
-- logging_dontaudit_getattr_all_logs($1_t)
-+ logging_dontaudit_getattr_all_logs($1_usertype)
-
-- miscfiles_read_man_pages($1_t)
- # for running TeX programs
-- miscfiles_read_tetex_data($1_t)
-- miscfiles_exec_tetex_data($1_t)
-+ miscfiles_read_tetex_data($1_usertype)
-+ miscfiles_exec_tetex_data($1_usertype)
-
-- seutil_read_config($1_t)
-+ seutil_read_config($1_usertype)
-+ optional_policy(`
-+ cups_read_config($1_usertype)
-+ cups_stream_connect($1_usertype)
-+ cups_stream_connect_ptal($1_usertype)
-+ ')
-
- optional_policy(`
-- cups_read_config($1_t)
-- cups_stream_connect($1_t)
-- cups_stream_connect_ptal($1_t)
-+ kerberos_use($1_usertype)
-+ kerberos_connect_524($1_usertype)
- ')
-
- optional_policy(`
-- kerberos_use($1_t)
-+ mta_dontaudit_read_spool_symlinks($1_usertype)
- ')
-
- optional_policy(`
-- mta_dontaudit_read_spool_symlinks($1_t)
-+ quota_dontaudit_getattr_db($1_usertype)
- ')
-
- optional_policy(`
-- quota_dontaudit_getattr_db($1_t)
-+ rpm_read_db($1_usertype)
-+ rpm_dontaudit_manage_db($1_usertype)
- ')
-
- optional_policy(`
-- rpm_read_db($1_t)
-- rpm_dontaudit_manage_db($1_t)
-+ oddjob_run_mkhomedir($1_t, $1_r, { $1_devpts_t $1_tty_device_t })
- ')
- ')
-
-@@ -1031,9 +1012,6 @@
- domain_interactive_fd($1_t)
-
- typeattribute $1_devpts_t user_ptynode;
-- typeattribute $1_home_dir_t user_home_dir_type;
-- typeattribute $1_home_t user_home_type;
-- typeattribute $1_tmp_t user_tmpfile;
- typeattribute $1_tty_device_t user_ttynode;
-
- ##############################
-@@ -1042,12 +1020,32 @@
- #
-
- # privileged home directory writers
-- manage_dirs_pattern(privhome,{ $1_home_dir_t $1_home_t },$1_home_t)
-- manage_files_pattern(privhome,{ $1_home_dir_t $1_home_t },$1_home_t)
-- manage_lnk_files_pattern(privhome,{ $1_home_dir_t $1_home_t },$1_home_t)
-- manage_sock_files_pattern(privhome,{ $1_home_dir_t $1_home_t },$1_home_t)
-- manage_fifo_files_pattern(privhome,{ $1_home_dir_t $1_home_t },$1_home_t)
-- filetrans_pattern(privhome,$1_home_dir_t,$1_home_t,{ dir file lnk_file sock_file fifo_file })
-+ manage_dirs_pattern(privhome, { user_home_dir_t user_home_t }, user_home_t)
-+ manage_files_pattern(privhome, { user_home_dir_t user_home_t }, user_home_t)
-+ manage_lnk_files_pattern(privhome, { user_home_dir_t user_home_t }, user_home_t)
-+ manage_sock_files_pattern(privhome, { user_home_dir_t user_home_t }, user_home_t)
-+ manage_fifo_files_pattern(privhome, { user_home_dir_t user_home_t }, user_home_t)
-+ filetrans_pattern(privhome, user_home_dir_t, user_home_t, { dir file lnk_file sock_file fifo_file })
-+
-+ tunable_policy(`user_rw_noexattrfile',`
-+ fs_manage_noxattr_fs_files($1_usertype)
-+ fs_manage_noxattr_fs_dirs($1_usertype)
-+ fs_manage_dos_dirs($1_usertype)
-+ fs_manage_dos_files($1_usertype)
-+ ')
-+
-+ optional_policy(`
-+ dbus_per_role_template($1, $1_usertype, $1_r)
-+ dbus_system_bus_client_template($1, $1_usertype)
-+
-+ optional_policy(`
-+ consolekit_dbus_chat($1_usertype)
-+ ')
-+ optional_policy(`
-+ cups_dbus_chat($1_usertype)
-+ cups_dbus_chat_config($1_usertype)
-+ ')
-+ ')
-
- optional_policy(`
- loadkeys_run($1_t,$1_r,$1_tty_device_t)
-@@ -1079,7 +1077,9 @@
-
- userdom_restricted_user_template($1)
-
-+ optional_policy(`
- userdom_xwindows_client_template($1)
-+ ')
-
- ##############################
- #
-@@ -1087,14 +1087,16 @@
- #
-
- authlogin_per_role_template($1, $1_t, $1_r)
-- auth_search_pam_console_data($1_t)
-+ auth_search_pam_console_data($1_usertype)
-
-- dev_read_sound($1_t)
-- dev_write_sound($1_t)
-+ dev_read_sound($1_usertype)
-+ dev_write_sound($1_usertype)
- # gnome keyring wants to read this.
-- dev_dontaudit_read_rand($1_t)
-+ dev_dontaudit_read_rand($1_usertype)
-+ # temporarily allow since openoffice requires this
-+ dev_read_rand($1_usertype)
-
-- logging_send_syslog_msg($1_t)
-+ logging_send_syslog_msg($1_usertype)
- logging_dontaudit_send_audit_msgs($1_t)
-
- # Need to to this just so screensaver will work. Should be moved to screensaver domain
-@@ -1102,28 +1104,19 @@
- selinux_get_enforce_mode($1_t)
-
- optional_policy(`
-- alsa_read_rw_config($1_t)
-- ')
--
-- optional_policy(`
-- dbus_per_role_template($1, $1_t, $1_r)
-- dbus_system_bus_client_template($1, $1_t)
--
-- optional_policy(`
-- consolekit_dbus_chat($1_t)
-+ alsa_read_rw_config($1_usertype)
- ')
-
- optional_policy(`
-- cups_dbus_chat($1_t)
-- ')
-+ apache_per_role_template($1, $1_usertype, $1_r)
- ')
-
- optional_policy(`
-- java_per_role_template($1, $1_t, $1_r)
-+ openoffice_per_role_template($1, $1_usertype, $1_r)
- ')
-
- optional_policy(`
-- setroubleshoot_dontaudit_stream_connect($1_t)
-+ polkit_per_role_template($1, $1_usertype, $1_r)
- ')
- ')
-
-@@ -1134,8 +1127,7 @@
- ##
- ##
- ##
--## The template for creating a unprivileged user roughly
--## equivalent to a regular linux user.
-+## The template containing the most basic rules common to all users.
- ##
- ##
- ## This template creates a user domain, types, and
-@@ -1157,8 +1149,8 @@
- # Declarations
- #
-
-+ userdom_restricted_xwindows_user_template($1)
- # Inherit rules for ordinary users.
-- userdom_restricted_user_template($1)
- userdom_common_user_template($1)
-
- ##############################
-@@ -1167,11 +1159,10 @@
- #
-
- # port access is audited even if dac would not have allowed it, so dontaudit it here
-- corenet_dontaudit_tcp_bind_all_reserved_ports($1_t)
-+# corenet_dontaudit_tcp_bind_all_reserved_ports($1_t)
- # Need the following rule to allow users to run vpnc
- corenet_tcp_bind_xserver_port($1_t)
-
-- files_exec_usr_files($1_t)
- # cjp: why?
- files_read_kernel_symbol_table($1_t)
-
-@@ -1189,36 +1180,41 @@
- ')
- ')
-
-- tunable_policy(`user_dmesg',`
-- kernel_read_ring_buffer($1_t)
-- ',`
-- kernel_dontaudit_read_ring_buffer($1_t)
-- ')
--
- # Allow users to run TCP servers (bind to ports and accept connection from
- # the same domain and outside users) disabling this forces FTP passive mode
- # and may change other protocols
- tunable_policy(`user_tcp_server',`
- corenet_tcp_bind_all_nodes($1_t)
-- corenet_tcp_bind_generic_port($1_t)
-+ corenet_tcp_bind_all_unreserved_ports($1_t)
- ')
-
-+ # Run pppd in pppd_t by default for user
- optional_policy(`
-- netutils_run_ping_cond($1_t,$1_r,{ $1_tty_device_t $1_devpts_t })
-- netutils_run_traceroute_cond($1_t,$1_r,{ $1_tty_device_t $1_devpts_t })
-+ ppp_run_cond($1_t, $1_r, { $1_tty_device_t $1_devpts_t })
- ')
-
- optional_policy(`
-- postgresql_userdom_template($1,$1_t,$1_r)
-+ games_rw_data($1_usertype)
- ')
-
-- # Run pppd in pppd_t by default for user
- optional_policy(`
-- ppp_run_cond($1_t,$1_r,{ $1_tty_device_t $1_devpts_t })
-+ mount_run($1_t, $1_r, { $1_tty_device_t $1_devpts_t })
- ')
-
- optional_policy(`
-- setroubleshoot_stream_connect($1_t)
-+ cron_per_role_template($1, $1_t, $1_r)
-+ ')
-+
-+ optional_policy(`
-+ java_per_role_template($1, $1_t, $1_r)
-+ ')
-+
-+ optional_policy(`
-+ mono_per_role_template($1, $1_t, $1_r)
-+ ')
-+
-+ optional_policy(`
-+ gpg_per_role_template($1, $1_usertype, $1_r)
- ')
- ')
-
-@@ -1263,8 +1259,7 @@
- #
-
- # Inherit rules for ordinary users.
-- userdom_login_user_template($1)
-- userdom_common_user_template($1)
-+ userdom_unpriv_user_template($1)
-
- typeattribute $1_t privhome;
- domain_obj_id_change_exemption($1_t)
-@@ -1295,8 +1290,6 @@
- # Manipulate other users crontab.
- allow $1_t self:passwd crontab;
-
-- allow $1_t self:netlink_audit_socket nlmsg_readpriv;
--
- kernel_read_software_raid_state($1_t)
- kernel_getattr_core_if($1_t)
- kernel_getattr_message_if($1_t)
-@@ -1318,8 +1311,6 @@
-
- dev_getattr_generic_blk_files($1_t)
- dev_getattr_generic_chr_files($1_t)
-- # for lsof
-- dev_getattr_mtrr_dev($1_t)
- # Allow MAKEDEV to work
- dev_create_all_blk_files($1_t)
- dev_create_all_chr_files($1_t)
-@@ -1374,13 +1365,6 @@
- # But presently necessary for installing the file_contexts file.
- seutil_manage_bin_policy($1_t)
-
-- tunable_policy(`user_rw_noexattrfile',`
-- fs_manage_noxattr_fs_files($1_t)
-- fs_manage_noxattr_fs_dirs($1_t)
-- ',`
-- fs_read_noxattr_fs_files($1_t)
-- ')
--
- optional_policy(`
- postgresql_unconfined($1_t)
- ')
-@@ -1432,6 +1416,7 @@
- dev_relabel_all_dev_nodes($1)
-
- files_create_boot_flag($1)
-+ files_create_default_dir($1)
-
- # Necessary for managing /boot/efi
- fs_manage_dos_files($1)
-@@ -1461,10 +1446,6 @@
- seutil_run_semanage($1,$2,$3)
- seutil_run_setfiles($1, $2, $3)
-
-- staff_dontaudit_append_home_content_files($1)
--
-- sysadm_dontaudit_read_home_content_files($1)
--
- optional_policy(`
- aide_run($1,$2, $3)
- ')
-@@ -1484,6 +1465,14 @@
- optional_policy(`
- netlabel_run_mgmt($1,$2, $3)
- ')
-+
-+ optional_policy(`
-+ staff_dontaudit_append_home_content_files($1)
-+ ')
-+
-+ optional_policy(`
-+ sysadm_dontaudit_read_home_content_files($1)
-+ ')
- ')
-
- ########################################
-@@ -1741,11 +1730,15 @@
- #
- template(`userdom_user_home_content',`
- gen_require(`
-- attribute $1_file_type;
-+ attribute user_file_type;
-+ attribute user_home_type;
-+ attribute home_type;
- ')
-
-- typeattribute $2 $1_file_type;
-- files_type($2)
-+ typeattribute $2 user_file_type;
-+ typeattribute $2 user_home_type;
-+ typeattribute $2 home_type;
-+ files_poly_member($2)
- ')
-
- ########################################
-@@ -1841,11 +1834,11 @@
- #
- template(`userdom_search_user_home_dirs',`
- gen_require(`
-- type $1_home_dir_t;
-+ type user_home_dir_t;
- ')
-
- files_search_home($2)
-- allow $2 $1_home_dir_t:dir search_dir_perms;
-+ allow $2 user_home_dir_t:dir search_dir_perms;
- ')
-
- ########################################
-@@ -1875,11 +1868,11 @@
- #
- template(`userdom_list_user_home_dirs',`
- gen_require(`
-- type $1_home_dir_t;
-+ type user_home_dir_t;
- ')
-
- files_search_home($2)
-- allow $2 $1_home_dir_t:dir list_dir_perms;
-+ allow $2 user_home_dir_t:dir list_dir_perms;
- ')
-
- ########################################
-@@ -1923,12 +1916,12 @@
- #
- template(`userdom_user_home_domtrans',`
- gen_require(`
-- type $1_home_dir_t, $1_home_t;
-+ type user_home_dir_t, user_home_t;
- ')
-
- files_search_home($2)
-- allow $2 $1_home_dir_t:dir search_dir_perms;
-- domain_auto_trans($2,$1_home_t,$3)
-+ allow $2 user_home_dir_t:dir search_dir_perms;
-+ domain_auto_trans($2, user_home_t, $3)
- ')
-
- ########################################
-@@ -1958,10 +1951,11 @@
- #
- template(`userdom_dontaudit_list_user_home_dirs',`
- gen_require(`
-- type $1_home_dir_t;
-+ type user_home_dir_t;
- ')
-
-- dontaudit $2 $1_home_dir_t:dir list_dir_perms;
-+ dontaudit $2 user_home_dir_t:dir list_dir_perms;
-+ dontaudit $2 user_home_t:dir list_dir_perms;
- ')
-
- ########################################
-@@ -1993,11 +1987,47 @@
- #
- template(`userdom_manage_user_home_content_dirs',`
- gen_require(`
-- type $1_home_dir_t, $1_home_t;
-+ type user_home_dir_t, user_home_t;
-+ attribute user_home_type;
- ')
-
- files_search_home($2)
-- manage_dirs_pattern($2,{ $1_home_dir_t $1_home_t },$1_home_t)
-+ manage_dirs_pattern($2, { user_home_dir_t user_home_type }, user_home_t)
-+')
-+
-+########################################
-+##
-+## dontaudit attemps to Create files
-+## in a user home subdirectory.
-+##
-+##
-+##
-+## Create, read, write, and delete directories
-+## in a user home subdirectory.
-+##
-+##
-+## This is a templated interface, and should only
-+## be called from a per-userdomain template.
-+##
-+##
-+##
-+##
-+## The prefix of the user domain (e.g., user
-+## is the prefix for user_t).
-+##
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+#
-+template(`userdom_dontaudit_create_user_home_content_files',`
-+ gen_require(`
-+ type user_home_dir_t;
-+ ')
-+
-+ dontaudit $2 user_home_dir_t:file create;
- ')
-
- ########################################
-@@ -2029,10 +2059,10 @@
- #
- template(`userdom_dontaudit_setattr_user_home_content_files',`
- gen_require(`
-- type $1_home_dir_t, $1_home_t;
-+ type user_home_dir_t, user_home_t;
- ')
-
-- dontaudit $2 $1_home_t:file setattr;
-+ dontaudit $2 user_home_t:file setattr;
- ')
-
- ########################################
-@@ -2062,11 +2092,11 @@
- #
- template(`userdom_read_user_home_content_files',`
- gen_require(`
-- type $1_home_dir_t, $1_home_t;
-+ type user_home_dir_t, user_home_t;
- ')
-
- files_search_home($2)
-- read_files_pattern($2,{ $1_home_dir_t $1_home_t },$1_home_t)
-+ read_files_pattern($2, { user_home_dir_t user_home_t }, user_home_t)
- ')
-
- ########################################
-@@ -2096,11 +2126,11 @@
- #
- template(`userdom_dontaudit_read_user_home_content_files',`
- gen_require(`
-- type $1_home_t;
-+ type user_home_t;
- ')
-
-- dontaudit $2 $1_home_t:dir list_dir_perms;
-- dontaudit $2 $1_home_t:file read_file_perms;
-+ dontaudit $2 user_home_t:dir list_dir_perms;
-+ dontaudit $2 user_home_t:file read_file_perms;
- ')
-
- ########################################
-@@ -2130,10 +2160,14 @@
- #
- template(`userdom_dontaudit_write_user_home_content_files',`
- gen_require(`
-- type $1_home_t;
-+ type user_home_t;
- ')
-
-- dontaudit $2 $1_home_t:file write;
-+ dontaudit $2 user_home_t:file write;
-+ fs_dontaudit_list_nfs($2)
-+ fs_dontaudit_rw_nfs_files($2)
-+ fs_dontaudit_list_cifs($2)
-+ fs_dontaudit_rw_cifs_files($2)
- ')
-
- ########################################
-@@ -2163,11 +2197,11 @@
- #
- template(`userdom_read_user_home_content_symlinks',`
- gen_require(`
-- type $1_home_dir_t, $1_home_t;
-+ type user_home_dir_t, user_home_t;
- ')
-
- files_search_home($2)
-- read_lnk_files_pattern($2,{ $1_home_dir_t $1_home_t },$1_home_t)
-+ read_lnk_files_pattern($2, { user_home_dir_t user_home_t }, user_home_t)
- ')
-
- ########################################
-@@ -2197,11 +2231,11 @@
- #
- template(`userdom_exec_user_home_content_files',`
- gen_require(`
-- type $1_home_dir_t, $1_home_t;
-+ type user_home_dir_t, user_home_t;
- ')
-
- files_search_home($2)
-- exec_files_pattern($2,{ $1_home_dir_t $1_home_t },$1_home_t)
-+ exec_files_pattern($2, { user_home_dir_t user_home_t }, user_home_t)
- ')
-
- ########################################
-@@ -2231,10 +2265,10 @@
- #
- template(`userdom_dontaudit_exec_user_home_content_files',`
- gen_require(`
-- type $1_home_t;
-+ type user_home_t;
- ')
-
-- dontaudit $2 $1_home_t:file execute;
-+ dontaudit $2 user_home_t:file execute;
- ')
-
- ########################################
-@@ -2266,12 +2300,12 @@
- #
- template(`userdom_manage_user_home_content_files',`
- gen_require(`
-- type $1_home_dir_t, $1_home_t;
-+ type user_home_dir_t, user_home_t;
- ')
-
- files_search_home($2)
-- allow $2 $1_home_dir_t:dir search_dir_perms;
-- manage_files_pattern($2,$1_home_t,$1_home_t)
-+ allow $2 user_home_dir_t:dir search_dir_perms;
-+ manage_files_pattern($2, user_home_t, user_home_t)
- ')
-
- ########################################
-@@ -2303,10 +2337,10 @@
- #
- template(`userdom_dontaudit_manage_user_home_content_dirs',`
- gen_require(`
-- type $1_home_dir_t, $1_home_t;
-+ type user_home_dir_t, user_home_t;
- ')
-
-- dontaudit $2 $1_home_t:dir manage_dir_perms;
-+ dontaudit $2 user_home_t:dir manage_dir_perms;
- ')
-
- ########################################
-@@ -2338,12 +2372,12 @@
- #
- template(`userdom_manage_user_home_content_symlinks',`
- gen_require(`
-- type $1_home_dir_t, $1_home_t;
-+ type user_home_dir_t, user_home_t;
- ')
-
- files_search_home($2)
-- allow $2 $1_home_dir_t:dir search_dir_perms;
-- manage_lnk_files_pattern($2,$1_home_t,$1_home_t)
-+ allow $2 user_home_dir_t:dir search_dir_perms;
-+ manage_lnk_files_pattern($2, user_home_t, user_home_t)
- ')
-
- ########################################
-@@ -2375,12 +2409,12 @@
- #
- template(`userdom_manage_user_home_content_pipes',`
- gen_require(`
-- type $1_home_dir_t, $1_home_t;
-+ type user_home_dir_t, user_home_t;
- ')
-
- files_search_home($2)
-- allow $2 $1_home_dir_t:dir search_dir_perms;
-- manage_fifo_files_pattern($2,$1_home_t,$1_home_t)
-+ allow $2 user_home_dir_t:dir search_dir_perms;
-+ manage_fifo_files_pattern($2, user_home_t, user_home_t)
- ')
-
- ########################################
-@@ -2412,12 +2446,12 @@
- #
- template(`userdom_manage_user_home_content_sockets',`
- gen_require(`
-- type $1_home_dir_t, $1_home_t;
-+ type user_home_dir_t, user_home_t;
- ')
-
- files_search_home($2)
-- allow $2 $1_home_dir_t:dir search_dir_perms;
-- manage_sock_files_pattern($2,$1_home_t,$1_home_t)
-+ allow $2 user_home_dir_t:dir search_dir_perms;
-+ manage_sock_files_pattern($2, user_home_t, user_home_t)
- ')
-
- ########################################
-@@ -2462,11 +2496,11 @@
- #
- template(`userdom_user_home_dir_filetrans',`
- gen_require(`
-- type $1_home_dir_t;
-+ type user_home_dir_t;
- ')
-
- files_search_home($2)
-- filetrans_pattern($2,$1_home_dir_t,$3,$4)
-+ filetrans_pattern($2, user_home_dir_t, $3, $4)
- ')
-
- ########################################
-@@ -2511,11 +2545,11 @@
- #
- template(`userdom_user_home_content_filetrans',`
- gen_require(`
-- type $1_home_t;
-+ type user_home_t;
- ')
-
- files_search_home($2)
-- filetrans_pattern($2,$1_home_t,$3,$4)
-+ filetrans_pattern($2, user_home_t, $3, $4)
- ')
-
- ########################################
-@@ -2555,11 +2589,11 @@
- #
- template(`userdom_user_home_dir_filetrans_user_home_content',`
- gen_require(`
-- type $1_home_dir_t, $1_home_t;
-+ type user_home_dir_t, user_home_t;
- ')
-
- files_search_home($2)
-- filetrans_pattern($2,$1_home_dir_t,$1_home_t,$3)
-+ filetrans_pattern($2, user_home_dir_t, user_home_t, $3)
- ')
-
- ########################################
-@@ -2589,11 +2623,11 @@
- #
- template(`userdom_write_user_tmp_sockets',`
- gen_require(`
-- type $1_tmp_t;
-+ type user_tmp_t;
- ')
-
- files_search_tmp($2)
-- allow $2 $1_tmp_t:sock_file write;
-+ write_sock_files_pattern($2, user_tmp_t, user_tmp_t)
- ')
-
- ########################################
-@@ -2623,11 +2657,11 @@
- #
- template(`userdom_list_user_tmp',`
- gen_require(`
-- type $1_tmp_t;
-+ type user_tmp_t;
- ')
-
- files_search_tmp($2)
-- allow $2 $1_tmp_t:dir list_dir_perms;
-+ allow $2 user_tmp_t:dir list_dir_perms;
- ')
-
- ########################################
-@@ -2659,10 +2693,10 @@
- #
- template(`userdom_dontaudit_list_user_tmp',`
- gen_require(`
-- type $1_tmp_t;
-+ type user_tmp_t;
- ')
-
-- dontaudit $2 $1_tmp_t:dir list_dir_perms;
-+ dontaudit $2 user_tmp_t:dir list_dir_perms;
- ')
-
- ########################################
-@@ -2694,10 +2728,10 @@
- #
- template(`userdom_dontaudit_manage_user_tmp_dirs',`
- gen_require(`
-- type $1_tmp_t;
-+ type user_tmp_t;
- ')
-
-- dontaudit $2 $1_tmp_t:dir manage_dir_perms;
-+ dontaudit $2 user_tmp_t:dir manage_dir_perms;
- ')
-
- ########################################
-@@ -2727,12 +2761,12 @@
- #
- template(`userdom_read_user_tmp_files',`
- gen_require(`
-- type $1_tmp_t;
-+ type user_tmp_t;
- ')
-
- files_search_tmp($2)
-- allow $2 $1_tmp_t:dir list_dir_perms;
-- read_files_pattern($2,$1_tmp_t,$1_tmp_t)
-+ allow $2 user_tmp_t:dir list_dir_perms;
-+ read_files_pattern($2, user_tmp_t, user_tmp_t)
- ')
-
- ########################################
-@@ -2764,10 +2798,10 @@
- #
- template(`userdom_dontaudit_read_user_tmp_files',`
- gen_require(`
-- type $1_tmp_t;
-+ type user_tmp_t;
- ')
-
-- dontaudit $2 $1_tmp_t:file read_file_perms;
-+ dontaudit $2 user_tmp_t:file read_file_perms;
- ')
-
- ########################################
-@@ -2799,10 +2833,10 @@
- #
- template(`userdom_dontaudit_append_user_tmp_files',`
- gen_require(`
-- type $1_tmp_t;
-+ type user_tmp_t;
- ')
-
-- dontaudit $2 $1_tmp_t:file append;
-+ dontaudit $2 user_tmp_t:file append;
- ')
-
- ########################################
-@@ -2832,12 +2866,12 @@
- #
- template(`userdom_rw_user_tmp_files',`
- gen_require(`
-- type $1_tmp_t;
-+ type user_tmp_t;
- ')
-
- files_search_tmp($2)
-- allow $2 $1_tmp_t:dir list_dir_perms;
-- rw_files_pattern($2,$1_tmp_t,$1_tmp_t)
-+ allow $2 user_tmp_t:dir list_dir_perms;
-+ rw_files_pattern($2, user_tmp_t, user_tmp_t)
- ')
-
- ########################################
-@@ -2869,10 +2903,10 @@
- #
- template(`userdom_dontaudit_manage_user_tmp_files',`
- gen_require(`
-- type $1_tmp_t;
-+ type user_tmp_t;
- ')
-
-- dontaudit $2 $1_tmp_t:file manage_file_perms;
-+ dontaudit $2 user_tmp_t:file manage_file_perms;
- ')
-
- ########################################
-@@ -2904,12 +2938,12 @@
- #
- template(`userdom_read_user_tmp_symlinks',`
- gen_require(`
-- type $1_tmp_t;
-+ type user_tmp_t;
- ')
-
- files_search_tmp($2)
-- allow $2 $1_tmp_t:dir list_dir_perms;
-- read_lnk_files_pattern($2,$1_tmp_t,$1_tmp_t)
-+ allow $2 user_tmp_t:dir list_dir_perms;
-+ read_lnk_files_pattern($2, user_tmp_t, user_tmp_t)
- ')
-
- ########################################
-@@ -2941,11 +2975,11 @@
- #
- template(`userdom_manage_user_tmp_dirs',`
- gen_require(`
-- type $1_tmp_t;
-+ type user_tmp_t;
- ')
-
- files_search_tmp($2)
-- manage_dirs_pattern($2,$1_tmp_t,$1_tmp_t)
-+ manage_dirs_pattern($2, user_tmp_t, user_tmp_t)
- ')
-
- ########################################
-@@ -2977,11 +3011,11 @@
- #
- template(`userdom_manage_user_tmp_files',`
- gen_require(`
-- type $1_tmp_t;
-+ type user_tmp_t;
- ')
-
- files_search_tmp($2)
-- manage_files_pattern($2,$1_tmp_t,$1_tmp_t)
-+ manage_files_pattern($2, user_tmp_t, user_tmp_t)
- ')
-
- ########################################
-@@ -3013,11 +3047,11 @@
- #
- template(`userdom_manage_user_tmp_symlinks',`
- gen_require(`
-- type $1_tmp_t;
-+ type user_tmp_t;
- ')
-
- files_search_tmp($2)
-- manage_lnk_files_pattern($2,$1_tmp_t,$1_tmp_t)
-+ manage_lnk_files_pattern($2, user_tmp_t, user_tmp_t)
- ')
-
- ########################################
-@@ -3049,11 +3083,11 @@
- #
- template(`userdom_manage_user_tmp_pipes',`
- gen_require(`
-- type $1_tmp_t;
-+ type user_tmp_t;
- ')
-
- files_search_tmp($2)
-- manage_fifo_files_pattern($2,$1_tmp_t,$1_tmp_t)
-+ manage_fifo_files_pattern($2, user_tmp_t, user_tmp_t)
- ')
-
- ########################################
-@@ -3085,11 +3119,11 @@
- #
- template(`userdom_manage_user_tmp_sockets',`
- gen_require(`
-- type $1_tmp_t;
-+ type user_tmp_t;
- ')
-
- files_search_tmp($2)
-- manage_sock_files_pattern($2,$1_tmp_t,$1_tmp_t)
-+ manage_sock_files_pattern($2, user_tmp_t, user_tmp_t)
- ')
-
- ########################################
-@@ -3134,10 +3168,10 @@
- #
- template(`userdom_user_tmp_filetrans',`
- gen_require(`
-- type $1_tmp_t;
-+ type user_tmp_t;
- ')
-
-- filetrans_pattern($2,$1_tmp_t,$3,$4)
-+ filetrans_pattern($2, user_tmp_t, $3, $4)
- files_search_tmp($2)
- ')
-
-@@ -3178,19 +3212,19 @@
- #
- template(`userdom_tmp_filetrans_user_tmp',`
- gen_require(`
-- type $1_tmp_t;
-+ type user_tmp_t;
- ')
-
-- files_tmp_filetrans($2,$1_tmp_t,$3)
-+ files_tmp_filetrans($2, user_tmp_t, $3)
- ')
-
- ########################################
- ##
--## Read user tmpfs files.
-+## Read/write user tmpfs files.
- ##
- ##
- ##
--## Read user tmpfs files.
-+## Read/write user tmpfs files.
- ##
- ##
- ## This is a templated interface, and should only
-@@ -3211,13 +3245,13 @@
- #
- template(`userdom_rw_user_tmpfs_files',`
- gen_require(`
-- type $1_tmpfs_t;
-+ type user_tmpfs_t;
- ')
-
- fs_search_tmpfs($2)
-- allow $2 $1_tmpfs_t:dir list_dir_perms;
-- rw_files_pattern($2,$1_tmpfs_t,$1_tmpfs_t)
-- read_lnk_files_pattern($2,$1_tmpfs_t,$1_tmpfs_t)
-+ allow $2 user_tmpfs_t:dir list_dir_perms;
-+ rw_files_pattern($2,user_tmpfs_t,user_tmpfs_t)
-+ read_lnk_files_pattern($2,user_tmpfs_t,user_tmpfs_t)
- ')
-
- ########################################
-@@ -4616,11 +4650,11 @@
- #
- interface(`userdom_search_all_users_home_dirs',`
- gen_require(`
-- attribute home_dir_type;
-+ attribute user_home_dir_type;
- ')
-
- files_list_home($1)
-- allow $1 home_dir_type:dir search_dir_perms;
-+ allow $1 user_home_dir_type:dir search_dir_perms;
- ')
-
- ########################################
-@@ -4640,6 +4674,14 @@
-
- files_list_home($1)
- allow $1 home_dir_type:dir list_dir_perms;
-+
-+ tunable_policy(`use_nfs_home_dirs',`
-+ fs_list_nfs($1)
-+ ')
-+
-+ tunable_policy(`use_samba_home_dirs',`
-+ fs_list_cifs($1)
-+ ')
- ')
-
- ########################################
-@@ -4677,6 +4719,8 @@
- ')
-
- dontaudit $1 { home_dir_type home_type }:dir search_dir_perms;
-+ fs_dontaudit_list_nfs($1)
-+ fs_dontaudit_list_cifs($1)
- ')
-
- ########################################
-@@ -4721,6 +4765,25 @@
-
- ########################################
- ##
-+## Delete all files
-+## in all users home directories.
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+#
-+interface(`userdom_delete_all_users_home_content_files',`
-+ gen_require(`
-+ attribute home_type;
-+ ')
-+
-+ delete_files_pattern($1, home_type, home_type)
-+')
-+
-+########################################
-+##
- ## Create, read, write, and delete all files
- ## in all users home directories.
- ##
-@@ -4946,7 +5009,7 @@
-
- ########################################
- ##
--## Relabel to generic user home directories.
-+## Relabel to staff home directories.
- ##
- ##
- ##
-@@ -5318,7 +5381,7 @@
-
- ########################################
- ##
--## Read and write unprivileged user ttys.
-+## Write all unprivileged users files in /tmp
- ##
- ##
- ##
-@@ -5326,18 +5389,17 @@
- ##
- ##
- #
--interface(`userdom_use_unpriv_users_ttys',`
-+interface(`userdom_manage_unpriv_users_tmp_files',`
- gen_require(`
-- attribute user_ttynode;
-+ type user_tmp_t;
- ')
-
-- allow $1 user_ttynode:chr_file rw_term_perms;
-+ manage_files_pattern($1, user_tmp_t, user_tmp_t)
- ')
-
- ########################################
- ##
--## Do not audit attempts to use unprivileged
--## user ttys.
-+## Write all unprivileged users lnk_files in /tmp
- ##
- ##
- ##
-@@ -5345,17 +5407,17 @@
- ##
- ##
- #
--interface(`userdom_dontaudit_use_unpriv_users_ttys',`
-+interface(`userdom_manage_unpriv_users_tmp_symlinks',`
- gen_require(`
-- attribute user_ttynode;
-+ type user_tmp_t;
- ')
-
-- dontaudit $1 user_ttynode:chr_file rw_file_perms;
-+ manage_lnk_files_pattern($1, user_tmp_t, user_tmp_t)
- ')
-
- ########################################
- ##
--## Read the process state of all user domains.
-+## Read and write unprivileged user ttys.
- ##
- ##
- ##
-@@ -5363,18 +5425,18 @@
- ##
- ##
- #
--interface(`userdom_read_all_users_state',`
-+interface(`userdom_use_unpriv_users_ttys',`
- gen_require(`
-- attribute userdomain;
-+ attribute user_ttynode;
- ')
-
-- read_files_pattern($1,userdomain,userdomain)
-- kernel_search_proc($1)
-+ allow $1 user_ttynode:chr_file rw_term_perms;
- ')
-
- ########################################
- ##
--## Get the attributes of all user domains.
-+## Do not audit attempts to use unprivileged
-+## user ttys.
- ##
- ##
- ##
-@@ -5382,9 +5444,46 @@
- ##
- ##
- #
--interface(`userdom_getattr_all_users',`
-+interface(`userdom_dontaudit_use_unpriv_users_ttys',`
- gen_require(`
-- attribute userdomain;
-+ attribute user_ttynode;
-+ ')
-+
-+ dontaudit $1 user_ttynode:chr_file rw_file_perms;
-+')
-+
-+########################################
-+##
-+## Read the process state of all user domains.
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+#
-+interface(`userdom_read_all_users_state',`
-+ gen_require(`
-+ attribute userdomain;
-+ ')
-+
-+ ps_process_pattern($1, userdomain)
-+ kernel_search_proc($1)
-+')
-+
-+########################################
-+##
-+## Get the attributes of all user domains.
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+#
-+interface(`userdom_getattr_all_users',`
-+ gen_require(`
-+ attribute userdomain;
- ')
-
- allow $1 userdomain:process getattr;
-@@ -5447,6 +5546,24 @@
-
- ########################################
- ##
-+## Send signull to all user domains.
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+#
-+interface(`userdom_signull_all_users',`
-+ gen_require(`
-+ attribute userdomain;
-+ ')
-+
-+ allow $1 userdomain:process signull;
-+')
-+
-+########################################
-+##
- ## Send a SIGCHLD signal to all user domains.
- ##
- ##
-@@ -5483,6 +5600,42 @@
-
- ########################################
- ##
-+## Manage keys for all user domains.
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+#
-+interface(`userdom_manage_all_users_keys',`
-+ gen_require(`
-+ attribute userdomain;
-+ ')
-+
-+ allow $1 userdomain:key manage_key_perms;
-+')
-+
-+########################################
-+##
-+## dontaudit search keys for all user domains.
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+#
-+interface(`userdom_dontaudit_search_all_users_keys',`
-+ gen_require(`
-+ attribute userdomain;
-+ ')
-+
-+ dontaudit $1 userdomain:key search;
-+')
-+
-+########################################
-+##
- ## Send a dbus message to all user domains.
- ##
- ##
-@@ -5513,3 +5666,546 @@
- interface(`userdom_unconfined',`
- refpolicywarn(`$0($*) has been deprecated.')
- ')
-+
-+########################################
-+##
-+## allow getattr all user file type
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+##
-+#
-+interface(`userdom_list_user_files',`
-+ gen_require(`
-+ attribute user_home_type;
-+ ')
-+
-+ allow $2 user_home_type:dir search_dir_perms;
-+ allow $2 user_home_type:file getattr;
-+')
-+
-+########################################
-+##
-+## Do not audit attempts to write to homedirs of sysadm users
-+## home directory.
-+##
-+##
-+##
-+## Domain to not audit.
-+##
-+##
-+#
-+interface(`userdom_dontaudit_write_sysadm_home_dirs',`
-+ gen_require(`
-+ type admin_home_t;
-+ ')
-+
-+ dontaudit $1 admin_home_t:dir write;
-+')
-+
-+########################################
-+##
-+## Ptrace all user domains.
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+##
-+#
-+interface(`userdom_ptrace_all_users',`
-+ gen_require(`
-+ attribute userdomain;
-+ ')
-+
-+ allow $1 userdomain:process ptrace;
-+')
-+
-+########################################
-+##
-+## unlink all unprivileged users home directory
-+## files.
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+#
-+interface(`userdom_unlink_unpriv_users_home_content_files',`
-+ gen_require(`
-+ attribute user_home_dir_type, user_home_type;
-+ ')
-+
-+ files_search_home($1)
-+ allow $1 user_home_dir_type:dir list_dir_perms;
-+ allow $1 user_home_type:file unlink;
-+')
-+
-+########################################
-+##
-+## dontaudit search all users home directory
-+## files.
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+#
-+interface(`userdom_dontaudit_search_users_home_dirs',`
-+
-+ gen_require(`
-+ attribute user_home_dir_type;
-+ ')
-+
-+ files_search_home($1)
-+ dontaudit $1 user_home_dir_type:dir search_dir_perms;
-+')
-+
-+
-+########################################
-+##
-+## Identify specified type as being in a users home directory
-+##
-+##
-+##
-+## Make the specified type a home type.
-+##
-+##
-+##
-+##
-+## Type to be used as a home directory type.
-+##
-+##
-+#
-+interface(`userdom_user_home_type',`
-+ gen_require(`
-+ attribute user_home_type;
-+ attribute home_type;
-+ ')
-+ typeattribute $1 user_home_type;
-+ typeattribute $1 home_type;
-+')
-+
-+########################################
-+##
-+## Do not audit attempts to relabel unpriv user
-+## home files.
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+#
-+interface(`userdom_dontaudit_relabel_unpriv_user_home_content_files',`
-+ gen_require(`
-+ attribute user_home_type;
-+ ')
-+
-+ dontaudit $1 user_home_type:file { relabelto relabelfrom };
-+')
-+
-+
-+########################################
-+##
-+## Mmap of unpriv user
-+## home files.
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+#
-+interface(`userdom_mmap_unpriv_user_home_content_files',`
-+ gen_require(`
-+ attribute user_home_type;
-+ ')
-+
-+ files_search_home($1)
-+ allow $1 user_home_type:file execute;
-+')
-+
-+########################################
-+##
-+## dontaudit attempts to write to user home dir files
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+#
-+interface(`userdom_dontaudit_write_unpriv_user_home_content_files',`
-+ gen_require(`
-+ attribute user_home_type;
-+ ')
-+
-+ allow $1 user_home_type:file write_file_perms;
-+')
-+
-+########################################
-+##
-+## Allow apps to set rlimits on userdomain
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+#
-+interface(`userdom_set_rlimitnh',`
-+ gen_require(`
-+ attribute userdomain;
-+ ')
-+ allow $1 userdomain:process rlimitinh;
-+')
-+
-+########################################
-+##
-+## Define this type as a Allow apps to set rlimits on userdomain
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+##
-+##
-+## The prefix of the user domain (e.g., user
-+## is the prefix for user_t).
-+##
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+#
-+template(`userdom_unpriv_usertype',`
-+ gen_require(`
-+ attribute unpriv_userdomain, userdomain;
-+ attribute $1_usertype;
-+ ')
-+ typeattribute $2 $1_usertype;
-+ typeattribute $2 unpriv_userdomain;
-+ typeattribute $2 userdomain;
-+
-+# optional_policy(`
-+# xserver_usertype($1, $2)
-+# ')
-+')
-+
-+
-+########################################
-+##
-+## Manage and create all files in /tmp on behalf of the user
-+##
-+##
-+##
-+## The interface for full access to the temporary directories.
-+## This creates a derived type for the user
-+## temporary type. Execute access is not given.
-+##
-+##
-+## This is a templated interface, and should only
-+## be called from a per-userdomain template.
-+##
-+##
-+##
-+##
-+## The prefix of the user domain (e.g., user
-+## is the prefix for user_t).
-+##
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+##
-+##
-+## The class of the object to be created.
-+## If not specified, file is used.
-+##
-+##
-+#
-+template(`userdom_transition_user_tmp',`
-+ gen_require(`
-+ type user_tmp_t;
-+ ')
-+
-+ files_tmp_filetrans($2, user_tmp_t, $3)
-+')
-+
-+################################################
-+##
-+## Allow unpriv users read domains system state
-+##
-+##
-+## Allow the ps command visibility to processes in
-+## the specified domain when used by an
-+## unprivileged user
-+##
-+##
-+##
-+## Domain for which the ps command will have access
-+##
-+##
-+##
-+##
-+#
-+interface(`userdom_readable_process',`
-+ gen_require(`
-+ attribute unpriv_process;
-+ ')
-+
-+ typeattribute $1 unpriv_process;
-+')
-+
-+########################################
-+##
-+## Read user tmpfs files.
-+##
-+##
-+##
-+## Read user tmpfs files.
-+##
-+##
-+## This is a templated interface, and should only
-+## be called from a per-userdomain template.
-+##
-+##
-+##
-+##
-+## The prefix of the user domain (e.g., user
-+## is the prefix for user_t).
-+##
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+#
-+template(`userdom_read_user_tmpfs_files',`
-+ gen_require(`
-+ type user_tmpfs_t;
-+ ')
-+
-+ fs_search_tmpfs($2)
-+ allow $2 user_tmpfs_t:dir list_dir_perms;
-+ read_files_pattern($2, user_tmpfs_t, user_tmpfs_t)
-+ read_lnk_files_pattern($2, user_tmpfs_t, user_tmpfs_t)
-+')
-+
-+#######################################
-+##
-+## The template for creating a unprivileged user roughly
-+## equivalent to a regular linux user.
-+##
-+##
-+##
-+## The template for creating a unprivileged user roughly
-+## equivalent to a regular linux user.
-+##
-+##
-+## This template creates a user domain, types, and
-+## rules for the user's tty, pty, home directories,
-+## tmp, and tmpfs files.
-+##
-+##
-+##
-+##
-+## The prefix of the user domain (e.g., user
-+## is the prefix for user_t).
-+##
-+##
-+#
-+template(`userdom_admin_login_user_template',`
-+
-+ userdom_unpriv_user_template($1)
-+
-+ domain_read_all_domains_state($1_t)
-+ domain_getattr_all_domains($1_t)
-+
-+ files_read_kernel_modules($1_t)
-+
-+ kernel_read_fs_sysctls($1_t)
-+
-+ modutils_read_module_config($1_t)
-+ modutils_read_module_deps($1_t)
-+
-+ miscfiles_read_hwdata($1_t)
-+
-+ sudo_per_role_template($1, $1_t, $1_r)
-+ seutil_run_newrole($1_t, $1_r, { $1_tty_device_t $1_devpts_t })
-+
-+ optional_policy(`
-+ gnomeclock_dbus_chat($1_t)
-+ ')
-+
-+ optional_policy(`
-+ kerneloops_dbus_chat($1_t)
-+ ')
-+
-+ optional_policy(`
-+ rpm_dbus_chat($1_t)
-+ ')
-+
-+ optional_policy(`
-+ setroubleshoot_stream_connect($1_t)
-+ ')
-+
-+ optional_policy(`
-+ netutils_run_ping_cond($1_t, $1_r, { $1_tty_device_t $1_devpts_t })
-+ netutils_run_traceroute_cond($1_t, $1_r, { $1_tty_device_t $1_devpts_t })
-+ ')
-+')
-+
-+
-+########################################
-+##
-+## Relabel to all user home directories.
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+#
-+interface(`userdom_relabel_all_home_dirs',`
-+ gen_require(`
-+ attribute user_home_type;
-+ ')
-+
-+ files_search_home($1)
-+ relabel_dirs_pattern($1, user_home_type, user_home_type)
-+')
-+
-+########################################
-+##
-+## Relabel to all user home files.
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+#
-+interface(`userdom_relabel_all_home_files',`
-+ gen_require(`
-+ attribute user_home_type;
-+ ')
-+
-+ files_search_home($1)
-+ relabel_files_pattern($1, user_home_type, user_home_type)
-+')
-+
-+########################################
-+##
-+## Read all users home directories symlinks.
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+#
-+interface(`userdom_read_all_users_home_content_symlinks',`
-+ gen_require(`
-+ attribute home_type;
-+ ')
-+
-+ files_list_home($1)
-+ read_lnk_files_pattern($1, home_type, home_type)
-+')
-+
-+########################################
-+##
-+## delete all directories
-+## in all users home directories.
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+#
-+interface(`userdom_delete_all_users_home_content_dirs',`
-+ gen_require(`
-+ attribute home_type;
-+ ')
-+
-+ files_list_home($1)
-+ delete_dirs_pattern($1, home_type, home_type)
-+')
-+
-+########################################
-+##
-+## Delete all symlinks
-+## in all users home directories.
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+#
-+interface(`userdom_delete_all_users_home_content_symlinks',`
-+ gen_require(`
-+ attribute home_type;
-+ ')
-+
-+ files_list_home($1)
-+ delete_lnk_files_pattern($1, home_type, home_type)
-+')
-+
-+########################################
-+##
-+## Do not audit attempts to unlink to the
-+## users home directory.
-+##
-+##
-+##
-+## Domain to not audit.
-+##
-+##
-+#
-+interface(`userdom_dontaudit_unlink_unpriv_home_content_files',`
-+ gen_require(`
-+ type user_home_t;
-+ ')
-+
-+ dontaudit $1 user_home_t:file unlink;
-+')
-+
-+#######################################
-+##
-+## The template for creating a tmpfs type
-+## that the user has full access.
-+##
-+##
-+##
-+## Domain allowed access.
-+##
-+##
-+#
-+interface(`userdom_manage_tmpfs',`
-+ gen_require(`
-+ type user_tmpfs_t;
-+ ')
-+
-+ manage_dirs_pattern($1, user_tmpfs_t, user_tmpfs_t)
-+ manage_files_pattern($1, user_tmpfs_t, user_tmpfs_t)
-+ manage_lnk_files_pattern($1, user_tmpfs_t, user_tmpfs_t)
-+ manage_sock_files_pattern($1, user_tmpfs_t, user_tmpfs_t)
-+ manage_fifo_files_pattern($1, user_tmpfs_t, user_tmpfs_t)
-+ fs_tmpfs_filetrans($1, user_tmpfs_t, { dir file lnk_file sock_file fifo_file })
-+')
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdomain.te serefpolicy-3.5.13/policy/modules/system/userdomain.te
---- nsaserefpolicy/policy/modules/system/userdomain.te 2008-10-14 11:58:09.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/system/userdomain.te 2008-10-28 10:56:19.000000000 -0400
-@@ -8,13 +8,6 @@
-
- ##
- ##
--## Allow users to connect to mysql
--##
--##
--gen_tunable(allow_user_mysql_connect,false)
--
--##
--##
- ## Allow users to connect to PostgreSQL
- ##
- ##
-@@ -29,13 +22,6 @@
-
- ##
- ##
--## Allow users to read system messages.
--##
--##
--gen_tunable(user_dmesg,false)
--
--##
--##
- ## Allow user to r/w files on filesystems
- ## that do not have extended attributes (FAT, CDROM, FLOPPY)
- ##
-@@ -58,6 +44,12 @@
- # users home directory contents
- attribute home_type;
-
-+# Executables to be run by user
-+attribute user_exec_type;
-+
-+# File types owned by users
-+attribute user_file_type;
-+
- # The privhome attribute identifies every domain that can create files under
- # regular user home directories in the regular context (IE act on behalf of
- # a user in writing regular files)
-@@ -81,6 +73,76 @@
-
- # unprivileged user domains
- attribute unpriv_userdomain;
-+attribute unpriv_process;
-
- attribute untrusted_content_type;
- attribute untrusted_content_tmp_type;
-+
-+type admin_home_t, home_type;
-+files_type(admin_home_t)
-+files_associate_tmp(admin_home_t)
-+fs_associate_tmpfs(admin_home_t)
-+files_mountpoint(admin_home_t)
-+
-+type user_home_t, user_file_type, user_home_type, home_type;
-+files_type(user_home_t)
-+files_associate_tmp(user_home_t)
-+fs_associate_tmpfs(user_home_t)
-+files_mountpoint(user_home_t)
-+files_poly_parent(user_home_t)
-+files_poly_member(user_home_t)
-+
-+# type of home directory
-+type user_home_dir_t, home_dir_type, user_home_dir_type, home_type;
-+files_type(user_home_dir_t)
-+files_mountpoint(user_home_dir_t)
-+files_associate_tmp(user_home_dir_t)
-+fs_associate_tmpfs(user_home_dir_t)
-+files_poly(user_home_dir_t)
-+files_poly_member(user_home_dir_t)
-+files_poly_parent(user_home_dir_t)
-+
-+type user_tmp_t, user_file_type, user_tmpfile;
-+files_tmp_file(user_tmp_t)
-+
-+type user_tmpfs_t, user_file_type;
-+files_tmpfs_file(user_tmpfs_t)
-+
-+
-+##############################
-+#
-+# User home directory file rules
-+#
-+
-+allow user_file_type user_home_t:filesystem associate;
-+
-+# Rules used to associate a homedir as a mountpoint
-+allow user_home_t self:filesystem associate;
-+
-+tunable_policy(`allow_console_login',`
-+ term_use_console(userdomain)
-+')
-+
-+# Allow unpriv users to read system state of unpriv processes
-+read_files_pattern(unpriv_userdomain, unpriv_process, unpriv_process)
-+read_lnk_files_pattern(unpriv_userdomain, unpriv_process, unpriv_process)
-+allow unpriv_userdomain unpriv_process:process getattr;
-+dontaudit unpriv_userdomain unpriv_process:process ptrace;
-+
-+
-+tunable_policy(`use_nfs_home_dirs',`
-+ manage_dirs_pattern(privhome, nfs_t, nfs_t)
-+ manage_files_pattern(privhome, nfs_t, nfs_t)
-+ manage_lnk_files_pattern(privhome, nfs_t, nfs_t)
-+ manage_sock_files_pattern(privhome, nfs_t, nfs_t)
-+ manage_fifo_files_pattern(privhome, nfs_t, nfs_t)
-+')
-+
-+tunable_policy(`use_samba_home_dirs',`
-+ manage_dirs_pattern(privhome, cifs_t, cifs_t)
-+ manage_files_pattern(privhome, cifs_t, cifs_t)
-+ manage_lnk_files_pattern(privhome, cifs_t, cifs_t)
-+ manage_sock_files_pattern(privhome, cifs_t, cifs_t)
-+ manage_fifo_files_pattern(privhome, cifs_t, cifs_t)
-+')
-+
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/xen.fc serefpolicy-3.5.13/policy/modules/system/xen.fc
---- nsaserefpolicy/policy/modules/system/xen.fc 2008-08-07 11:15:12.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/system/xen.fc 2008-10-28 10:56:19.000000000 -0400
-@@ -20,6 +20,7 @@
- /var/run/xenconsoled\.pid -- gen_context(system_u:object_r:xenconsoled_var_run_t,s0)
- /var/run/xend(/.*)? gen_context(system_u:object_r:xend_var_run_t,s0)
- /var/run/xend\.pid -- gen_context(system_u:object_r:xend_var_run_t,s0)
-+/var/run/xenner(/.*)? gen_context(system_u:object_r:xend_var_run_t,s0)
- /var/run/xenstore\.pid -- gen_context(system_u:object_r:xenstored_var_run_t,s0)
- /var/run/xenstored(/.*)? gen_context(system_u:object_r:xenstored_var_run_t,s0)
-
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/xen.if serefpolicy-3.5.13/policy/modules/system/xen.if
---- nsaserefpolicy/policy/modules/system/xen.if 2008-08-07 11:15:12.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/system/xen.if 2008-11-04 11:36:33.000000000 -0500
-@@ -155,7 +155,7 @@
- stream_connect_pattern($1,xenstored_var_run_t,xenstored_var_run_t,xenstored_t)
- ')
-
--########################################
-+#######################################
- ##
- ## Connect to xend over an unix domain stream socket.
- ##
-@@ -167,11 +167,14 @@
- #
- interface(`xen_stream_connect',`
- gen_require(`
-- type xend_t, xend_var_run_t;
-+ type xend_t, xend_var_run_t, xend_var_lib_t;
- ')
-
- files_search_pids($1)
- stream_connect_pattern($1,xend_var_run_t,xend_var_run_t,xend_t)
-+
-+ files_search_var_lib($1)
-+ stream_connect_pattern($1, xend_var_lib_t, xend_var_lib_t, xend_t)
- ')
-
- ########################################
-@@ -191,3 +194,24 @@
-
- domtrans_pattern($1,xm_exec_t,xm_t)
- ')
-+
-+########################################
-+##
-+## Allow the specified domain to read/write
-+## xend image files.
-+##
-+##
-+##
-+## Domain allowed to transition.
-+##
-+##
-+#
-+interface(`xen_rw_image_files',`
-+ gen_require(`
-+ type xen_image_t, xend_var_lib_t;
-+ ')
-+
-+ files_list_var_lib($1)
-+ allow $1 xend_var_lib_t:dir search_dir_perms;
-+ rw_files_pattern($1, xen_image_t, xen_image_t)
-+')
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/xen.te serefpolicy-3.5.13/policy/modules/system/xen.te
---- nsaserefpolicy/policy/modules/system/xen.te 2008-10-16 17:21:16.000000000 -0400
-+++ serefpolicy-3.5.13/policy/modules/system/xen.te 2008-10-28 10:56:19.000000000 -0400
-@@ -6,6 +6,13 @@
- # Declarations
- #
-
-+##
-+##
-+## Allow xen to manage nfs files
-+##
-+##
-+gen_tunable(xen_use_nfs, false)
-+
- # console ptys
- type xen_devpts_t;
- term_pty(xen_devpts_t);
-@@ -42,25 +49,31 @@
- # pid files
- type xend_var_run_t;
- files_pid_file(xend_var_run_t)
-+files_mountpoint(xend_var_run_t)
-
- type xenstored_t;
- type xenstored_exec_t;
--domain_type(xenstored_t)
--domain_entry_file(xenstored_t,xenstored_exec_t)
--role system_r types xenstored_t;
-+init_daemon_domain(xenstored_t, xenstored_exec_t)
-+
-+# tmp files
-+type xenstored_tmp_t;
-+files_tmp_file(xenstored_tmp_t)
-
- # var/lib files
- type xenstored_var_lib_t;
- files_type(xenstored_var_lib_t)
-
-+# log files
-+type xenstored_var_log_t;
-+logging_log_file(xenstored_var_log_t)
-+
- # pid files
- type xenstored_var_run_t;
- files_pid_file(xenstored_var_run_t)
-
- type xenconsoled_t;
- type xenconsoled_exec_t;
--domain_type(xenconsoled_t)
--domain_entry_file(xenconsoled_t,xenconsoled_exec_t)
-+init_daemon_domain(xenconsoled_t, xenconsoled_exec_t)
- role system_r types xenconsoled_t;
-
- # pid files
-@@ -95,7 +108,7 @@
- read_lnk_files_pattern(xend_t,xen_image_t,xen_image_t)
- rw_blk_files_pattern(xend_t,xen_image_t,xen_image_t)
-
--allow xend_t xenctl_t:fifo_file manage_file_perms;
-+allow xend_t xenctl_t:fifo_file manage_fifo_file_perms;
- dev_filetrans(xend_t, xenctl_t, fifo_file)
-
- manage_files_pattern(xend_t,xend_tmp_t,xend_tmp_t)
-@@ -103,14 +116,14 @@
- files_tmp_filetrans(xend_t, xend_tmp_t, { file dir })
-
- # pid file
--allow xend_t xend_var_run_t:dir setattr;
-+manage_dirs_pattern(xend_t, xend_var_run_t, xend_var_run_t)
- manage_files_pattern(xend_t,xend_var_run_t,xend_var_run_t)
- manage_sock_files_pattern(xend_t,xend_var_run_t,xend_var_run_t)
- manage_fifo_files_pattern(xend_t,xend_var_run_t,xend_var_run_t)
--files_pid_filetrans(xend_t,xend_var_run_t, { file sock_file fifo_file })
-+files_pid_filetrans(xend_t, xend_var_run_t, { file sock_file fifo_file dir })
-
- # log files
--allow xend_t xend_var_log_t:dir setattr;
-+manage_dirs_pattern(xend_t, xend_var_log_t, xend_var_log_t)
- manage_files_pattern(xend_t,xend_var_log_t,xend_var_log_t)
- manage_sock_files_pattern(xend_t,xend_var_log_t,xend_var_log_t)
- logging_log_filetrans(xend_t,xend_var_log_t,{ sock_file file dir })
-@@ -122,12 +135,13 @@
- manage_fifo_files_pattern(xend_t,xend_var_lib_t,xend_var_lib_t)
- files_var_lib_filetrans(xend_t,xend_var_lib_t,{ file dir })
-
-+init_stream_connect_script(xend_t)
-+
- # transition to store
- domtrans_pattern(xend_t, xenstored_exec_t, xenstored_t)
-
- # transition to console
--domain_auto_trans(xend_t, xenconsoled_exec_t, xenconsoled_t)
--allow xenconsoled_t xend_t:fd use;
-+domtrans_pattern(xend_t, xenconsoled_exec_t, xenconsoled_t)
-
- kernel_read_kernel_sysctls(xend_t)
- kernel_read_system_state(xend_t)
-@@ -173,6 +187,7 @@
- files_manage_etc_runtime_files(xend_t)
- files_etc_filetrans_etc_runtime(xend_t,file)
- files_read_usr_files(xend_t)
-+files_read_default_symlinks(xend_t)
-
- storage_raw_read_fixed_disk(xend_t)
- storage_raw_write_fixed_disk(xend_t)
-@@ -204,11 +219,15 @@
- sysnet_read_dhcpc_pid(xend_t)
- sysnet_rw_dhcp_config(xend_t)
-
-+sysadm_dontaudit_search_home_dirs(xend_t)
-+
- xen_stream_connect_xenstore(xend_t)
-
- netutils_domtrans(xend_t)
-
--sysadm_dontaudit_search_home_dirs(xend_t)
-+optional_policy(`
-+ brctl_domtrans(xend_t)
-+')
-
- optional_policy(`
- consoletype_exec(xend_t)
-@@ -242,6 +261,8 @@
-
- files_read_usr_files(xenconsoled_t)
-
-+fs_list_tmpfs(xenconsoled_t)
-+
- term_create_pty(xenconsoled_t,xen_devpts_t);
- term_use_generic_ptys(xenconsoled_t)
- term_use_console(xenconsoled_t)
-@@ -254,7 +275,7 @@
-
- miscfiles_read_localization(xenconsoled_t)
-
--xen_append_log(xenconsoled_t)
-+xen_manage_log(xenconsoled_t)
- xen_stream_connect_xenstore(xenconsoled_t)
-
- ########################################
-@@ -262,15 +283,25 @@
- # Xen store local policy
- #
-
--allow xenstored_t self:capability { dac_override mknod ipc_lock };
-+allow xenstored_t self:capability { dac_override mknod ipc_lock sys_resource };
- allow xenstored_t self:unix_stream_socket create_stream_socket_perms;
- allow xenstored_t self:unix_dgram_socket create_socket_perms;
-
-+manage_files_pattern(xenstored_t, xenstored_tmp_t, xenstored_tmp_t)
-+manage_dirs_pattern(xenstored_t, xenstored_tmp_t, xenstored_tmp_t)
-+files_tmp_filetrans(xenstored_t, xenstored_tmp_t, { file dir })
-+
- # pid file
- manage_files_pattern(xenstored_t,xenstored_var_run_t,xenstored_var_run_t)
- manage_sock_files_pattern(xenstored_t,xenstored_var_run_t,xenstored_var_run_t)
- files_pid_filetrans(xenstored_t,xenstored_var_run_t, { file sock_file })
-
-+# log files
-+manage_dirs_pattern(xenstored_t, xenstored_var_log_t, xenstored_var_log_t)
-+manage_files_pattern(xenstored_t, xenstored_var_log_t, xenstored_var_log_t)
-+manage_sock_files_pattern(xenstored_t, xenstored_var_log_t, xenstored_var_log_t)
-+logging_log_filetrans(xenstored_t, xenstored_var_log_t, { sock_file file dir })
-+
- # var/lib files for xenstored
- manage_dirs_pattern(xenstored_t,xenstored_var_lib_t,xenstored_var_lib_t)
- manage_files_pattern(xenstored_t,xenstored_var_lib_t,xenstored_var_lib_t)
-@@ -321,18 +352,21 @@
-
- manage_files_pattern(xm_t,xend_var_lib_t,xend_var_lib_t)
- manage_fifo_files_pattern(xm_t,xend_var_lib_t,xend_var_lib_t)
-+manage_sock_files_pattern(xm_t, xend_var_lib_t, xend_var_lib_t)
- files_search_var_lib(xm_t)
-
- allow xm_t xen_image_t:dir rw_dir_perms;
- allow xm_t xen_image_t:file read_file_perms;
- allow xm_t xen_image_t:blk_file read_blk_file_perms;
-
--kernel_read_system_state(xm_t)
- kernel_read_kernel_sysctls(xm_t)
-+kernel_read_sysctl(xm_t)
-+kernel_read_system_state(xm_t)
- kernel_read_xen_state(xm_t)
- kernel_write_xen_state(xm_t)
-
- corecmd_exec_bin(xm_t)
-+corecmd_exec_shell(xm_t)
-
- corenet_tcp_sendrecv_generic_if(xm_t)
- corenet_tcp_sendrecv_all_nodes(xm_t)
-@@ -348,8 +382,11 @@
-
- storage_raw_read_fixed_disk(xm_t)
-
-+fs_getattr_all_fs(xm_t)
-+
- term_use_all_terms(xm_t)
-
-+init_stream_connect_script(xm_t)
- init_rw_script_stream_sockets(xm_t)
- init_use_fds(xm_t)
-
-@@ -360,6 +397,23 @@
-
- sysnet_read_config(xm_t)
-
-+sysadm_dontaudit_search_home_dirs(xm_t)
-+
- xen_append_log(xm_t)
- xen_stream_connect(xm_t)
- xen_stream_connect_xenstore(xm_t)
-+
-+#Should have a boolean wrapping these
-+fs_list_auto_mountpoints(xend_t)
-+files_search_mnt(xend_t)
-+fs_getattr_all_fs(xend_t)
-+fs_read_dos_files(xend_t)
-+
-+tunable_policy(`xen_use_nfs',`
-+ fs_manage_nfs_files(xend_t)
-+ fs_read_nfs_symlinks(xend_t)
-+')
-+
-+optional_policy(`
-+ unconfined_domain(xend_t)
-+')
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/policy_capabilities serefpolicy-3.5.13/policy/policy_capabilities
---- nsaserefpolicy/policy/policy_capabilities 2008-10-16 17:21:16.000000000 -0400
-+++ serefpolicy-3.5.13/policy/policy_capabilities 2008-10-28 10:56:19.000000000 -0400
-@@ -29,4 +29,4 @@
- # chr_file: open
- # blk_file: open
- #
--policycap open_perms;
-+#policycap open_perms;
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/support/obj_perm_sets.spt serefpolicy-3.5.13/policy/support/obj_perm_sets.spt
---- nsaserefpolicy/policy/support/obj_perm_sets.spt 2008-10-16 17:21:16.000000000 -0400
-+++ serefpolicy-3.5.13/policy/support/obj_perm_sets.spt 2008-10-28 10:56:19.000000000 -0400
-@@ -59,22 +59,22 @@
- #
- # Permissions for executing files.
- #
--define(`x_file_perms', `{ getattr open execute } refpolicywarn(`$0 is deprecated please use { getattr execute } instead.')')
-+define(`x_file_perms', `{ getattr execute } refpolicywarn(`$0 is deprecated please use { getattr execute } instead.')')
-
- #
- # Permissions for reading files and their attributes.
- #
--define(`r_file_perms', `{ open read getattr lock ioctl } refpolicywarn(`$0 is deprecated please use read_file_perms instead.')')
-+define(`r_file_perms', `{ read getattr lock ioctl } refpolicywarn(`$0 is deprecated please use read_file_perms instead.')')
-
- #
- # Permissions for reading and executing files.
- #
--define(`rx_file_perms', `{ open read getattr lock execute ioctl } refpolicywarn(`$0 is deprecated please use { mmap_file_perms ioctl lock } instead.')')
-+define(`rx_file_perms', `{ read getattr lock execute ioctl } refpolicywarn(`$0 is deprecated please use { mmap_file_perms ioctl lock } instead.')')
-
- #
- # Permissions for reading and appending to files.
- #
--define(`ra_file_perms', `{ open ioctl read getattr lock append } refpolicywarn(`$0 is deprecated please use { read_file_perms append_file_perms } instead.')')
-+define(`ra_file_perms', `{ ioctl read getattr lock append } refpolicywarn(`$0 is deprecated please use { read_file_perms append_file_perms } instead.')')
-
- #
- # Permissions for linking, unlinking and renaming files.
-@@ -89,12 +89,17 @@
- #
- # Permissions for reading directories and their attributes.
- #
--define(`r_dir_perms', `{ open read getattr lock search ioctl } refpolicywarn(`$0 is deprecated please use list_dir_perms instead.')')
-+define(`r_dir_perms', `{ read getattr lock search ioctl } refpolicywarn(`$0 is deprecated please use list_dir_perms instead.')')
-+
-+#
-+# Permissions for reading and writing directories and their attributes.
-+#
-+define(`rw_dir_perms', `{ read getattr lock search ioctl add_name remove_name write }')
-
- #
- # Permissions for reading and adding names to directories.
- #
--define(`ra_dir_perms', `{ open read getattr lock search ioctl add_name write } refpolicywarn(`$0 is deprecated please use { list_dir_perms add_entry_dir_perms } instead.')')
-+define(`ra_dir_perms', `{ read getattr lock search ioctl add_name write } refpolicywarn(`$0 is deprecated please use { list_dir_perms add_entry_dir_perms } instead.')')
-
-
- #
-@@ -182,10 +187,9 @@
- define(`getattr_dir_perms',`{ getattr }')
- define(`setattr_dir_perms',`{ setattr }')
- define(`search_dir_perms',`{ getattr search }')
--define(`list_dir_perms',`{ getattr search open read lock ioctl }')
--define(`add_entry_dir_perms',`{ getattr search open lock ioctl write add_name }')
--define(`del_entry_dir_perms',`{ getattr search open lock ioctl write remove_name }')
--define(`rw_dir_perms', `{ open read getattr lock search ioctl add_name remove_name write }')
-+define(`list_dir_perms',`{ getattr search read lock ioctl }')
-+define(`add_entry_dir_perms',`{ getattr search lock ioctl write add_name }')
-+define(`del_entry_dir_perms',`{ getattr search lock ioctl write remove_name }')
- define(`create_dir_perms',`{ getattr create }')
- define(`rename_dir_perms',`{ getattr rename }')
- define(`delete_dir_perms',`{ getattr rmdir }')
-@@ -199,12 +203,12 @@
- #
- define(`getattr_file_perms',`{ getattr }')
- define(`setattr_file_perms',`{ setattr }')
--define(`read_file_perms',`{ getattr open read lock ioctl }')
--define(`mmap_file_perms',`{ getattr open read execute ioctl }')
--define(`exec_file_perms',`{ getattr open read execute execute_no_trans }')
--define(`append_file_perms',`{ getattr open append lock ioctl }')
--define(`write_file_perms',`{ getattr open write append lock ioctl }')
--define(`rw_file_perms',`{ getattr open read write append ioctl lock }')
-+define(`read_file_perms',`{ getattr read lock ioctl }')
-+define(`mmap_file_perms',`{ getattr read execute ioctl }')
-+define(`exec_file_perms',`{ getattr read execute execute_no_trans }')
-+define(`append_file_perms',`{ getattr append lock ioctl }')
-+define(`write_file_perms',`{ getattr write append lock ioctl }')
-+define(`rw_file_perms',`{ getattr read write append ioctl lock }')
- define(`create_file_perms',`{ getattr create open }')
- define(`rename_file_perms',`{ getattr rename }')
- define(`delete_file_perms',`{ getattr unlink }')
-@@ -235,10 +239,10 @@
- #
- define(`getattr_fifo_file_perms',`{ getattr }')
- define(`setattr_fifo_file_perms',`{ setattr }')
--define(`read_fifo_file_perms',`{ getattr open read lock ioctl }')
--define(`append_fifo_file_perms',`{ getattr open append lock ioctl }')
--define(`write_fifo_file_perms',`{ getattr open write append lock ioctl }')
--define(`rw_fifo_file_perms',`{ getattr open read write append ioctl lock }')
-+define(`read_fifo_file_perms',`{ getattr read lock ioctl }')
-+define(`append_fifo_file_perms',`{ getattr append lock ioctl }')
-+define(`write_fifo_file_perms',`{ getattr write append lock ioctl }')
-+define(`rw_fifo_file_perms',`{ getattr read write append ioctl lock }')
- define(`create_fifo_file_perms',`{ getattr create open }')
- define(`rename_fifo_file_perms',`{ getattr rename }')
- define(`delete_fifo_file_perms',`{ getattr unlink }')
-@@ -268,10 +272,10 @@
- #
- define(`getattr_blk_file_perms',`{ getattr }')
- define(`setattr_blk_file_perms',`{ setattr }')
--define(`read_blk_file_perms',`{ getattr open read lock ioctl }')
--define(`append_blk_file_perms',`{ getattr open append lock ioctl }')
--define(`write_blk_file_perms',`{ getattr open write append lock ioctl }')
--define(`rw_blk_file_perms',`{ getattr open read write append ioctl lock }')
-+define(`read_blk_file_perms',`{ getattr read lock ioctl }')
-+define(`append_blk_file_perms',`{ getattr append lock ioctl }')
-+define(`write_blk_file_perms',`{ getattr write append lock ioctl }')
-+define(`rw_blk_file_perms',`{ getattr read write append ioctl lock }')
- define(`create_blk_file_perms',`{ getattr create }')
- define(`rename_blk_file_perms',`{ getattr rename }')
- define(`delete_blk_file_perms',`{ getattr unlink }')
-@@ -285,10 +289,10 @@
- #
- define(`getattr_chr_file_perms',`{ getattr }')
- define(`setattr_chr_file_perms',`{ setattr }')
--define(`read_chr_file_perms',`{ getattr open read lock ioctl }')
--define(`append_chr_file_perms',`{ getattr open append lock ioctl }')
--define(`write_chr_file_perms',`{ getattr open write append lock ioctl }')
--define(`rw_chr_file_perms',`{ getattr open read write append ioctl lock }')
-+define(`read_chr_file_perms',`{ getattr read lock ioctl }')
-+define(`append_chr_file_perms',`{ getattr append lock ioctl }')
-+define(`write_chr_file_perms',`{ getattr write append lock ioctl }')
-+define(`rw_chr_file_perms',`{ getattr read write append ioctl lock }')
- define(`create_chr_file_perms',`{ getattr create }')
- define(`rename_chr_file_perms',`{ getattr rename }')
- define(`delete_chr_file_perms',`{ getattr unlink }')
-@@ -305,10 +309,20 @@
- #
- # Use (read and write) terminals
- #
--define(`rw_term_perms', `{ getattr open read write ioctl }')
-+define(`rw_term_perms', `{ getattr read write ioctl }')
-
- #
- # Sockets
- #
- define(`client_stream_socket_perms', `{ create ioctl read getattr write setattr append bind getopt setopt shutdown }')
- define(`server_stream_socket_perms', `{ client_stream_socket_perms listen accept }')
-+
-+define(`all_capabilities', `{ chown dac_override dac_read_search fowner fsetid kill setgid setuid setpcap linux_immutable net_bind_service net_broadcast net_admin net_raw ipc_lock ipc_owner sys_module sys_rawio sys_chroot sys_ptrace sys_pacct sys_admin sys_boot sys_nice sys_resource sys_time sys_tty_config mknod lease audit_write audit_control setfcap }
-+')
-+
-+define(`all_nscd_perms', `{ getserv getpwd getgrp gethost getstat admin shmempwd shmemgrp shmemhost shmemserv } ')
-+define(`all_dbus_perms', `{ acquire_svc send_msg } ')
-+define(`all_passwd_perms', `{ passwd chfn chsh rootok crontab } ')
-+define(`all_association_perms', `{ sendto recvfrom setcontext polmatch } ')
-+
-+define(`manage_key_perms', `{ create link read search setattr view write } ')
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/users serefpolicy-3.5.13/policy/users
---- nsaserefpolicy/policy/users 2008-08-07 11:15:13.000000000 -0400
-+++ serefpolicy-3.5.13/policy/users 2008-10-28 19:21:24.000000000 -0400
-@@ -25,11 +25,8 @@
- # permit any access to such users, then remove this entry.
- #
- gen_user(user_u, user, user_r, s0, s0)
--gen_user(staff_u, staff, staff_r sysadm_r ifdef(`enable_mls',`secadm_r auditadm_r'), s0, s0 - mls_systemhigh, mcs_allcats)
--gen_user(sysadm_u, sysadm, sysadm_r, s0, s0 - mls_systemhigh, mcs_allcats)
--
--# Until order dependence is fixed for users:
--gen_user(unconfined_u, unconfined, unconfined_r, s0, s0 - mls_systemhigh, mcs_allcats)
-+gen_user(staff_u, user, staff_r system_r sysadm_r ifdef(`enable_mls',`secadm_r auditadm_r'), s0, s0 - mls_systemhigh, mcs_allcats)
-+gen_user(sysadm_u, user, sysadm_r, s0, s0 - mls_systemhigh, mcs_allcats)
-
- #
- # The following users correspond to Unix identities.
-@@ -38,8 +35,4 @@
- # role should use the staff_r role instead of the user_r role when
- # not in the sysadm_r.
- #
--ifdef(`direct_sysadm_daemon',`
-- gen_user(root, sysadm, sysadm_r staff_r ifdef(`enable_mls',`secadm_r auditadm_r') system_r, s0, s0 - mls_systemhigh, mcs_allcats)
--',`
-- gen_user(root, sysadm, sysadm_r staff_r ifdef(`enable_mls',`secadm_r auditadm_r'), s0, s0 - mls_systemhigh, mcs_allcats)
--')
-+gen_user(root, user, unconfined_r sysadm_r staff_r ifdef(`enable_mls',`secadm_r auditadm_r') system_r, s0, s0 - mls_systemhigh, mcs_allcats)
-diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/support/Makefile.devel serefpolicy-3.5.13/support/Makefile.devel
---- nsaserefpolicy/support/Makefile.devel 2008-08-07 11:15:14.000000000 -0400
-+++ serefpolicy-3.5.13/support/Makefile.devel 2008-10-28 10:56:19.000000000 -0400
-@@ -181,8 +181,7 @@
- tmp/%.mod: $(m4support) tmp/all_interfaces.conf %.te
- @$(EINFO) "Compiling $(NAME) $(basename $(@F)) module"
- @test -d $(@D) || mkdir -p $(@D)
-- $(call peruser-expansion,$(basename $(@F)),$@.role)
-- $(verbose) $(M4) $(M4PARAM) -s $^ $@.role > $(@:.mod=.tmp)
-+ $(verbose) $(M4) $(M4PARAM) -s $^ > $(@:.mod=.tmp)
- $(verbose) $(CHECKMODULE) -m $(@:.mod=.tmp) -o $@
-
- tmp/%.mod.fc: $(m4support) %.fc
diff --git a/policy-20081111.patch b/policy-20081111.patch
index 968e8e7..149a3dd 100644
--- a/policy-20081111.patch
+++ b/policy-20081111.patch
@@ -1102,7 +1102,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
java_domtrans_unconfined(rpm_script_t)
diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/admin/sudo.if serefpolicy-3.6.1/policy/modules/admin/sudo.if
--- nsaserefpolicy/policy/modules/admin/sudo.if 2008-11-11 16:13:49.000000000 -0500
-+++ serefpolicy-3.6.1/policy/modules/admin/sudo.if 2008-11-25 09:45:43.000000000 -0500
++++ serefpolicy-3.6.1/policy/modules/admin/sudo.if 2008-12-03 14:12:34.000000000 -0500
@@ -51,7 +51,7 @@
#
@@ -1112,7 +1112,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
allow $1_sudo_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem execstack execheap };
allow $1_sudo_t self:process { setexec setrlimit };
allow $1_sudo_t self:fd use;
-@@ -64,33 +64,36 @@
+@@ -64,33 +64,37 @@
allow $1_sudo_t self:unix_stream_socket create_stream_socket_perms;
allow $1_sudo_t self:unix_dgram_socket sendto;
allow $1_sudo_t self:unix_stream_socket connectto;
@@ -1137,6 +1137,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
dev_read_urand($1_sudo_t)
+ dev_rw_generic_usb_dev($1_sudo_t)
++ dev_list_sysfs($1_sudo_t)
fs_search_auto_mountpoints($1_sudo_t)
fs_getattr_xattr_fs($1_sudo_t)
@@ -1153,7 +1154,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
domain_use_interactive_fds($1_sudo_t)
domain_sigchld_interactive_fds($1_sudo_t)
-@@ -102,9 +105,11 @@
+@@ -102,9 +106,11 @@
files_getattr_usr_files($1_sudo_t)
# for some PAM modules and for cwd
files_dontaudit_search_home($1_sudo_t)
@@ -1165,7 +1166,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
logging_send_syslog_msg($1_sudo_t)
miscfiles_read_localization($1_sudo_t)
-@@ -114,6 +119,30 @@
+@@ -114,6 +120,30 @@
userdom_manage_user_tmp_files($1_sudo_t)
userdom_manage_user_tmp_symlinks($1_sudo_t)
userdom_use_user_terminals($1_sudo_t)
@@ -1456,8 +1457,8 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
+#/usr/libexec/gconfd-2 -- gen_context(system_u:object_r:gconfd_exec_t,s0)
diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/apps/gnome.if serefpolicy-3.6.1/policy/modules/apps/gnome.if
--- nsaserefpolicy/policy/modules/apps/gnome.if 2008-11-11 16:13:41.000000000 -0500
-+++ serefpolicy-3.6.1/policy/modules/apps/gnome.if 2008-11-25 09:45:43.000000000 -0500
-@@ -91,3 +91,106 @@
++++ serefpolicy-3.6.1/policy/modules/apps/gnome.if 2008-12-03 16:50:28.000000000 -0500
+@@ -91,3 +91,131 @@
allow $1 gnome_home_t:file manage_file_perms;
userdom_search_user_home_dirs($1)
')
@@ -1506,6 +1507,30 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
+
+########################################
+##
++## read gconf config files
++##
++##
++##
++## The prefix of the user domain (e.g., user
++## is the prefix for user_t).
++##
++##
++##
++##
++## The type of the user domain.
++##
++##
++#
++template(`gnome_read_gconf_config',`
++ gen_require(`
++ type gconf_etc_t;
++ ')
++
++ read_files_pattern($1, gconf_etc_t, gconf_etc_t)
++')
++
++########################################
++##
+## Execute gconf programs in
+## in the caller domain.
+##
@@ -1538,6 +1563,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
+ type gconf_home_t;
+ ')
+
++ allow $1 gconf_home_t:dir list_dir_perms;
+ read_files_pattern($1, gconf_home_t, gconf_home_t)
+')
+
@@ -2113,6 +2139,17 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
userdom_search_user_home_dirs($1)
')
+diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/apps/mozilla.te serefpolicy-3.6.1/policy/modules/apps/mozilla.te
+--- nsaserefpolicy/policy/modules/apps/mozilla.te 2008-11-11 16:13:42.000000000 -0500
++++ serefpolicy-3.6.1/policy/modules/apps/mozilla.te 2008-12-03 09:00:27.000000000 -0500
+@@ -105,6 +105,7 @@
+ # Should not need other ports
+ corenet_dontaudit_tcp_sendrecv_generic_port(mozilla_t)
+ corenet_dontaudit_tcp_bind_generic_port(mozilla_t)
++corenet_tcp_connect_speech_port(mozilla_t)
+
+ dev_read_urand(mozilla_t)
+ dev_read_rand(mozilla_t)
diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/apps/mplayer.fc serefpolicy-3.6.1/policy/modules/apps/mplayer.fc
--- nsaserefpolicy/policy/modules/apps/mplayer.fc 2008-11-11 16:13:42.000000000 -0500
+++ serefpolicy-3.6.1/policy/modules/apps/mplayer.fc 2008-11-25 09:45:43.000000000 -0500
@@ -2425,8 +2462,8 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
+')
diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/apps/nsplugin.te serefpolicy-3.6.1/policy/modules/apps/nsplugin.te
--- nsaserefpolicy/policy/modules/apps/nsplugin.te 1969-12-31 19:00:00.000000000 -0500
-+++ serefpolicy-3.6.1/policy/modules/apps/nsplugin.te 2008-12-01 16:31:07.000000000 -0500
-@@ -0,0 +1,272 @@
++++ serefpolicy-3.6.1/policy/modules/apps/nsplugin.te 2008-12-03 09:00:12.000000000 -0500
+@@ -0,0 +1,273 @@
+
+policy_module(nsplugin, 1.0.0)
+
@@ -2511,6 +2548,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
+corenet_tcp_sendrecv_generic_if(nsplugin_t)
+corenet_tcp_sendrecv_all_nodes(nsplugin_t)
+corenet_tcp_connect_ipp_port(nsplugin_t)
++corenet_tcp_connect_speech_port(nsplugin_t)
+
+domain_dontaudit_read_all_domains_state(nsplugin_t)
+
@@ -3851,7 +3889,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
##
diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/kernel/corenetwork.te.in serefpolicy-3.6.1/policy/modules/kernel/corenetwork.te.in
--- nsaserefpolicy/policy/modules/kernel/corenetwork.te.in 2008-11-12 09:13:46.000000000 -0500
-+++ serefpolicy-3.6.1/policy/modules/kernel/corenetwork.te.in 2008-12-01 15:41:36.000000000 -0500
++++ serefpolicy-3.6.1/policy/modules/kernel/corenetwork.te.in 2008-12-03 08:59:59.000000000 -0500
@@ -65,10 +65,12 @@
type server_packet_t, packet_type, server_packet_type;
@@ -3935,19 +3973,20 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
network_port(printer, tcp,515,s0)
network_port(ptal, tcp,5703,s0)
network_port(pxe, udp,4011,s0)
-@@ -160,9 +179,10 @@
+@@ -160,9 +179,11 @@
network_port(rwho, udp,513,s0)
network_port(smbd, tcp,137-139,s0, tcp,445,s0)
network_port(smtp, tcp,25,s0, tcp,465,s0, tcp,587,s0)
-network_port(snmp, udp,161,s0, udp,162,s0, tcp,199,s0)
+network_port(snmp, udp,161,s0, udp,162,s0, tcp,199,s0, tcp, 1161, s0)
network_port(spamd, tcp,783,s0)
++network_port(speech, tcp,8036,s0)
network_port(ssh, tcp,22,s0)
+network_port(streaming, tcp, 1755, s0, udp, 1755, s0)
network_port(soundd, tcp,8000,s0, tcp,9433,s0, tcp, 16001, s0)
type socks_port_t, port_type; dnl network_port(socks) # no defined portcon
type stunnel_port_t, port_type; dnl network_port(stunnel) # no defined portcon in current strict
-@@ -171,13 +191,16 @@
+@@ -171,13 +192,16 @@
network_port(syslogd, udp,514,s0)
network_port(telnetd, tcp,23,s0)
network_port(tftp, udp,69,s0)
@@ -4668,7 +4707,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
## all protocols (TCP, UDP, etc)
diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/kernel/domain.te serefpolicy-3.6.1/policy/modules/kernel/domain.te
--- nsaserefpolicy/policy/modules/kernel/domain.te 2008-11-11 16:13:41.000000000 -0500
-+++ serefpolicy-3.6.1/policy/modules/kernel/domain.te 2008-12-01 16:50:59.000000000 -0500
++++ serefpolicy-3.6.1/policy/modules/kernel/domain.te 2008-12-03 15:24:41.000000000 -0500
@@ -5,6 +5,13 @@
#
# Declarations
@@ -9666,7 +9705,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
+')
diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/services/cron.te serefpolicy-3.6.1/policy/modules/services/cron.te
--- nsaserefpolicy/policy/modules/services/cron.te 2008-11-11 16:13:46.000000000 -0500
-+++ serefpolicy-3.6.1/policy/modules/services/cron.te 2008-11-25 09:45:43.000000000 -0500
++++ serefpolicy-3.6.1/policy/modules/services/cron.te 2008-12-03 14:11:06.000000000 -0500
@@ -38,6 +38,10 @@
type cron_var_lib_t;
files_type(cron_var_lib_t)
@@ -9687,12 +9726,13 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
type crond_var_run_t;
files_pid_file(crond_var_run_t)
-@@ -103,6 +109,12 @@
+@@ -103,6 +109,13 @@
files_type(user_cron_spool_t)
ubac_constrained(user_cron_spool_t)
+type system_cronjob_var_lib_t;
+files_type(system_cronjob_var_lib_t)
++typealias system_cronjob_var_lib_t alias system_crond_var_lib_t;
+
+type system_cronjob_var_run_t;
+files_pid_file(system_cronjob_var_run_t)
@@ -9700,7 +9740,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
########################################
#
# Admin crontab local policy
-@@ -130,7 +142,7 @@
+@@ -130,7 +143,7 @@
# Cron daemon local policy
#
@@ -9709,7 +9749,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
dontaudit crond_t self:capability { sys_resource sys_tty_config };
allow crond_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem execstack execheap };
allow crond_t self:process { setexec setfscreate };
-@@ -149,15 +161,14 @@
+@@ -149,15 +162,14 @@
allow crond_t crond_var_run_t:file manage_file_perms;
files_pid_filetrans(crond_t,crond_var_run_t,file)
@@ -9728,7 +9768,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
kernel_read_kernel_sysctls(crond_t)
kernel_search_key(crond_t)
-@@ -183,6 +194,8 @@
+@@ -183,6 +195,8 @@
corecmd_read_bin_symlinks(crond_t)
domain_use_interactive_fds(crond_t)
@@ -9737,7 +9777,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
files_read_etc_files(crond_t)
files_read_generic_spool(crond_t)
-@@ -192,10 +205,13 @@
+@@ -192,10 +206,13 @@
files_search_default(crond_t)
init_rw_utmp(crond_t)
@@ -9751,7 +9791,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
seutil_read_config(crond_t)
seutil_read_default_contexts(crond_t)
-@@ -208,6 +224,7 @@
+@@ -208,6 +225,7 @@
userdom_list_user_home_dirs(crond_t)
mta_send_mail(crond_t)
@@ -9759,7 +9799,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
ifdef(`distro_debian',`
# pam_limits is used
-@@ -227,21 +244,45 @@
+@@ -227,21 +245,45 @@
')
')
@@ -9806,7 +9846,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
')
optional_policy(`
-@@ -283,6 +324,9 @@
+@@ -283,6 +325,9 @@
allow system_cronjob_t cron_var_lib_t:file manage_file_perms;
files_var_lib_filetrans(system_cronjob_t, cron_var_lib_t, file)
@@ -9816,7 +9856,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
allow system_cronjob_t system_cron_spool_t:file read_file_perms;
# The entrypoint interface is not used as this is not
# a regular entrypoint. Since crontab files are
-@@ -314,9 +358,13 @@
+@@ -314,9 +359,13 @@
filetrans_pattern(system_cronjob_t, crond_tmp_t, system_cronjob_tmp_t, { file lnk_file })
files_tmp_filetrans(system_cronjob_t, system_cronjob_tmp_t, file)
@@ -9831,7 +9871,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
kernel_read_kernel_sysctls(system_cronjob_t)
kernel_read_system_state(system_cronjob_t)
-@@ -370,7 +418,8 @@
+@@ -370,7 +419,8 @@
init_read_utmp(system_cronjob_t)
init_dontaudit_rw_utmp(system_cronjob_t)
# prelink tells init to restart it self, we either need to allow or dontaudit
@@ -9841,7 +9881,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
auth_use_nsswitch(system_cronjob_t)
-@@ -378,6 +427,7 @@
+@@ -378,6 +428,7 @@
libs_exec_ld_so(system_cronjob_t)
logging_read_generic_logs(system_cronjob_t)
@@ -9849,7 +9889,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
logging_send_syslog_msg(system_cronjob_t)
miscfiles_read_localization(system_cronjob_t)
-@@ -428,11 +478,20 @@
+@@ -428,11 +479,20 @@
')
optional_policy(`
@@ -9870,7 +9910,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
')
optional_policy(`
-@@ -460,8 +519,7 @@
+@@ -460,8 +520,7 @@
')
optional_policy(`
@@ -9880,7 +9920,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
')
optional_policy(`
-@@ -469,17 +527,11 @@
+@@ -469,17 +528,11 @@
')
optional_policy(`
@@ -10661,8 +10701,8 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
+')
diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/services/dbus.te serefpolicy-3.6.1/policy/modules/services/dbus.te
--- nsaserefpolicy/policy/modules/services/dbus.te 2008-11-11 16:13:46.000000000 -0500
-+++ serefpolicy-3.6.1/policy/modules/services/dbus.te 2008-11-25 09:45:43.000000000 -0500
-@@ -9,11 +9,11 @@
++++ serefpolicy-3.6.1/policy/modules/services/dbus.te 2008-12-03 14:17:27.000000000 -0500
+@@ -9,14 +9,15 @@
#
# Delcarations
#
@@ -10676,7 +10716,11 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
type dbusd_exec_t;
corecmd_executable_file(dbusd_exec_t)
-@@ -31,11 +31,23 @@
++typealias dbusd_exec_t alias system_dbusd_exec_t;
+
+ type session_dbusd_tmp_t;
+ typealias session_dbusd_tmp_t alias { user_dbusd_tmp_t staff_dbusd_tmp_t sysadm_dbusd_tmp_t };
+@@ -31,11 +32,23 @@
files_tmp_file(system_dbusd_tmp_t)
type system_dbusd_var_lib_t;
@@ -10701,7 +10745,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
##############################
#
# System bus local policy
-@@ -45,7 +57,7 @@
+@@ -45,7 +58,7 @@
# cjp: dac_override should probably go in a distro_debian
allow system_dbusd_t self:capability { dac_override setgid setpcap setuid };
dontaudit system_dbusd_t self:capability sys_tty_config;
@@ -10710,7 +10754,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
allow system_dbusd_t self:fifo_file rw_fifo_file_perms;
allow system_dbusd_t self:dbus { send_msg acquire_svc };
allow system_dbusd_t self:unix_stream_socket { connectto create_stream_socket_perms connectto };
-@@ -53,6 +65,8 @@
+@@ -53,6 +66,8 @@
# Receive notifications of policy reloads and enforcing status changes.
allow system_dbusd_t self:netlink_selinux_socket { create bind read };
@@ -10719,7 +10763,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
allow system_dbusd_t dbusd_etc_t:dir list_dir_perms;
read_files_pattern(system_dbusd_t, dbusd_etc_t, dbusd_etc_t)
read_lnk_files_pattern(system_dbusd_t, dbusd_etc_t, dbusd_etc_t)
-@@ -75,6 +89,8 @@
+@@ -75,6 +90,8 @@
fs_getattr_all_fs(system_dbusd_t)
fs_search_auto_mountpoints(system_dbusd_t)
@@ -10728,7 +10772,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
selinux_get_fs_mount(system_dbusd_t)
selinux_validate_context(system_dbusd_t)
-@@ -91,7 +107,6 @@
+@@ -91,7 +108,6 @@
corecmd_list_bin(system_dbusd_t)
corecmd_read_bin_pipes(system_dbusd_t)
corecmd_read_bin_sockets(system_dbusd_t)
@@ -10736,7 +10780,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
domain_use_interactive_fds(system_dbusd_t)
-@@ -101,6 +116,8 @@
+@@ -101,6 +117,8 @@
init_use_fds(system_dbusd_t)
init_use_script_ptys(system_dbusd_t)
@@ -10745,7 +10789,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
logging_send_audit_msgs(system_dbusd_t)
logging_send_syslog_msg(system_dbusd_t)
-@@ -128,9 +145,34 @@
+@@ -128,9 +146,34 @@
')
optional_policy(`
@@ -12422,7 +12466,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
-#')
diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/services/mta.if serefpolicy-3.6.1/policy/modules/services/mta.if
--- nsaserefpolicy/policy/modules/services/mta.if 2008-11-11 16:13:46.000000000 -0500
-+++ serefpolicy-3.6.1/policy/modules/services/mta.if 2008-11-25 14:26:16.000000000 -0500
++++ serefpolicy-3.6.1/policy/modules/services/mta.if 2008-12-03 16:44:26.000000000 -0500
@@ -130,6 +130,15 @@
sendmail_create_log($1_mail_t)
')
@@ -12461,6 +12505,15 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
')
')
+@@ -612,7 +624,7 @@
+ ')
+
+ files_dontaudit_search_spool($1)
+- dontaudit $1 mail_spool_t:dir search;
++ dontaudit $1 mail_spool_t:dir search_dir_perms;
+ dontaudit $1 mail_spool_t:lnk_file read;
+ dontaudit $1 mail_spool_t:file getattr;
+ ')
@@ -665,7 +677,7 @@
files_search_spool($1)
allow $1 mail_spool_t:dir list_dir_perms;
@@ -12749,7 +12802,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
+
diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/services/munin.te serefpolicy-3.6.1/policy/modules/services/munin.te
--- nsaserefpolicy/policy/modules/services/munin.te 2008-11-11 16:13:46.000000000 -0500
-+++ serefpolicy-3.6.1/policy/modules/services/munin.te 2008-11-25 09:45:43.000000000 -0500
++++ serefpolicy-3.6.1/policy/modules/services/munin.te 2008-12-02 15:10:58.000000000 -0500
@@ -13,6 +13,9 @@
type munin_etc_t alias lrrd_etc_t;
files_config_file(munin_etc_t)
@@ -12802,7 +12855,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
corenet_all_recvfrom_unlabeled(munin_t)
corenet_all_recvfrom_netlabel(munin_t)
-@@ -73,24 +82,34 @@
+@@ -73,24 +82,35 @@
corenet_udp_sendrecv_all_nodes(munin_t)
corenet_tcp_sendrecv_all_ports(munin_t)
corenet_udp_sendrecv_all_ports(munin_t)
@@ -12828,6 +12881,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
+auth_use_nsswitch(munin_t)
+
logging_send_syslog_msg(munin_t)
++logging_read_all_logs(munin_t)
+miscfiles_read_fonts(munin_t)
miscfiles_read_localization(munin_t)
@@ -12838,7 +12892,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
userdom_dontaudit_use_unpriv_user_fds(munin_t)
userdom_dontaudit_search_user_home_dirs(munin_t)
-@@ -105,7 +124,21 @@
+@@ -105,7 +125,30 @@
')
optional_policy(`
@@ -12849,6 +12903,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
+optional_policy(`
+ mta_read_config(munin_t)
+ mta_send_mail(munin_t)
++ mta_read_queue(munin_t)
+')
+
+optional_policy(`
@@ -12857,11 +12912,19 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
+')
+
+optional_policy(`
++ postfix_list_spool(munin_t)
++')
++
++optional_policy(`
++ rpc_search_nfs_state_data(munin_t)
++')
++
++optional_policy(`
+ sendmail_read_log(munin_t)
')
optional_policy(`
-@@ -115,3 +148,9 @@
+@@ -115,3 +158,10 @@
optional_policy(`
udev_read_db(munin_t)
')
@@ -12871,6 +12934,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
+
+manage_dirs_pattern(munin_t, httpd_munin_content_t, httpd_munin_content_t)
+manage_files_pattern(munin_t, httpd_munin_content_t, httpd_munin_content_t)
++
diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/services/nagios.fc serefpolicy-3.6.1/policy/modules/services/nagios.fc
--- nsaserefpolicy/policy/modules/services/nagios.fc 2008-08-07 11:15:11.000000000 -0400
+++ serefpolicy-3.6.1/policy/modules/services/nagios.fc 2008-11-25 09:45:43.000000000 -0500
@@ -13904,6 +13968,29 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
term_use_ptmx(ntpd_t)
+diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/services/nx.te serefpolicy-3.6.1/policy/modules/services/nx.te
+--- nsaserefpolicy/policy/modules/services/nx.te 2008-11-11 16:13:47.000000000 -0500
++++ serefpolicy-3.6.1/policy/modules/services/nx.te 2008-12-03 14:42:01.000000000 -0500
+@@ -25,6 +25,9 @@
+ type nx_server_var_run_t;
+ files_pid_file(nx_server_var_run_t)
+
++type nx_server_home_ssh_t;
++files_type(nx_server_home_ssh_t)
++
+ ########################################
+ #
+ # NX server local policy
+@@ -44,6 +47,9 @@
+ manage_files_pattern(nx_server_t, nx_server_var_run_t, nx_server_var_run_t)
+ files_pid_filetrans(nx_server_t, nx_server_var_run_t, file)
+
++manage_dirs_pattern(nx_server_t, nx_server_home_ssh_t, nx_server_home_ssh_t)
++manage_files_pattern(nx_server_t, nx_server_home_ssh_t, nx_server_home_ssh_t)
++
+ kernel_read_system_state(nx_server_t)
+ kernel_read_kernel_sysctls(nx_server_t)
+
diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/services/oddjob.fc serefpolicy-3.6.1/policy/modules/services/oddjob.fc
--- nsaserefpolicy/policy/modules/services/oddjob.fc 2008-08-07 11:15:11.000000000 -0400
+++ serefpolicy-3.6.1/policy/modules/services/oddjob.fc 2008-11-25 09:45:43.000000000 -0500
@@ -14078,7 +14165,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
##
diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/services/openvpn.te serefpolicy-3.6.1/policy/modules/services/openvpn.te
--- nsaserefpolicy/policy/modules/services/openvpn.te 2008-11-11 16:13:46.000000000 -0500
-+++ serefpolicy-3.6.1/policy/modules/services/openvpn.te 2008-11-25 09:45:43.000000000 -0500
++++ serefpolicy-3.6.1/policy/modules/services/openvpn.te 2008-12-03 10:19:06.000000000 -0500
@@ -22,6 +22,9 @@
type openvpn_etc_t;
files_config_file(openvpn_etc_t)
@@ -14089,7 +14176,15 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
type openvpn_initrc_exec_t;
init_script_file(openvpn_initrc_exec_t)
-@@ -47,10 +50,11 @@
+@@ -40,6 +43,7 @@
+
+ allow openvpn_t self:capability { dac_read_search dac_override net_bind_service net_admin setgid setuid sys_chroot sys_tty_config };
+ allow openvpn_t self:process { signal getsched };
++allow openvpn_t self:fifo_file rw_fifo_file_perms;
+
+ allow openvpn_t self:unix_dgram_socket { create_socket_perms sendto };
+ allow openvpn_t self:unix_stream_socket { create_stream_socket_perms connectto };
+@@ -47,10 +51,11 @@
allow openvpn_t self:tcp_socket server_stream_socket_perms;
allow openvpn_t self:netlink_route_socket rw_netlink_socket_perms;
@@ -14103,6 +14198,15 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
allow openvpn_t openvpn_var_log_t:file manage_file_perms;
logging_log_filetrans(openvpn_t, openvpn_var_log_t, file)
+@@ -99,6 +104,8 @@
+
+ sysnet_dns_name_resolve(openvpn_t)
+ sysnet_exec_ifconfig(openvpn_t)
++sysnet_write_config(openvpn_t)
++sysnet_etc_filetrans_config(openvpn_t)
+
+ userdom_use_user_terminals(openvpn_t)
+
diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/services/pads.fc serefpolicy-3.6.1/policy/modules/services/pads.fc
--- nsaserefpolicy/policy/modules/services/pads.fc 1969-12-31 19:00:00.000000000 -0500
+++ serefpolicy-3.6.1/policy/modules/services/pads.fc 2008-11-25 09:45:43.000000000 -0500
@@ -15863,7 +15967,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
/usr/sbin/postkick -- gen_context(system_u:object_r:postfix_master_exec_t,s0)
diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/services/postfix.if serefpolicy-3.6.1/policy/modules/services/postfix.if
--- nsaserefpolicy/policy/modules/services/postfix.if 2008-11-11 16:13:45.000000000 -0500
-+++ serefpolicy-3.6.1/policy/modules/services/postfix.if 2008-11-25 09:45:43.000000000 -0500
++++ serefpolicy-3.6.1/policy/modules/services/postfix.if 2008-12-02 15:09:03.000000000 -0500
@@ -174,9 +174,8 @@
type postfix_etc_t;
')
@@ -19061,13 +19165,14 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
')
diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/services/spamassassin.fc serefpolicy-3.6.1/policy/modules/services/spamassassin.fc
--- nsaserefpolicy/policy/modules/services/spamassassin.fc 2008-11-25 09:01:08.000000000 -0500
-+++ serefpolicy-3.6.1/policy/modules/services/spamassassin.fc 2008-11-25 14:04:31.000000000 -0500
++++ serefpolicy-3.6.1/policy/modules/services/spamassassin.fc 2008-12-03 14:18:14.000000000 -0500
@@ -1,15 +1,24 @@
- HOME_DIR/\.spamassassin(/.*)? gen_context(system_u:object_r:spamassassin_home_t,s0)
-
+-HOME_DIR/\.spamassassin(/.*)? gen_context(system_u:object_r:spamassassin_home_t,s0)
++HOME_DIR/\.spamassassin(/.*)? gen_context(system_u:object_r:spamc_home_t,s0)
++
+/etc/rc\.d/init\.d/spamd -- gen_context(system_u:object_r:spamd_initrc_exec_t,s0)
+/etc/rc\.d/init\.d/mimedefang.* -- gen_context(system_u:object_r:spamd_initrc_exec_t,s0)
-+
+
/usr/bin/sa-learn -- gen_context(system_u:object_r:spamc_exec_t,s0)
-/usr/bin/spamassassin -- gen_context(system_u:object_r:spamassassin_exec_t,s0)
+/usr/bin/spamassassin -- gen_context(system_u:object_r:spamc_exec_t,s0)
@@ -19180,7 +19285,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
+')
diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/services/spamassassin.te serefpolicy-3.6.1/policy/modules/services/spamassassin.te
--- nsaserefpolicy/policy/modules/services/spamassassin.te 2008-11-25 09:01:08.000000000 -0500
-+++ serefpolicy-3.6.1/policy/modules/services/spamassassin.te 2008-11-25 14:02:44.000000000 -0500
++++ serefpolicy-3.6.1/policy/modules/services/spamassassin.te 2008-12-03 09:05:00.000000000 -0500
@@ -1,5 +1,5 @@
-policy_module(spamassassin, 2.0.1)
@@ -19243,7 +19348,15 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
type spamd_spool_t;
files_type(spamd_spool_t)
-@@ -221,11 +257,19 @@
+@@ -159,6 +195,7 @@
+ corenet_udp_sendrecv_all_ports(spamassassin_t)
+ corenet_tcp_connect_all_ports(spamassassin_t)
+ corenet_sendrecv_all_client_packets(spamassassin_t)
++ corenet_udp_bind_all_nodes(spamassassin_t)
+
+ sysnet_read_config(spamassassin_t)
+ ')
+@@ -221,11 +258,20 @@
manage_files_pattern(spamc_t, spamc_tmp_t, spamc_tmp_t)
files_tmp_filetrans(spamc_t, spamc_tmp_t, { file dir })
@@ -19257,13 +19370,14 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
# Allow connecting to a local spamd
allow spamc_t spamd_t:unix_stream_socket connectto;
allow spamc_t spamd_tmp_t:sock_file rw_sock_file_perms;
++spamd_stream_connect(spamc_t)
kernel_read_kernel_sysctls(spamc_t)
+kernel_read_system_state(spamc_t)
corenet_all_recvfrom_unlabeled(spamc_t)
corenet_all_recvfrom_netlabel(spamc_t)
-@@ -255,9 +299,15 @@
+@@ -255,9 +301,15 @@
files_dontaudit_search_var(spamc_t)
# cjp: this may be removable:
files_list_home(spamc_t)
@@ -19279,7 +19393,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
miscfiles_read_localization(spamc_t)
# cjp: this should probably be removed:
-@@ -265,31 +315,34 @@
+@@ -265,31 +317,34 @@
sysnet_read_config(spamc_t)
@@ -19326,7 +19440,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
')
########################################
-@@ -301,7 +354,7 @@
+@@ -301,7 +356,7 @@
# setuids to the user running spamc. Comment this if you are not
# using this ability.
@@ -19335,7 +19449,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
dontaudit spamd_t self:capability sys_tty_config;
allow spamd_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem execstack execheap };
allow spamd_t self:fd use;
-@@ -317,10 +370,13 @@
+@@ -317,10 +372,13 @@
allow spamd_t self:unix_stream_socket connectto;
allow spamd_t self:tcp_socket create_stream_socket_perms;
allow spamd_t self:udp_socket create_socket_perms;
@@ -19350,7 +19464,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
files_spool_filetrans(spamd_t, spamd_spool_t, { file dir })
manage_dirs_pattern(spamd_t, spamd_tmp_t, spamd_tmp_t)
-@@ -329,10 +385,11 @@
+@@ -329,10 +387,11 @@
# var/lib files for spamd
allow spamd_t spamd_var_lib_t:dir list_dir_perms;
@@ -19363,7 +19477,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
files_pid_filetrans(spamd_t, spamd_var_run_t, { dir file })
kernel_read_all_sysctls(spamd_t)
-@@ -382,22 +439,27 @@
+@@ -382,22 +441,27 @@
init_dontaudit_rw_utmp(spamd_t)
@@ -19395,7 +19509,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
fs_manage_cifs_files(spamd_t)
')
-@@ -415,6 +477,7 @@
+@@ -415,6 +479,7 @@
optional_policy(`
dcc_domtrans_client(spamd_t)
@@ -19403,7 +19517,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
dcc_stream_connect_dccifd(spamd_t)
')
-@@ -424,10 +487,6 @@
+@@ -424,10 +489,6 @@
')
optional_policy(`
@@ -19414,7 +19528,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
postfix_read_config(spamd_t)
')
-@@ -442,6 +501,10 @@
+@@ -442,6 +503,10 @@
optional_policy(`
razor_domtrans(spamd_t)
@@ -20360,7 +20474,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
/var/lib/pam_devperm/:0 -- gen_context(system_u:object_r:xdm_var_lib_t,s0)
diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/services/xserver.if serefpolicy-3.6.1/policy/modules/services/xserver.if
--- nsaserefpolicy/policy/modules/services/xserver.if 2008-11-11 16:13:47.000000000 -0500
-+++ serefpolicy-3.6.1/policy/modules/services/xserver.if 2008-11-25 11:11:15.000000000 -0500
++++ serefpolicy-3.6.1/policy/modules/services/xserver.if 2008-12-03 16:42:08.000000000 -0500
@@ -397,11 +397,12 @@
gen_require(`
type xdm_t, xdm_tmp_t;
@@ -20745,7 +20859,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
+
diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/services/xserver.te serefpolicy-3.6.1/policy/modules/services/xserver.te
--- nsaserefpolicy/policy/modules/services/xserver.te 2008-11-18 18:57:20.000000000 -0500
-+++ serefpolicy-3.6.1/policy/modules/services/xserver.te 2008-11-27 06:23:46.000000000 -0500
++++ serefpolicy-3.6.1/policy/modules/services/xserver.te 2008-12-03 16:48:20.000000000 -0500
@@ -34,6 +34,13 @@
##
@@ -20760,6 +20874,66 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
## Allow xdm logins as sysadm
##
##
+@@ -65,14 +72,14 @@
+
+ type iceauth_t;
+ type iceauth_exec_t;
+-typealias iceauth_t alias { user_iceauth_t staff_iceauth_t sysadm_iceauth_t };
++typealias iceauth_t alias { user_iceauth_t staff_iceauth_t sysadm_iceauth_t xguest_iceauth_t };
+ typealias iceauth_t alias { auditadm_iceauth_t secadm_iceauth_t };
+ application_domain(iceauth_t, iceauth_exec_t)
+ ubac_constrained(iceauth_t)
+
+ type iceauth_home_t;
+ typealias iceauth_home_t alias { user_iceauth_home_t staff_iceauth_home_t sysadm_iceauth_home_t };
+-typealias iceauth_home_t alias { auditadm_iceauth_home_t secadm_iceauth_home_t };
++typealias iceauth_home_t alias { auditadm_iceauth_home_t secadm_iceauth_home_t xguest_iceauth_home_t };
+ files_poly_member(iceauth_home_t)
+ userdom_user_home_content(iceauth_home_t)
+
+@@ -112,17 +119,17 @@
+ typealias user_client_xevent_t alias { auditadm_client_xevent_t secadm_client_xevent_t };
+
+ type user_fonts_t;
+-typealias user_fonts_t alias { staff_fonts_t sysadm_fonts_t };
++typealias user_fonts_t alias { staff_fonts_t sysadm_fonts_t xguest_fonts_t unconfined_fonts_t };
+ typealias user_fonts_t alias { auditadm_fonts_t secadm_fonts_t };
+ userdom_user_home_content(user_fonts_t)
+
+ type user_fonts_cache_t;
+-typealias user_fonts_cache_t alias { staff_fonts_cache_t sysadm_fonts_cache_t };
++typealias user_fonts_cache_t alias { staff_fonts_cache_t sysadm_fonts_cache_t xguest_fonts_cache_t unconfined_fonts_cache_t };
+ typealias user_fonts_cache_t alias { auditadm_fonts_cache_t secadm_fonts_cache_t };
+ userdom_user_home_content(user_fonts_cache_t)
+
+ type user_fonts_config_t;
+-typealias user_fonts_config_t alias { staff_fonts_config_t sysadm_fonts_config_t };
++typealias user_fonts_config_t alias { fonts_config_home_t staff_fonts_config_t sysadm_fonts_config_t xguest_fonts_config_t unconfined_fonts_config_t };
+ typealias user_fonts_config_t alias { auditadm_fonts_config_t secadm_fonts_config_t };
+ userdom_user_home_content(user_fonts_config_t)
+
+@@ -134,18 +141,18 @@
+ type xauth_t;
+ type xauth_exec_t;
+ typealias xauth_t alias { user_xauth_t staff_xauth_t sysadm_xauth_t };
+-typealias xauth_t alias { auditadm_xauth_t secadm_xauth_t };
++typealias xauth_t alias { auditadm_xauth_t secadm_xauth_t xguest_xauth_t unconfined_xauth_t };
+ application_domain(xauth_t, xauth_exec_t)
+ ubac_constrained(xauth_t)
+
+ type xauth_home_t;
+ typealias xauth_home_t alias { user_xauth_home_t staff_xauth_home_t sysadm_xauth_home_t };
+-typealias xauth_home_t alias { auditadm_xauth_home_t secadm_xauth_home_t };
++typealias xauth_home_t alias { auditadm_xauth_home_t secadm_xauth_home_t xguest_xauth_home_t unconfined_xauth_home_t };
+ files_poly_member(xauth_home_t)
+ userdom_user_home_content(xauth_home_t)
+
+ type xauth_tmp_t;
+-typealias xauth_tmp_t alias { user_xauth_tmp_t staff_xauth_tmp_t sysadm_xauth_tmp_t };
++typealias xauth_tmp_t alias { user_xauth_tmp_t staff_xauth_tmp_t sysadm_xauth_tmp_t xguest_xauth_tmp_t unconfined_xauth_tmp_t };
+ typealias xauth_tmp_t alias { auditadm_xauth_tmp_t secadm_xauth_tmp_t };
+ files_tmp_file(xauth_tmp_t)
+ ubac_constrained(xauth_tmp_t)
@@ -166,7 +173,10 @@
files_lock_file(xdm_lock_t)
@@ -20795,6 +20969,21 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
# type for /var/lib/xkb
type xkb_var_lib_t;
files_type(xkb_var_lib_t)
+@@ -197,12 +216,12 @@
+
+ type xserver_tmp_t;
+ typealias xserver_tmp_t alias { user_xserver_tmp_t staff_xserver_tmp_t sysadm_xserver_tmp_t };
+-typealias xserver_tmp_t alias { auditadm_xserver_tmp_t secadm_xserver_tmp_t };
++typealias xserver_tmp_t alias { auditadm_xserver_tmp_t secadm_xserver_tmp_t xdm_xserver_tmp_t };
+ files_tmp_file(xserver_tmp_t)
+ ubac_constrained(xserver_tmp_t)
+
+ type xserver_tmpfs_t;
+-typealias xserver_tmpfs_t alias { user_xserver_tmpfs_t staff_xserver_tmpfs_t sysadm_xserver_tmpfs_t };
++typealias xserver_tmpfs_t alias { user_xserver_tmpfs_t staff_xserver_tmpfs_t sysadm_xserver_tmpfs_t xguest_xserver_tmpfs_t unconfined_xserver_tmpfs_t };
+ typealias xserver_tmpfs_t alias { auditadm_xserver_tmpfs_t secadm_xserver_tmpfs_t };
+ files_tmpfs_file(xserver_tmpfs_t)
+ ubac_constrained(xserver_tmpfs_t)
@@ -256,6 +275,9 @@
allow xauth_t xauth_home_t:file manage_file_perms;
userdom_user_home_dir_filetrans(xauth_t, xauth_home_t, file)
@@ -20983,12 +21172,15 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
')
optional_policy(`
-@@ -515,6 +575,22 @@
+@@ -515,12 +575,35 @@
')
optional_policy(`
+ # Use dbus to start other processes as xdm_t
+ dbus_role_template(xdm, system_r, xdm_t)
++
++ dontaudit xdm_dbusd_t xdm_var_lib_t:dir search_dir_perms;
++
+ corecmd_bin_entry_type(xdm_t)
+
+ dbus_system_bus_client(xdm_t)
@@ -21006,7 +21198,17 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
# Talk to the console mouse server.
gpm_stream_connect(xdm_t)
gpm_setattr_gpmctl(xdm_t)
-@@ -542,6 +618,18 @@
+ ')
+
+ optional_policy(`
++ gnome_read_gconf_config(xdm_t)
++')
++
++optional_policy(`
+ hostname_exec(xdm_t)
+ ')
+
+@@ -542,6 +625,18 @@
')
optional_policy(`
@@ -21025,7 +21227,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
seutil_sigchld_newrole(xdm_t)
')
-@@ -550,8 +638,8 @@
+@@ -550,8 +645,8 @@
')
optional_policy(`
@@ -21035,7 +21237,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
ifndef(`distro_redhat',`
allow xdm_t self:process { execheap execmem };
-@@ -571,6 +659,10 @@
+@@ -571,6 +666,10 @@
')
optional_policy(`
@@ -21046,7 +21248,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
xfs_stream_connect(xdm_t)
')
-@@ -635,6 +727,15 @@
+@@ -635,6 +734,15 @@
manage_lnk_files_pattern(xserver_t, xkb_var_lib_t, xkb_var_lib_t)
files_search_var_lib(xserver_t)
@@ -21062,7 +21264,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
# Create files in /var/log with the xserver_log_t type.
manage_files_pattern(xserver_t, xserver_log_t, xserver_log_t)
logging_log_filetrans(xserver_t, xserver_log_t,file)
-@@ -682,6 +783,7 @@
+@@ -682,6 +790,7 @@
dev_rw_input_dev(xserver_t)
dev_rwx_zero(xserver_t)
@@ -21070,7 +21272,15 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
domain_mmap_low(xserver_t)
files_read_etc_files(xserver_t)
-@@ -806,7 +908,7 @@
+@@ -697,6 +806,7 @@
+ fs_search_nfs(xserver_t)
+ fs_search_auto_mountpoints(xserver_t)
+ fs_search_ramfs(xserver_t)
++fs_list_inotifyfs(xdm_t)
+
+ mls_xwin_read_to_clearance(xserver_t)
+
+@@ -806,7 +916,7 @@
allow xserver_t xdm_var_lib_t:file { getattr read };
dontaudit xserver_t xdm_var_lib_t:dir search;
@@ -21079,7 +21289,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
# Label pid and temporary files with derived types.
manage_files_pattern(xserver_t, xdm_tmp_t, xdm_tmp_t)
-@@ -830,6 +932,10 @@
+@@ -830,6 +940,10 @@
xserver_use_user_fonts(xserver_t)
@@ -21090,7 +21300,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
tunable_policy(`use_nfs_home_dirs',`
fs_manage_nfs_dirs(xserver_t)
fs_manage_nfs_files(xserver_t)
-@@ -844,11 +950,14 @@
+@@ -844,11 +958,14 @@
optional_policy(`
dbus_system_bus_client(xserver_t)
@@ -21106,7 +21316,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
')
optional_policy(`
-@@ -856,6 +965,11 @@
+@@ -856,6 +973,11 @@
rhgb_rw_tmpfs_files(xserver_t)
')
@@ -21118,7 +21328,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
########################################
#
# Rules common to all X window domains
-@@ -972,6 +1086,21 @@
+@@ -972,6 +1094,21 @@
allow xserver_unconfined_type { x_domain xserver_t }:x_resource *;
allow xserver_unconfined_type xevent_type:{ x_event x_synthetic_event } *;
@@ -21140,7 +21350,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
ifdef(`TODO',`
tunable_policy(`allow_polyinstantiation',`
# xdm needs access for linking .X11-unix to poly /tmp
-@@ -986,3 +1115,12 @@
+@@ -986,3 +1123,13 @@
#
allow xdm_t user_home_type:file unlink;
') dnl end TODO
@@ -21153,6 +21363,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
+tunable_policy(`allow_execstack',`
+ allow xdm_t self:process { execstack execmem };
+')
++
diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/services/zosremote.fc serefpolicy-3.6.1/policy/modules/services/zosremote.fc
--- nsaserefpolicy/policy/modules/services/zosremote.fc 1969-12-31 19:00:00.000000000 -0500
+++ serefpolicy-3.6.1/policy/modules/services/zosremote.fc 2008-11-25 09:45:43.000000000 -0500
@@ -21293,7 +21504,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
+/var/cache/coolkey(/.*)? gen_context(system_u:object_r:auth_cache_t,s0)
diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/authlogin.if serefpolicy-3.6.1/policy/modules/system/authlogin.if
--- nsaserefpolicy/policy/modules/system/authlogin.if 2008-11-11 16:13:48.000000000 -0500
-+++ serefpolicy-3.6.1/policy/modules/system/authlogin.if 2008-11-25 09:45:43.000000000 -0500
++++ serefpolicy-3.6.1/policy/modules/system/authlogin.if 2008-12-03 09:10:20.000000000 -0500
@@ -43,6 +43,7 @@
interface(`auth_login_pgm_domain',`
gen_require(`
@@ -21378,11 +21589,12 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
')
')
-@@ -207,19 +255,15 @@
+@@ -207,19 +255,16 @@
dev_read_rand($1)
dev_read_urand($1)
+ auth_use_nsswitch($1)
++ auth_rw_faillog($1)
+
logging_send_audit_msgs($1)
@@ -21402,7 +21614,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
')
optional_policy(`
-@@ -230,6 +274,29 @@
+@@ -230,6 +275,29 @@
optional_policy(`
samba_stream_connect_winbind($1)
')
@@ -21432,7 +21644,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
')
########################################
-@@ -254,6 +321,7 @@
+@@ -254,6 +322,7 @@
auth_domtrans_chk_passwd($1)
role $2 types chkpwd_t;
@@ -21440,7 +21652,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
')
########################################
-@@ -1031,6 +1099,32 @@
+@@ -1031,6 +1100,32 @@
########################################
##
@@ -21473,7 +21685,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
## Manage all files on the filesystem, except
## the shadow passwords and listed exceptions.
##
-@@ -1297,6 +1391,10 @@
+@@ -1297,6 +1392,10 @@
')
optional_policy(`
@@ -21484,7 +21696,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
nis_use_ypbind($1)
')
-@@ -1307,6 +1405,7 @@
+@@ -1307,6 +1406,7 @@
optional_policy(`
samba_stream_connect_winbind($1)
samba_read_var_files($1)
@@ -21492,7 +21704,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
')
')
-@@ -1341,3 +1440,61 @@
+@@ -1341,3 +1441,61 @@
typeattribute $1 can_write_shadow_passwords;
typeattribute $1 can_relabelto_shadow_passwords;
')
@@ -22640,7 +22852,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
+
diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/logging.if serefpolicy-3.6.1/policy/modules/system/logging.if
--- nsaserefpolicy/policy/modules/system/logging.if 2008-11-18 18:57:21.000000000 -0500
-+++ serefpolicy-3.6.1/policy/modules/system/logging.if 2008-11-25 09:45:43.000000000 -0500
++++ serefpolicy-3.6.1/policy/modules/system/logging.if 2008-12-02 15:03:25.000000000 -0500
@@ -707,6 +707,8 @@
files_search_var($1)
manage_files_pattern($1,logfile,logfile)
@@ -24098,7 +24310,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
+/etc/firestarter/firestarter\.sh gen_context(system_u:object_r:dhcpc_helper_exec_t,s0)
diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/sysnetwork.if serefpolicy-3.6.1/policy/modules/system/sysnetwork.if
--- nsaserefpolicy/policy/modules/system/sysnetwork.if 2008-11-11 16:13:48.000000000 -0500
-+++ serefpolicy-3.6.1/policy/modules/system/sysnetwork.if 2008-11-25 09:45:43.000000000 -0500
++++ serefpolicy-3.6.1/policy/modules/system/sysnetwork.if 2008-12-03 10:18:59.000000000 -0500
@@ -192,7 +192,25 @@
type dhcpc_state_t;
')
@@ -24786,7 +24998,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
+')
diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/unconfined.te serefpolicy-3.6.1/policy/modules/system/unconfined.te
--- nsaserefpolicy/policy/modules/system/unconfined.te 2008-11-11 16:13:48.000000000 -0500
-+++ serefpolicy-3.6.1/policy/modules/system/unconfined.te 2008-12-02 14:32:40.000000000 -0500
++++ serefpolicy-3.6.1/policy/modules/system/unconfined.te 2008-12-03 14:30:00.000000000 -0500
@@ -6,35 +6,76 @@
# Declarations
#
@@ -25053,7 +25265,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
')
########################################
-@@ -218,14 +289,58 @@
+@@ -218,14 +289,60 @@
allow unconfined_execmem_t self:process { execstack execmem };
unconfined_domain_noaudit(unconfined_execmem_t)
@@ -25078,7 +25290,7 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
+
+optional_policy(`
+ xserver_rw_shm(unconfined_execmem_t)
- ')
++')
+
+########################################
+#
@@ -25099,11 +25311,13 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
+ domtrans_pattern(unconfined_t, mplayer_exec_t, unconfined_execmem_t)
+')
+
++optional_policy(`
+tunable_policy(`allow_unconfined_nsplugin_transition',`', `
+ gen_require(`
+ type mozilla_exec_t;
+ ')
+ domtrans_pattern(unconfined_t, mozilla_exec_t, unconfined_execmem_t)
+ ')
+')
+
+optional_policy(`
@@ -25116,14 +25330,16 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
+gen_user(unconfined_u, user, unconfined_r system_r, s0, s0 - mls_systemhigh, mcs_allcats)
diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdomain.fc serefpolicy-3.6.1/policy/modules/system/userdomain.fc
--- nsaserefpolicy/policy/modules/system/userdomain.fc 2008-11-11 16:13:48.000000000 -0500
-+++ serefpolicy-3.6.1/policy/modules/system/userdomain.fc 2008-11-25 09:45:43.000000000 -0500
-@@ -1,4 +1,5 @@
++++ serefpolicy-3.6.1/policy/modules/system/userdomain.fc 2008-12-03 14:15:33.000000000 -0500
+@@ -1,4 +1,7 @@
HOME_DIR -d gen_context(system_u:object_r:user_home_dir_t,s0-mls_systemhigh)
+HOME_DIR -l gen_context(system_u:object_r:user_home_dir_t,s0-mls_systemhigh)
HOME_DIR/.+ gen_context(system_u:object_r:user_home_t,s0)
-
/tmp/gconfd-USER -d gen_context(system_u:object_r:user_tmp_t,s0)
+/root(/.*)? gen_context(system_u:object_r:admin_home_t,s0)
++/dev/shm/pulse-shm.* gen_context(system_u:object_r:user_tmpfs_t,s0)
++/dev/shm/mono.* gen_context(system_u:object_r:user_tmpfs_t,s0)
diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdomain.if serefpolicy-3.6.1/policy/modules/system/userdomain.if
--- nsaserefpolicy/policy/modules/system/userdomain.if 2008-11-13 18:40:02.000000000 -0500
+++ serefpolicy-3.6.1/policy/modules/system/userdomain.if 2008-12-02 14:58:08.000000000 -0500
@@ -27016,7 +27232,37 @@ diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/pol
+')
diff -b -B --ignore-all-space --exclude-from=exclude -N -u -r nsaserefpolicy/policy/support/obj_perm_sets.spt serefpolicy-3.6.1/policy/support/obj_perm_sets.spt
--- nsaserefpolicy/policy/support/obj_perm_sets.spt 2008-10-16 17:21:16.000000000 -0400
-+++ serefpolicy-3.6.1/policy/support/obj_perm_sets.spt 2008-11-25 09:45:43.000000000 -0500
++++ serefpolicy-3.6.1/policy/support/obj_perm_sets.spt 2008-12-03 15:26:17.000000000 -0500
+@@ -179,20 +179,20 @@
+ #
+ # Directory (dir)
+ #
+-define(`getattr_dir_perms',`{ getattr }')
+-define(`setattr_dir_perms',`{ setattr }')
+-define(`search_dir_perms',`{ getattr search }')
++define(`getattr_dir_perms',`{ getattr open }')
++define(`setattr_dir_perms',`{ setattr open }')
++define(`search_dir_perms',`{ getattr search open }')
+ define(`list_dir_perms',`{ getattr search open read lock ioctl }')
+ define(`add_entry_dir_perms',`{ getattr search open lock ioctl write add_name }')
+ define(`del_entry_dir_perms',`{ getattr search open lock ioctl write remove_name }')
+ define(`rw_dir_perms', `{ open read getattr lock search ioctl add_name remove_name write }')
+-define(`create_dir_perms',`{ getattr create }')
+-define(`rename_dir_perms',`{ getattr rename }')
+-define(`delete_dir_perms',`{ getattr rmdir }')
++define(`create_dir_perms',`{ getattr create open }')
++define(`rename_dir_perms',`{ getattr rename open }')
++define(`delete_dir_perms',`{ getattr rmdir open }')
+ define(`manage_dir_perms',`{ create open getattr setattr read write link unlink rename search add_name remove_name reparent rmdir lock ioctl }')
+-define(`relabelfrom_dir_perms',`{ getattr relabelfrom }')
+-define(`relabelto_dir_perms',`{ getattr relabelto }')
+-define(`relabel_dir_perms',`{ getattr relabelfrom relabelto }')
++define(`relabelfrom_dir_perms',`{ getattr open relabelfrom }')
++define(`relabelto_dir_perms',`{ getattr open relabelto }')
++define(`relabel_dir_perms',`{ getattr open relabelfrom relabelto }')
+
+ #
+ # Regular file (file)
@@ -312,3 +312,13 @@
#
define(`client_stream_socket_perms', `{ create ioctl read getattr write setattr append bind getopt setopt shutdown }')
diff --git a/selinux-policy.spec b/selinux-policy.spec
index beca6df..10b1803 100644
--- a/selinux-policy.spec
+++ b/selinux-policy.spec
@@ -20,7 +20,7 @@
Summary: SELinux policy configuration
Name: selinux-policy
Version: 3.6.1
-Release: 2%{?dist}
+Release: 3%{?dist}
License: GPLv2+
Group: System Environment/Base
Source: serefpolicy-%{version}.tgz
@@ -446,6 +446,9 @@ exit 0
%endif
%changelog
+* Wed Dec 3 2008 Dan Walsh 3.6.1-3
+- Cleanup policy
+
* Mon Dec 01 2008 Ignacio Vazquez-Abrams - 3.6.1-2
- Rebuild for Python 2.6