Chris PeBenito 17de1b
Chris PeBenito 4967aa
policy_module(xserver,1.4.1)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Declarations
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 56e1b3
ifdef(`strict_policy',`
Chris PeBenito 56e1b3
## <desc>
Chris PeBenito 56e1b3
## 

Chris PeBenito 56e1b3
## Allows clients to write to the X server shared
Chris PeBenito 56e1b3
## memory segments.
Chris PeBenito 56e1b3
## 

Chris PeBenito 56e1b3
## </desc>
Chris PeBenito 56e1b3
gen_tunable(allow_write_xshm,false)
Chris PeBenito 56e1b3
')
Chris PeBenito 56e1b3
Chris PeBenito 56e1b3
## <desc>
Chris PeBenito 56e1b3
## 

Chris PeBenito 56e1b3
## Allow xdm logins as sysadm
Chris PeBenito 56e1b3
## 

Chris PeBenito 56e1b3
## </desc>
Chris PeBenito 56e1b3
gen_tunable(xdm_sysadm_login,false)
Chris PeBenito 56e1b3
Chris PeBenito 17de1b
attribute fonts_type;
Chris PeBenito 17de1b
attribute fonts_cache_type;
Chris PeBenito 17de1b
attribute fonts_config_type;
Chris PeBenito 4967aa
attribute xauth_home_type;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type iceauth_exec_t;
Chris PeBenito 17de1b
corecmd_executable_file(iceauth_exec_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type xauth_exec_t;
Chris PeBenito 17de1b
corecmd_executable_file(xauth_exec_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# this is not actually a device, its a pipe
Chris PeBenito 17de1b
type xconsole_device_t;
Chris PeBenito 17de1b
files_type(xconsole_device_t)
Chris PeBenito 17de1b
fs_associate_tmpfs(xconsole_device_t)
Chris PeBenito 17de1b
files_associate_tmp(xconsole_device_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type xdm_t;
Chris PeBenito e070dd
type xdm_exec_t;
Chris PeBenito 4b3b46
auth_login_pgm_domain(xdm_t)
Chris PeBenito 17de1b
init_domain(xdm_t,xdm_exec_t)
Chris PeBenito 17de1b
init_daemon_domain(xdm_t,xdm_exec_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type xdm_lock_t;
Chris PeBenito 17de1b
files_lock_file(xdm_lock_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type xdm_rw_etc_t;
Chris PeBenito 17de1b
files_type(xdm_rw_etc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type xdm_var_lib_t;
Chris PeBenito 17de1b
files_type(xdm_var_lib_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type xdm_var_run_t;
Chris PeBenito 17de1b
files_pid_file(xdm_var_run_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type xdm_tmp_t;
Chris PeBenito 17de1b
files_tmp_file(xdm_tmp_t)
Chris PeBenito 6b19be
typealias xdm_tmp_t alias ice_tmp_t;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type xdm_tmpfs_t;
Chris PeBenito 17de1b
files_tmpfs_file(xdm_tmpfs_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# type for /var/lib/xkb
Chris PeBenito 17de1b
type xkb_var_lib_t;
Chris PeBenito 17de1b
files_type(xkb_var_lib_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# Type for the executable used to start the X server, e.g. Xwrapper.
Chris PeBenito 17de1b
type xserver_exec_t;
Chris PeBenito 17de1b
corecmd_executable_file(xserver_exec_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type xsession_exec_t;
Chris PeBenito 17de1b
corecmd_executable_file(xsession_exec_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# Type for the X server log file.
Chris PeBenito 17de1b
type xserver_log_t;
Chris PeBenito 17de1b
logging_log_file(xserver_log_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
xserver_common_domain_template(xdm)
Chris PeBenito 17de1b
init_system_domain(xdm_xserver_t,xserver_exec_t)
Chris PeBenito 17de1b
Chris PeBenito e070dd
ifdef(`enable_mcs',`
Chris PeBenito e070dd
	init_ranged_domain(xdm_t,xdm_exec_t,s0 - mcs_systemhigh)
Chris PeBenito e070dd
	init_ranged_daemon_domain(xdm_t,xdm_exec_t,s0 - mcs_systemhigh)
Chris PeBenito e070dd
')
Chris PeBenito e070dd
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	prelink_object_file(xkb_var_lib_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# XDM Local policy
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
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 };
Chris PeBenito a5e213
allow xdm_t self:process { setexec setpgid getsched setsched setrlimit signal_perms setkeycreate };
Chris PeBenito c0868a
allow xdm_t self:fifo_file rw_fifo_file_perms;
Chris PeBenito 17de1b
allow xdm_t self:shm create_shm_perms;
Chris PeBenito 17de1b
allow xdm_t self:sem create_sem_perms;
Chris PeBenito 17de1b
allow xdm_t self:unix_stream_socket { connectto create_stream_socket_perms };
Chris PeBenito a5e213
allow xdm_t self:netlink_route_socket r_netlink_socket_perms;
Chris PeBenito 17de1b
allow xdm_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito 17de1b
allow xdm_t self:tcp_socket create_stream_socket_perms;
Chris PeBenito 17de1b
allow xdm_t self:udp_socket create_socket_perms;
Chris PeBenito a5e213
allow xdm_t self:socket create_socket_perms;
Chris PeBenito a5e213
allow xdm_t self:appletalk_socket create_socket_perms;
Chris PeBenito a5e213
allow xdm_t self:key { search link write };
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow xdm_t xconsole_device_t:fifo_file { getattr setattr };
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# Allow gdm to run gdm-binary
Chris PeBenito 17de1b
can_exec(xdm_t, xdm_exec_t)
Chris PeBenito 17de1b
Chris PeBenito 6b19be
allow xdm_t xdm_lock_t:file manage_file_perms;
Chris PeBenito 6b19be
files_lock_filetrans(xdm_t,xdm_lock_t,file)
Chris PeBenito 6b19be
Chris PeBenito 17de1b
# wdm has its own config dir /etc/X11/wdm
Chris PeBenito 17de1b
# this is ugly, daemons should not create files under /etc!
Chris PeBenito c0868a
manage_files_pattern(xdm_t,xdm_rw_etc_t,xdm_rw_etc_t)
Chris PeBenito 17de1b
Chris PeBenito 6b19be
manage_dirs_pattern(xdm_t,xdm_tmp_t,xdm_tmp_t)
Chris PeBenito 6b19be
manage_files_pattern(xdm_t,xdm_tmp_t,xdm_tmp_t)
Chris PeBenito 6b19be
manage_sock_files_pattern(xdm_t,xdm_tmp_t,xdm_tmp_t)
Chris PeBenito 6b19be
files_tmp_filetrans(xdm_t, xdm_tmp_t, { file dir sock_file })
Chris PeBenito 6b19be
Chris PeBenito 6b19be
manage_dirs_pattern(xdm_t,xdm_tmpfs_t,xdm_tmpfs_t)
Chris PeBenito 6b19be
manage_files_pattern(xdm_t,xdm_tmpfs_t,xdm_tmpfs_t)
Chris PeBenito 6b19be
manage_lnk_files_pattern(xdm_t,xdm_tmpfs_t,xdm_tmpfs_t)
Chris PeBenito 6b19be
manage_fifo_files_pattern(xdm_t,xdm_tmpfs_t,xdm_tmpfs_t)
Chris PeBenito 6b19be
manage_sock_files_pattern(xdm_t,xdm_tmpfs_t,xdm_tmpfs_t)
Chris PeBenito 6b19be
fs_tmpfs_filetrans(xdm_t,xdm_tmpfs_t,{ dir file lnk_file sock_file fifo_file })
Chris PeBenito 6b19be
Chris PeBenito 6b19be
manage_dirs_pattern(xdm_t,xdm_var_lib_t,xdm_var_lib_t)	
Chris PeBenito 6b19be
manage_files_pattern(xdm_t,xdm_var_lib_t,xdm_var_lib_t)
Chris PeBenito 6b19be
files_var_lib_filetrans(xdm_t,xdm_var_lib_t,file)
Chris PeBenito 6b19be
Chris PeBenito 6b19be
manage_dirs_pattern(xdm_t,xdm_var_run_t,xdm_var_run_t)
Chris PeBenito 6b19be
manage_files_pattern(xdm_t,xdm_var_run_t,xdm_var_run_t)
Chris PeBenito 6b19be
manage_fifo_files_pattern(xdm_t,xdm_var_run_t,xdm_var_run_t)
Chris PeBenito 6b19be
files_pid_filetrans(xdm_t,xdm_var_run_t,{ dir file fifo_file })
Chris PeBenito 6b19be
Chris PeBenito 6b19be
allow xdm_t xdm_xserver_t:process signal;
Chris PeBenito 6b19be
allow xdm_t xdm_xserver_t:unix_stream_socket connectto;
Chris PeBenito 6b19be
Chris PeBenito 6b19be
allow xdm_t xdm_xserver_tmp_t:sock_file rw_file_perms;
Chris PeBenito 6b19be
allow xdm_t xdm_xserver_tmp_t:dir { setattr r_dir_perms };
Chris PeBenito 6b19be
Chris PeBenito 6b19be
# transition to the xdm xserver
Chris PeBenito 6b19be
domtrans_pattern(xdm_t, xserver_exec_t, xdm_xserver_t)
Chris PeBenito 6b19be
allow xdm_xserver_t xdm_t:process signal;
Chris PeBenito 6b19be
allow xdm_t xdm_xserver_t:process { noatsecure siginh rlimitinh signal sigkill };
Chris PeBenito 6b19be
Chris PeBenito 6b19be
allow xdm_t xdm_xserver_t:shm rw_shm_perms;
Chris PeBenito 6b19be
Chris PeBenito 6b19be
# connect to xdm xserver over stream socket
Chris PeBenito 6b19be
stream_connect_pattern(xdm_t,xdm_xserver_tmp_t,xdm_xserver_tmp_t,xdm_xserver_t)
Chris PeBenito 6b19be
Chris PeBenito 6b19be
# Remove /tmp/.X11-unix/X0.
Chris PeBenito 6b19be
delete_files_pattern(xdm_t,xdm_xserver_tmp_t,xdm_xserver_tmp_t)
Chris PeBenito 6b19be
delete_sock_files_pattern(xdm_t,xdm_xserver_tmp_t,xdm_xserver_tmp_t)
Chris PeBenito 6b19be
Chris PeBenito 6b19be
manage_dirs_pattern(xdm_t,xserver_log_t,xserver_log_t)
Chris PeBenito 6b19be
manage_files_pattern(xdm_t,xserver_log_t,xserver_log_t)
Chris PeBenito 6b19be
manage_fifo_files_pattern(xdm_t,xserver_log_t,xserver_log_t)
Chris PeBenito 6b19be
logging_log_filetrans(xdm_t,xserver_log_t,file)
Chris PeBenito 6b19be
Chris PeBenito 17de1b
kernel_read_system_state(xdm_t)
Chris PeBenito 17de1b
kernel_read_kernel_sysctls(xdm_t)
Chris PeBenito a5e213
kernel_read_net_sysctls(xdm_t)
Chris PeBenito a5e213
kernel_read_network_state(xdm_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
corecmd_exec_shell(xdm_t)
Chris PeBenito 17de1b
corecmd_exec_bin(xdm_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
corenet_non_ipsec_sendrecv(xdm_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_generic_if(xdm_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_generic_if(xdm_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_all_nodes(xdm_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_all_nodes(xdm_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_all_ports(xdm_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_all_ports(xdm_t)
Chris PeBenito 17de1b
corenet_tcp_bind_all_nodes(xdm_t)
Chris PeBenito 17de1b
corenet_udp_bind_all_nodes(xdm_t)
Chris PeBenito 17de1b
corenet_tcp_connect_all_ports(xdm_t)
Chris PeBenito 17de1b
corenet_sendrecv_all_client_packets(xdm_t)
Chris PeBenito 17de1b
# xdm tries to bind to biff_port_t
Chris PeBenito 17de1b
corenet_dontaudit_tcp_bind_all_ports(xdm_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
dev_read_rand(xdm_t)
Chris PeBenito 17de1b
dev_read_sysfs(xdm_t)
Chris PeBenito 17de1b
dev_getattr_framebuffer_dev(xdm_t)
Chris PeBenito 17de1b
dev_setattr_framebuffer_dev(xdm_t)
Chris PeBenito 17de1b
dev_getattr_mouse_dev(xdm_t)
Chris PeBenito 17de1b
dev_setattr_mouse_dev(xdm_t)
Chris PeBenito 17de1b
dev_rw_apm_bios(xdm_t)
Chris PeBenito 17de1b
dev_setattr_apm_bios_dev(xdm_t)
Chris PeBenito 17de1b
dev_rw_dri(xdm_t)
Chris PeBenito 17de1b
dev_rw_agp(xdm_t)
Chris PeBenito 17de1b
dev_getattr_xserver_misc_dev(xdm_t)
Chris PeBenito 17de1b
dev_setattr_xserver_misc_dev(xdm_t)
Chris PeBenito 17de1b
dev_getattr_misc_dev(xdm_t)
Chris PeBenito 17de1b
dev_setattr_misc_dev(xdm_t)
Chris PeBenito 17de1b
dev_dontaudit_rw_misc(xdm_t)
Chris PeBenito 17de1b
dev_getattr_video_dev(xdm_t)
Chris PeBenito 17de1b
dev_setattr_video_dev(xdm_t)
Chris PeBenito 17de1b
dev_getattr_scanner_dev(xdm_t)
Chris PeBenito 17de1b
dev_setattr_scanner_dev(xdm_t)
Chris PeBenito 17de1b
dev_getattr_sound_dev(xdm_t)
Chris PeBenito 17de1b
dev_setattr_sound_dev(xdm_t)
Chris PeBenito 17de1b
dev_getattr_power_mgmt_dev(xdm_t)
Chris PeBenito 17de1b
dev_setattr_power_mgmt_dev(xdm_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
domain_use_interactive_fds(xdm_t)
Chris PeBenito 17de1b
# Do not audit denied probes of /proc.
Chris PeBenito 17de1b
domain_dontaudit_read_all_domains_state(xdm_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
files_read_etc_files(xdm_t)
Chris PeBenito a5e213
files_read_var_files(xdm_t)
Chris PeBenito 17de1b
files_read_etc_runtime_files(xdm_t)
Chris PeBenito 17de1b
files_exec_etc_files(xdm_t)
Chris PeBenito 17de1b
files_list_mnt(xdm_t)
Chris PeBenito 17de1b
# Read /usr/share/terminfo/l/linux and /usr/share/icons/default/index.theme...
Chris PeBenito 17de1b
files_read_usr_files(xdm_t)
Chris PeBenito 17de1b
# Poweroff wants to create the /poweroff file when run from xdm
Chris PeBenito 17de1b
files_create_boot_flag(xdm_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
fs_getattr_all_fs(xdm_t)
Chris PeBenito 17de1b
fs_search_auto_mountpoints(xdm_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
storage_dontaudit_read_fixed_disk(xdm_t)
Chris PeBenito 17de1b
storage_dontaudit_write_fixed_disk(xdm_t)
Chris PeBenito 17de1b
storage_dontaudit_setattr_fixed_disk_dev(xdm_t)
Chris PeBenito 17de1b
storage_dontaudit_raw_read_removable_device(xdm_t)
Chris PeBenito 17de1b
storage_dontaudit_raw_write_removable_device(xdm_t)
Chris PeBenito 17de1b
storage_dontaudit_setattr_removable_dev(xdm_t)
Chris PeBenito 17de1b
storage_dontaudit_rw_scsi_generic(xdm_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
term_setattr_console(xdm_t)
Chris PeBenito 17de1b
term_use_unallocated_ttys(xdm_t)
Chris PeBenito 17de1b
term_setattr_unallocated_ttys(xdm_t)
Chris PeBenito 17de1b
Chris PeBenito 6b19be
auth_domtrans_pam_console(xdm_t)
Chris PeBenito 17de1b
auth_manage_pam_pid(xdm_t)
Chris PeBenito 17de1b
auth_manage_pam_console_data(xdm_t)
Chris PeBenito a5e213
auth_rw_faillog(xdm_t)
Chris PeBenito a5e213
auth_write_login_records(xdm_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# Run telinit->init to shutdown.
Chris PeBenito a5f5eb
init_telinit(xdm_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
libs_use_ld_so(xdm_t)
Chris PeBenito 17de1b
libs_use_shared_libs(xdm_t)
Chris PeBenito 17de1b
libs_exec_lib_files(xdm_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
logging_read_generic_logs(xdm_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
miscfiles_read_localization(xdm_t)
Chris PeBenito 17de1b
miscfiles_read_fonts(xdm_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
sysnet_read_config(xdm_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
userdom_dontaudit_use_unpriv_user_fds(xdm_t)
Chris PeBenito 17de1b
userdom_dontaudit_search_sysadm_home_dirs(xdm_t)
Chris PeBenito 17de1b
userdom_create_all_users_keys(xdm_t)
Chris PeBenito 17de1b
# for .dmrc
Chris PeBenito 17de1b
userdom_read_unpriv_users_home_content_files(xdm_t)
Chris PeBenito 17de1b
# Search /proc for any user domain processes.
Chris PeBenito 17de1b
userdom_read_all_users_state(xdm_t)
Chris PeBenito 17de1b
userdom_signal_all_users(xdm_t)
Chris PeBenito 17de1b
Chris PeBenito 6b19be
xserver_rw_session_template(xdm,xdm_t,xdm_tmpfs_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
ifdef(`targeted_policy',`
Chris PeBenito 17de1b
	unconfined_domain(xdm_t)
Chris PeBenito 17de1b
	unconfined_domtrans(xdm_t)
Chris PeBenito 17de1b
	userdom_generic_user_home_dir_filetrans_generic_user_home_content(xdm_t, {file dir })
Chris PeBenito 17de1b
Chris PeBenito eac818
	ifndef(`distro_redhat',`
Chris PeBenito eac818
		allow xdm_t self:process { execheap execmem };
Chris PeBenito eac818
	')
Chris PeBenito eac818
Chris PeBenito eac818
	ifdef(`distro_rhel4',`
Chris PeBenito eac818
		allow xdm_t self:process { execheap execmem };
Chris PeBenito eac818
	')
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
tunable_policy(`use_nfs_home_dirs',`
Chris PeBenito 17de1b
	fs_manage_nfs_dirs(xdm_t)
Chris PeBenito 17de1b
	fs_manage_nfs_files(xdm_t)
Chris PeBenito 17de1b
	fs_manage_nfs_symlinks(xdm_t)
Chris PeBenito 17de1b
	fs_exec_nfs_files(xdm_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
tunable_policy(`use_samba_home_dirs',`
Chris PeBenito 17de1b
	fs_manage_cifs_dirs(xdm_t)
Chris PeBenito 17de1b
	fs_manage_cifs_files(xdm_t)
Chris PeBenito 17de1b
	fs_manage_cifs_symlinks(xdm_t)
Chris PeBenito 17de1b
	fs_exec_cifs_files(xdm_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 6b19be
tunable_policy(`xdm_sysadm_login',`
Chris PeBenito 6b19be
	userdom_xsession_spec_domtrans_all_users(xdm_t)
Chris PeBenito 6b19be
	# FIXME:
Chris PeBenito 6b19be
#	xserver_rw_session_template(xdm,userdomain)
Chris PeBenito 6b19be
',`
Chris PeBenito 6b19be
	userdom_xsession_spec_domtrans_unpriv_users(xdm_t)
Chris PeBenito 6b19be
	# FIXME:
Chris PeBenito 6b19be
#	xserver_rw_session_template(xdm,unpriv_userdomain)
Chris PeBenito 6b19be
#	dontaudit xdm_xserver_t sysadm_t:shm { unix_read unix_write };
Chris PeBenito 6b19be
#	allow xdm_xserver_t xdm_tmpfs_t:file rw_file_perms;
Chris PeBenito 6b19be
')
Chris PeBenito 6b19be
Chris PeBenito 6b19be
optional_policy(`
Chris PeBenito 6b19be
	alsa_domtrans(xdm_t)
Chris PeBenito 6b19be
')
Chris PeBenito 6b19be
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito e66689
	consolekit_dbus_chat(xdm_t)
Chris PeBenito e66689
')
Chris PeBenito e66689
Chris PeBenito e66689
optional_policy(`
Chris PeBenito 465510
	consoletype_exec(xdm_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	# Talk to the console mouse server.
Chris PeBenito 17de1b
	gpm_stream_connect(xdm_t)
Chris PeBenito 17de1b
	gpm_setattr_gpmctl(xdm_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	hostname_exec(xdm_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	loadkeys_exec(xdm_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	locallogin_signull(xdm_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	# Do not audit attempts to check whether user root has email
Chris PeBenito 17de1b
	mta_dontaudit_getattr_spool_files(xdm_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	nscd_socket_use(xdm_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	seutil_sigchld_newrole(xdm_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	udev_read_db(xdm_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	userhelper_dontaudit_search_config(xdm_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	usermanage_read_crack_db(xdm_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	xfs_stream_connect(xdm_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# XDM Xserver local policy
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow xdm_xserver_t xdm_t:process { signal getpgid };
Chris PeBenito 17de1b
allow xdm_xserver_t xdm_t:shm rw_shm_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# NB we do NOT allow xdm_xserver_t xdm_var_lib_t:dir, only access to an open
Chris PeBenito 17de1b
# handle of a file inside the dir!!!
Chris PeBenito 17de1b
allow xdm_xserver_t xdm_var_lib_t:file { getattr read };
Chris PeBenito 17de1b
dontaudit xdm_xserver_t xdm_var_lib_t:dir search;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow xdm_xserver_t xdm_var_run_t:file { getattr read };
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# Label pid and temporary files with derived types.
Chris PeBenito c0868a
manage_files_pattern(xdm_xserver_t,xdm_tmp_t,xdm_tmp_t)
Chris PeBenito c0868a
manage_lnk_files_pattern(xdm_xserver_t,xdm_tmp_t,xdm_tmp_t)
Chris PeBenito c0868a
manage_sock_files_pattern(xdm_xserver_t,xdm_tmp_t,xdm_tmp_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# Run xkbcomp.
Chris PeBenito 17de1b
allow xdm_xserver_t xkb_var_lib_t:lnk_file read;
Chris PeBenito 17de1b
can_exec(xdm_xserver_t, xkb_var_lib_t)
Chris PeBenito 17de1b
files_search_var_lib(xdm_xserver_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# VNC v4 module in X server
Chris PeBenito 17de1b
corenet_tcp_bind_vnc_port(xdm_xserver_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
fs_search_auto_mountpoints(xdm_xserver_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
init_use_fds(xdm_xserver_t)
Chris PeBenito 17de1b
Chris PeBenito 6b19be
# FIXME: After per user fonts are properly working
Chris PeBenito 6b19be
# xdm_xserver_t may no longer have any reason
Chris PeBenito 6b19be
# to read ROLE_home_t - examine this in more detail
Chris PeBenito 6b19be
# (xauth?)
Chris PeBenito 6b19be
userdom_read_unpriv_users_home_content_files(xdm_xserver_t)
Chris PeBenito 6b19be
Chris PeBenito 6b19be
xserver_use_all_users_fonts(xdm_xserver_t)
Chris PeBenito 6b19be
Chris PeBenito 17de1b
tunable_policy(`use_nfs_home_dirs',`
Chris PeBenito 17de1b
	fs_manage_nfs_dirs(xdm_xserver_t)
Chris PeBenito 17de1b
	fs_manage_nfs_files(xdm_xserver_t)
Chris PeBenito 17de1b
	fs_manage_nfs_symlinks(xdm_xserver_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
tunable_policy(`use_samba_home_dirs',`
Chris PeBenito 17de1b
	fs_manage_cifs_dirs(xdm_xserver_t)
Chris PeBenito 17de1b
	fs_manage_cifs_files(xdm_xserver_t)
Chris PeBenito 17de1b
	fs_manage_cifs_symlinks(xdm_xserver_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
ifdef(`targeted_policy',`
Chris PeBenito 17de1b
	unconfined_domain_noaudit(xdm_xserver_t)
Chris PeBenito 17de1b
	unconfined_domtrans(xdm_xserver_t)
Chris PeBenito eac818
Chris PeBenito eac818
	ifndef(`distro_redhat',`
Chris PeBenito eac818
		allow xdm_xserver_t self:process { execheap execmem };
Chris PeBenito eac818
	')
Chris PeBenito eac818
Chris PeBenito eac818
	ifdef(`distro_rhel4',`
Chris PeBenito eac818
		allow xdm_xserver_t self:process { execheap execmem };
Chris PeBenito eac818
	')
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	resmgr_stream_connect(xdm_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	rhgb_rw_shm(xdm_xserver_t)
Chris PeBenito 17de1b
	rhgb_rw_tmpfs_files(xdm_xserver_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
ifdef(`TODO',`
Chris PeBenito 17de1b
# Need to further investigate these permissions and
Chris PeBenito 17de1b
# perhaps define derived types.
Chris PeBenito 17de1b
allow xdm_t var_lib_t:dir { write search add_name remove_name  create unlink };
Chris PeBenito 17de1b
allow xdm_t var_lib_t:file { create write unlink };
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# Do not audit attempts to write to index files under /usr
Chris PeBenito 17de1b
dontaudit xdm_t usr_t:file write;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
ifdef(`rhgb.te', `
Chris PeBenito 17de1b
allow xdm_xserver_t ramfs_t:dir rw_dir_perms;
Chris PeBenito c0868a
allow xdm_xserver_t ramfs_t:file manage_file_perms;
Chris PeBenito 17de1b
allow rhgb_t xdm_xserver_t:process signal;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito d9845a
tunable_policy(`allow_polyinstantiation',`
Chris PeBenito 17de1b
# xdm needs access for linking .X11-unix to poly /tmp
Chris PeBenito 17de1b
allow xdm_t polymember:dir { add_name remove_name write };
Chris PeBenito 17de1b
allow xdm_t polymember:lnk_file { create unlink };
Chris PeBenito 17de1b
# xdm needs access for copying .Xauthority into new home
Chris PeBenito 17de1b
allow xdm_t polymember:file { create getattr write };
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Wants to delete .xsession-errors file
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
allow xdm_t user_home_type:file unlink;
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Should fix exec of pam_timestamp_check is not closing xdm file descriptor
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
allow pam_t xdm_t:fifo_file { getattr ioctl write };
Chris PeBenito 17de1b
') dnl end TODO