Chris PeBenito 17de1b
Chris PeBenito 4b3b46
policy_module(xserver,1.1.12)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Declarations
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
attribute fonts_type;
Chris PeBenito 17de1b
attribute fonts_cache_type;
Chris PeBenito 17de1b
attribute fonts_config_type;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type ice_tmp_t;
Chris PeBenito 17de1b
files_tmp_file(ice_tmp_t)
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 17de1b
# real declaration moved to mls until
Chris PeBenito 17de1b
# range_transition works in loadable modules
Chris PeBenito 17de1b
gen_require(`
Chris PeBenito 17de1b
	type xdm_exec_t;
Chris PeBenito 17de1b
')
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 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 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 17de1b
allow xdm_t self:process { setexec setpgid setsched setrlimit signal_perms setkeycreate };
Chris PeBenito 17de1b
allow xdm_t self:fifo_file rw_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 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 465510
allow xdm_t self:key write;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# Supress permission check on .ICE-unix
Chris PeBenito 17de1b
dontaudit xdm_t ice_tmp_t:dir { getattr setattr };
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 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 17de1b
allow xdm_t xdm_rw_etc_t:dir rw_dir_perms;
Chris PeBenito 17de1b
allow xdm_t xdm_rw_etc_t:file create_file_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
kernel_read_system_state(xdm_t)
Chris PeBenito 17de1b
kernel_read_kernel_sysctls(xdm_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
corecmd_exec_shell(xdm_t)
Chris PeBenito 17de1b
corecmd_exec_bin(xdm_t)
Chris PeBenito 17de1b
corecmd_exec_sbin(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 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_dontaudit_use_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 17de1b
auth_manage_pam_pid(xdm_t)
Chris PeBenito 17de1b
auth_manage_pam_console_data(xdm_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
init_use_script_ptys(xdm_t)
Chris PeBenito 17de1b
# Run telinit->init to shutdown.
Chris PeBenito 17de1b
init_exec(xdm_t)
Chris PeBenito 17de1b
init_write_initctl(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 17de1b
ifdef(`strict_policy',`
Chris PeBenito 17de1b
	allow xdm_t xdm_lock_t:file create_file_perms;
Chris PeBenito 17de1b
	files_lock_filetrans(xdm_t,xdm_lock_t,file)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow xdm_t xdm_tmp_t:dir manage_dir_perms;
Chris PeBenito 17de1b
	allow xdm_t xdm_tmp_t:file manage_file_perms;
Chris PeBenito 17de1b
	allow xdm_t xdm_tmp_t:sock_file manage_file_perms;
Chris PeBenito 17de1b
	files_tmp_filetrans(xdm_t, xdm_tmp_t, { file dir sock_file })
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow xdm_t xdm_tmpfs_t:dir manage_dir_perms;
Chris PeBenito 17de1b
	allow xdm_t xdm_tmpfs_t:file manage_file_perms;
Chris PeBenito 17de1b
	allow xdm_t xdm_tmpfs_t:lnk_file create_lnk_perms;
Chris PeBenito 17de1b
	allow xdm_t xdm_tmpfs_t:sock_file manage_file_perms;
Chris PeBenito 17de1b
	allow xdm_t xdm_tmpfs_t:fifo_file manage_file_perms;
Chris PeBenito 17de1b
	fs_tmpfs_filetrans(xdm_t,xdm_tmpfs_t,{ dir file lnk_file sock_file fifo_file })
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow xdm_t xdm_var_lib_t:file create_file_perms;
Chris PeBenito 17de1b
	allow xdm_t xdm_var_lib_t:dir create_dir_perms;
Chris PeBenito 17de1b
	files_var_lib_filetrans(xdm_t,xdm_var_lib_t,file)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow xdm_t xdm_var_run_t:dir manage_dir_perms;
Chris PeBenito 17de1b
	allow xdm_t xdm_var_run_t:file manage_file_perms;
Chris PeBenito 17de1b
	allow xdm_t xdm_var_run_t:fifo_file manage_file_perms;
Chris PeBenito 17de1b
	files_pid_filetrans(xdm_t,xdm_var_run_t,{ dir file fifo_file })
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow xdm_t xdm_xserver_t:process signal;
Chris PeBenito 17de1b
	allow xdm_t xdm_xserver_t:unix_stream_socket connectto;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow xdm_t xdm_xserver_tmp_t:sock_file rw_file_perms;
Chris PeBenito 17de1b
	allow xdm_t xdm_xserver_tmp_t:dir { setattr r_dir_perms };
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# transition to the xdm xserver
Chris PeBenito 17de1b
	domain_auto_trans(xdm_t, xserver_exec_t, xdm_xserver_t)
Chris PeBenito 17de1b
	allow xdm_t xdm_xserver_t:fd use;
Chris PeBenito 17de1b
	allow xdm_xserver_t xdm_t:fd use;
Chris PeBenito 17de1b
	allow xdm_xserver_t xdm_t:fifo_file rw_file_perms;
Chris PeBenito 17de1b
	allow xdm_xserver_t xdm_t:process { signal sigchld };
Chris PeBenito 17de1b
	allow xdm_t xdm_xserver_t:process { noatsecure siginh rlimitinh signal sigkill };
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow xdm_t xdm_xserver_t:shm rw_shm_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# connect to xdm xserver over stream socket
Chris PeBenito 17de1b
	allow xdm_t xdm_xserver_tmp_t:dir r_dir_perms;
Chris PeBenito 17de1b
	allow xdm_t xdm_xserver_tmp_t:sock_file rw_file_perms;
Chris PeBenito 17de1b
	allow xdm_t xdm_xserver_t:unix_stream_socket connectto;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# Remove /tmp/.X11-unix/X0.
Chris PeBenito 17de1b
	allow xdm_t xdm_xserver_tmp_t:dir { remove_name write };
Chris PeBenito 17de1b
	allow xdm_t xdm_xserver_tmp_t:sock_file unlink;
Chris PeBenito 17de1b
	allow xdm_t xdm_xserver_tmp_t:file unlink;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow xdm_t xserver_log_t:dir { rw_dir_perms setattr };
Chris PeBenito 17de1b
	allow xdm_t xserver_log_t:file manage_file_perms;
Chris PeBenito 17de1b
	allow xdm_t xserver_log_t:fifo_file manage_file_perms;
Chris PeBenito 17de1b
	logging_log_filetrans(xdm_t,xserver_log_t,file)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	auth_domtrans_pam_console(xdm_t)	
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	xserver_rw_session_template(xdm,xdm_t,xdm_tmpfs_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	tunable_policy(`xdm_sysadm_login',`
Chris PeBenito 17de1b
		userdom_xsession_spec_domtrans_all_users(xdm_t)
Chris PeBenito 17de1b
		# FIXME:
Chris PeBenito 17de1b
#		xserver_rw_session_template(xdm,userdomain)
Chris PeBenito 17de1b
	',`
Chris PeBenito 17de1b
		userdom_xsession_spec_domtrans_unpriv_users(xdm_t)
Chris PeBenito 17de1b
		# FIXME:
Chris PeBenito 17de1b
#		xserver_rw_session_template(xdm,unpriv_userdomain)
Chris PeBenito 17de1b
#		dontaudit xdm_xserver_t sysadm_t:shm { unix_read unix_write };
Chris PeBenito 17de1b
#		allow xdm_xserver_t xdm_tmpfs_t:file rw_file_perms;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		alsa_domtrans(xdm_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
ifdef(`targeted_policy',`
Chris PeBenito 17de1b
	allow xdm_t self:process { execheap execmem };
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 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 17de1b
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 17de1b
allow xdm_xserver_t xdm_tmp_t:dir rw_dir_perms;
Chris PeBenito 17de1b
allow xdm_xserver_t xdm_tmp_t:file manage_file_perms;
Chris PeBenito 17de1b
allow xdm_xserver_t xdm_tmp_t:lnk_file create_lnk_perms;
Chris PeBenito 17de1b
allow xdm_xserver_t xdm_tmp_t:sock_file manage_file_perms;
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 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(`strict_policy',`
Chris PeBenito 17de1b
	# FIXME: After per user fonts are properly working
Chris PeBenito 17de1b
	# xdm_xserver_t may no longer have any reason
Chris PeBenito 17de1b
	# to read ROLE_home_t - examine this in more detail
Chris PeBenito 17de1b
	# (xauth?)
Chris PeBenito 17de1b
	userdom_read_unpriv_users_home_content_files(xdm_xserver_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	xserver_use_all_users_fonts(xdm_xserver_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
ifdef(`targeted_policy',`
Chris PeBenito 17de1b
	allow xdm_xserver_t self:process { execheap execmem };
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	unconfined_domain_noaudit(xdm_xserver_t)
Chris PeBenito 17de1b
	unconfined_domtrans(xdm_xserver_t)
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 17de1b
allow xdm_xserver_t ramfs_t:file create_file_perms;
Chris PeBenito 17de1b
allow rhgb_t xdm_xserver_t:process signal;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
ifdef(`enable_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