Chris PeBenito 17de1b
## <summary>X Windows Server</summary>
Chris PeBenito 17de1b
Chris PeBenito 17de1b
#######################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Template to create types and rules common to
Chris PeBenito 17de1b
##	all X server domains.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="prefix">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The prefix of the domain (e.g., user
Chris PeBenito 17de1b
##	is the prefix for user_t).
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
template(`xserver_common_domain_template',`
Chris PeBenito 563e58
	gen_require(`
Chris PeBenito 563e58
		type xkb_var_lib_t, xserver_exec_t, xserver_log_t;
Chris PeBenito 563e58
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	##############################
Chris PeBenito 17de1b
	#
Chris PeBenito 17de1b
	# Declarations
Chris PeBenito 17de1b
	#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	type $1_xserver_t;
Chris PeBenito 17de1b
	domain_type($1_xserver_t)
Chris PeBenito 17de1b
	domain_entry_file($1_xserver_t,xserver_exec_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	type $1_xserver_tmp_t;
Chris PeBenito 17de1b
	files_tmp_file($1_xserver_tmp_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	type $1_xserver_tmpfs_t;
Chris PeBenito 17de1b
	files_tmpfs_file($1_xserver_tmpfs_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	##############################
Chris PeBenito 17de1b
	#
Chris PeBenito 17de1b
	# $1_xserver_t local policy
Chris PeBenito 17de1b
	#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# setuid/setgid for the wrapper program to change UID
Chris PeBenito 17de1b
	# sys_rawio is for iopl access - should not be needed for frame-buffer
Chris PeBenito 17de1b
	# sys_admin, locking shared mem?  chowning IPC message queues or semaphores?
Chris PeBenito 17de1b
	# admin of APM bios?
Chris PeBenito 17de1b
	# sys_nice is so that the X server can set a negative nice value
Chris PeBenito 17de1b
	# execheap needed until the X module loader is fixed.
Chris PeBenito 17de1b
	# NVIDIA Needs execstack
Chris PeBenito 17de1b
Chris PeBenito 6b19be
	allow $1_xserver_t self:capability { dac_override fowner fsetid setgid setuid ipc_owner sys_rawio sys_admin sys_nice sys_tty_config mknod net_bind_service };
Chris PeBenito 17de1b
	dontaudit $1_xserver_t self:capability chown;
Chris PeBenito 17de1b
	allow $1_xserver_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem execstack execheap };
Chris PeBenito e5e55a
	allow $1_xserver_t self:memprotect mmap_zero;
Chris PeBenito 17de1b
	allow $1_xserver_t self:fd use;
Chris PeBenito c0868a
	allow $1_xserver_t self:fifo_file rw_fifo_file_perms;
Chris PeBenito c0868a
	allow $1_xserver_t self:sock_file read_sock_file_perms;
Chris PeBenito 17de1b
	allow $1_xserver_t self:shm create_shm_perms;
Chris PeBenito 17de1b
	allow $1_xserver_t self:sem create_sem_perms;
Chris PeBenito 17de1b
	allow $1_xserver_t self:msgq create_msgq_perms;
Chris PeBenito 17de1b
	allow $1_xserver_t self:msg { send receive };
Chris PeBenito 17de1b
	allow $1_xserver_t self:unix_dgram_socket { create_socket_perms sendto };
Chris PeBenito 17de1b
	allow $1_xserver_t self:unix_stream_socket { create_stream_socket_perms connectto };
Chris PeBenito 17de1b
	allow $1_xserver_t self:netlink_route_socket r_netlink_socket_perms;
Chris PeBenito 17de1b
	allow $1_xserver_t self:tcp_socket create_stream_socket_perms;
Chris PeBenito 17de1b
	allow $1_xserver_t self:udp_socket create_socket_perms;
Chris PeBenito 17de1b
Chris PeBenito c0868a
	manage_dirs_pattern($1_xserver_t,$1_xserver_tmp_t,$1_xserver_tmp_t)
Chris PeBenito c0868a
	manage_files_pattern($1_xserver_t,$1_xserver_tmp_t,$1_xserver_tmp_t)
Chris PeBenito c0868a
	manage_sock_files_pattern($1_xserver_t,$1_xserver_tmp_t,$1_xserver_tmp_t)
Chris PeBenito 17de1b
	files_tmp_filetrans($1_xserver_t, $1_xserver_tmp_t, { file dir sock_file })
Chris PeBenito 17de1b
Chris PeBenito c0868a
	filetrans_pattern($1_xserver_t,xdm_xserver_tmp_t,$1_xserver_tmp_t,sock_file)
Chris PeBenito 17de1b
Chris PeBenito c0868a
	manage_dirs_pattern($1_xserver_t,$1_xserver_tmpfs_t,$1_xserver_tmpfs_t)
Chris PeBenito c0868a
	manage_files_pattern($1_xserver_t,$1_xserver_tmpfs_t,$1_xserver_tmpfs_t)
Chris PeBenito c0868a
	manage_lnk_files_pattern($1_xserver_t,$1_xserver_tmpfs_t,$1_xserver_tmpfs_t)
Chris PeBenito c0868a
	manage_fifo_files_pattern($1_xserver_t,$1_xserver_tmpfs_t,$1_xserver_tmpfs_t)
Chris PeBenito c0868a
	manage_sock_files_pattern($1_xserver_t,$1_xserver_tmpfs_t,$1_xserver_tmpfs_t)
Chris PeBenito 17de1b
	fs_tmpfs_filetrans($1_xserver_t,$1_xserver_tmpfs_t,{ dir file lnk_file sock_file fifo_file })
Chris PeBenito 17de1b
Chris PeBenito c0868a
	manage_files_pattern($1_xserver_t,xkb_var_lib_t,xkb_var_lib_t)
Chris PeBenito c0868a
	manage_lnk_files_pattern($1_xserver_t,xkb_var_lib_t,xkb_var_lib_t)
Chris PeBenito 17de1b
	files_search_var_lib($1_xserver_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# Create files in /var/log with the xserver_log_t type.
Chris PeBenito c0868a
	manage_files_pattern($1_xserver_t,xserver_log_t,xserver_log_t)
Chris PeBenito 17de1b
	logging_log_filetrans($1_xserver_t,xserver_log_t,file)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	kernel_read_system_state($1_xserver_t)
Chris PeBenito 17de1b
	kernel_read_device_sysctls($1_xserver_t)
Chris PeBenito 17de1b
	kernel_read_modprobe_sysctls($1_xserver_t)
Chris PeBenito 17de1b
	# Xorg wants to check if kernel is tainted
Chris PeBenito 17de1b
	kernel_read_kernel_sysctls($1_xserver_t)
Chris PeBenito 17de1b
	kernel_write_proc_files($1_xserver_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# Run helper programs in $1_xserver_t.
Chris PeBenito 17de1b
	corecmd_exec_bin($1_xserver_t)
Chris PeBenito 17de1b
	corecmd_exec_shell($1_xserver_t)
Chris PeBenito 17de1b
Chris PeBenito 190066
	corenet_all_recvfrom_unlabeled($1_xserver_t)
Chris PeBenito 190066
	corenet_all_recvfrom_netlabel($1_xserver_t)
Chris PeBenito 17de1b
	corenet_tcp_sendrecv_generic_if($1_xserver_t)
Chris PeBenito 17de1b
	corenet_udp_sendrecv_generic_if($1_xserver_t)
Chris PeBenito 17de1b
	corenet_tcp_sendrecv_all_nodes($1_xserver_t)
Chris PeBenito 17de1b
	corenet_udp_sendrecv_all_nodes($1_xserver_t)
Chris PeBenito 17de1b
	corenet_tcp_sendrecv_all_ports($1_xserver_t)
Chris PeBenito 17de1b
	corenet_udp_sendrecv_all_ports($1_xserver_t)
Chris PeBenito 17de1b
	corenet_tcp_bind_all_nodes($1_xserver_t)
Chris PeBenito 17de1b
	corenet_tcp_bind_xserver_port($1_xserver_t)
Chris PeBenito 17de1b
	corenet_tcp_connect_all_ports($1_xserver_t)
Chris PeBenito 17de1b
	corenet_sendrecv_xserver_server_packets($1_xserver_t)
Chris PeBenito 17de1b
	corenet_sendrecv_all_client_packets($1_xserver_t)
Chris PeBenito 17de1b
Chris PeBenito a5e213
	dev_rw_sysfs($1_xserver_t)
Chris PeBenito 17de1b
	dev_rw_mouse($1_xserver_t)
Chris PeBenito 17de1b
	dev_rw_mtrr($1_xserver_t)
Chris PeBenito 17de1b
	dev_rw_apm_bios($1_xserver_t)
Chris PeBenito 17de1b
	dev_rw_agp($1_xserver_t)
Chris PeBenito 17de1b
	dev_rw_framebuffer($1_xserver_t)
Chris PeBenito 17de1b
	dev_manage_dri_dev($1_xserver_t)
Chris PeBenito 17de1b
	dev_create_generic_dirs($1_xserver_t)
Chris PeBenito 17de1b
	dev_setattr_generic_dirs($1_xserver_t)
Chris PeBenito 17de1b
	# raw memory access is needed if not using the frame buffer
Chris PeBenito 17de1b
	dev_read_raw_memory($1_xserver_t)
Chris PeBenito a5e213
	dev_wx_raw_memory($1_xserver_t)
Chris PeBenito 17de1b
	# for other device nodes such as the NVidia binary-only driver
Chris PeBenito 17de1b
	dev_rw_xserver_misc($1_xserver_t)
Chris PeBenito 17de1b
	# read events - the synaptics touchpad driver reads raw events
Chris PeBenito 17de1b
	dev_rw_input_dev($1_xserver_t)
Chris PeBenito 17de1b
	dev_rwx_zero($1_xserver_t)
Chris PeBenito 17de1b
Chris PeBenito e5e55a
	domain_mmap_low($1_xserver_t)
Chris PeBenito e5e55a
Chris PeBenito 17de1b
	files_read_etc_files($1_xserver_t)
Chris PeBenito 17de1b
	files_read_etc_runtime_files($1_xserver_t)
Chris PeBenito 17de1b
	files_read_usr_files($1_xserver_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# brought on by rhgb
Chris PeBenito 17de1b
	files_search_mnt($1_xserver_t)
Chris PeBenito 17de1b
	# for nscd
Chris PeBenito 17de1b
	files_dontaudit_search_pids($1_xserver_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	fs_getattr_xattr_fs($1_xserver_t)
Chris PeBenito 17de1b
	fs_search_nfs($1_xserver_t)
Chris PeBenito 17de1b
	fs_search_auto_mountpoints($1_xserver_t)
Chris PeBenito 6b19be
	fs_search_ramfs($1_xserver_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	init_getpgid($1_xserver_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	term_setattr_unallocated_ttys($1_xserver_t)
Chris PeBenito 17de1b
	term_use_unallocated_ttys($1_xserver_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	libs_use_ld_so($1_xserver_t)
Chris PeBenito 17de1b
	libs_use_shared_libs($1_xserver_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	logging_send_syslog_msg($1_xserver_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	miscfiles_read_localization($1_xserver_t)
Chris PeBenito 17de1b
	miscfiles_read_fonts($1_xserver_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	modutils_domtrans_insmod($1_xserver_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	seutil_dontaudit_search_config($1_xserver_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	sysnet_read_config($1_xserver_t)
Chris PeBenito 17de1b
Chris PeBenito eac818
	ifndef(`distro_redhat',`
Chris PeBenito eac818
		allow $1_xserver_t self:process { execmem execheap execstack };
Chris PeBenito eac818
	')
Chris PeBenito eac818
Chris PeBenito eac818
	ifdef(`distro_rhel4',`
Chris PeBenito eac818
		allow $1_xserver_t self:process { execmem execheap execstack };
Chris PeBenito eac818
	')
Chris PeBenito eac818
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito a5e213
		apm_stream_connect($1_xserver_t)
Chris PeBenito a5e213
	')
Chris PeBenito a5e213
Chris PeBenito a5e213
	optional_policy(`
Chris PeBenito 17de1b
		auth_search_pam_console_data($1_xserver_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		nis_use_ypbind($1_xserver_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		nscd_socket_use($1_xserver_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 6b19be
		rhgb_getpgid($1_xserver_t)
Chris PeBenito 6b19be
		rhgb_signal($1_xserver_t)
Chris PeBenito 6b19be
	')
Chris PeBenito 6b19be
Chris PeBenito 6b19be
	optional_policy(`
Chris PeBenito 17de1b
		xfs_stream_connect($1_xserver_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
#######################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito bbcd3c
##	The per role template for the xserver module.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <desc>
Chris PeBenito 17de1b
##	

Chris PeBenito 17de1b
##	Define a derived domain for the X server when executed
Chris PeBenito 17de1b
##	by a user domain (e.g. via startx).  See the xdm module
Chris PeBenito 17de1b
##	if using an X Display Manager.
Chris PeBenito 17de1b
##	

Chris PeBenito 17de1b
##	

Chris PeBenito 17de1b
##	This is invoked automatically for each user and
Chris PeBenito 17de1b
##	generally does not need to be invoked directly
Chris PeBenito 17de1b
##	by policy writers.
Chris PeBenito 17de1b
##	

Chris PeBenito 17de1b
## </desc>
Chris PeBenito 17de1b
## <param name="prefix">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The prefix of the user domain (e.g., user
Chris PeBenito 17de1b
##	is the prefix for user_t).
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
## <param name="user_domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The type of the user domain.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
## <param name="user_role">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The role associated with the user domain.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito bbcd3c
template(`xserver_per_role_template',`
Chris PeBenito 17de1b
Chris PeBenito 563e58
	gen_require(`
Chris PeBenito 563e58
		type iceauth_exec_t, xauth_exec_t;
Chris PeBenito 563e58
		attribute fonts_type, fonts_cache_type, fonts_config_type;
Chris PeBenito 563e58
	')
Chris PeBenito 563e58
Chris PeBenito 17de1b
	##############################
Chris PeBenito 17de1b
	#
Chris PeBenito 17de1b
	# Declarations
Chris PeBenito 17de1b
	#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	xserver_common_domain_template($1)
Chris PeBenito 17de1b
	role $3 types $1_xserver_t;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	type $1_fonts_t, fonts_type;
Chris PeBenito 17de1b
	userdom_user_home_content($1,$1_fonts_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	type $1_fonts_cache_t, fonts_cache_type;
Chris PeBenito 17de1b
	userdom_user_home_content($1,$1_fonts_cache_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	type $1_fonts_config_t, fonts_config_type;
Chris PeBenito 17de1b
	userdom_user_home_content($1,$1_fonts_cache_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	type $1_iceauth_t;
Chris PeBenito 17de1b
	domain_type($1_iceauth_t)
Chris PeBenito 17de1b
	domain_entry_file($1_iceauth_t,iceauth_exec_t)
Chris PeBenito 17de1b
	role $3 types $1_iceauth_t;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	type $1_iceauth_home_t alias $1_iceauth_rw_t;
Chris PeBenito 17de1b
	files_poly_member($1_iceauth_home_t)
Chris PeBenito 17de1b
	userdom_user_home_content($1,$1_iceauth_home_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	type $1_xauth_t;
Chris PeBenito 17de1b
	domain_type($1_xauth_t)
Chris PeBenito 17de1b
	domain_entry_file($1_xauth_t,xauth_exec_t)
Chris PeBenito 17de1b
	role $3 types $1_xauth_t;
Chris PeBenito 17de1b
Chris PeBenito 4967aa
	type $1_xauth_home_t alias $1_xauth_rw_t, xauth_home_type;
Chris PeBenito 17de1b
	files_poly_member($1_xauth_home_t)
Chris PeBenito 17de1b
	userdom_user_home_content($1,$1_xauth_home_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	type $1_xauth_tmp_t;
Chris PeBenito 17de1b
	files_tmp_file($1_xauth_tmp_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	##############################
Chris PeBenito 17de1b
	#
Chris PeBenito 17de1b
	# $1_xserver_t Local policy
Chris PeBenito 17de1b
	#
Chris PeBenito 17de1b
Chris PeBenito c0868a
	domtrans_pattern($1_xserver_t, xauth_exec_t, $1_xauth_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $1_xserver_t $1_xauth_home_t:file { getattr read };
Chris PeBenito 17de1b
Chris PeBenito c0868a
	domtrans_pattern($2, xserver_exec_t, $1_xserver_t)
Chris PeBenito c0868a
	allow $1_xserver_t $2:process signal;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $1_xserver_t $2:shm rw_shm_perms;
Chris PeBenito 17de1b
Chris PeBenito c0868a
	manage_dirs_pattern($2,$1_fonts_t,$1_fonts_t)
Chris PeBenito c0868a
	manage_files_pattern($2,$1_fonts_t,$1_fonts_t)
Chris PeBenito c0868a
	relabel_dirs_pattern($2,$1_fonts_t,$1_fonts_t)
Chris PeBenito c0868a
	relabel_files_pattern($2,$1_fonts_t,$1_fonts_t)
Chris PeBenito 17de1b
Chris PeBenito c0868a
	manage_dirs_pattern($2,$1_fonts_config_t,$1_fonts_config_t)
Chris PeBenito c0868a
	manage_files_pattern($2,$1_fonts_config_t,$1_fonts_config_t)
Chris PeBenito c0868a
	relabel_files_pattern($2,$1_fonts_config_t,$1_fonts_config_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# For startup relabel
Chris PeBenito 17de1b
	allow $2 $1_fonts_cache_t:{ dir file } { relabelto relabelfrom };
Chris PeBenito 17de1b
Chris PeBenito c0868a
	stream_connect_pattern($2,$1_xserver_tmp_t,$1_xserver_tmp_t,$1_xserver_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $2 $1_xserver_tmpfs_t:file rw_file_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# Communicate via System V shared memory.
Chris PeBenito 17de1b
	allow $1_xserver_t $2:shm rw_shm_perms;
Chris PeBenito 17de1b
	allow $2 $1_xserver_t:shm rw_shm_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	getty_use_fds($1_xserver_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	locallogin_use_fds($1_xserver_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	userdom_search_user_home_dirs($1,$1_xserver_t)
Chris PeBenito 17de1b
	userdom_use_user_ttys($1,$1_xserver_t)
Chris PeBenito 17de1b
	userdom_setattr_user_ttys($1,$1_xserver_t)
Chris PeBenito 17de1b
	userdom_rw_user_tmpfs_files($1,$1_xserver_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	xserver_use_user_fonts($1,$1_xserver_t)
Chris PeBenito 6b19be
	xserver_rw_xdm_tmp_files($1_xauth_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		userhelper_search_config($1_xserver_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	ifdef(`TODO',`
Chris PeBenito 17de1b
	ifdef(`xdm.te', `
Chris PeBenito 17de1b
		allow $1_t xdm_tmp_t:sock_file unlink;
Chris PeBenito 17de1b
		allow $1_xserver_t xdm_var_run_t:dir search;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
	') dnl end TODO
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	##############################
Chris PeBenito 17de1b
	#
Chris PeBenito 17de1b
	# $1_xauth_t Local policy
Chris PeBenito 17de1b
	#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $1_xauth_t self:process signal;
Chris PeBenito 17de1b
	allow $1_xauth_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $1_xauth_t $1_xauth_home_t:file manage_file_perms;
Chris PeBenito 17de1b
	userdom_user_home_dir_filetrans($1,$1_xauth_t,$1_xauth_home_t,file)
Chris PeBenito 17de1b
Chris PeBenito c0868a
	manage_dirs_pattern($1_xauth_t,$1_xauth_tmp_t,$1_xauth_tmp_t)
Chris PeBenito c0868a
	manage_files_pattern($1_xauth_t,$1_xauth_tmp_t,$1_xauth_tmp_t)
Chris PeBenito 17de1b
	files_tmp_filetrans($1_xauth_t, $1_xauth_tmp_t, { file dir })
Chris PeBenito 17de1b
Chris PeBenito c0868a
	domtrans_pattern($2, xauth_exec_t, $1_xauth_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $2 $1_xauth_t:process signal;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# allow ps to show xauth
Chris PeBenito c0868a
	ps_process_pattern($2,$1_xauth_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $2 $1_xauth_home_t:file manage_file_perms;
Chris PeBenito 17de1b
	allow $2 $1_xauth_home_t:file { relabelfrom relabelto };
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow xdm_t $1_xauth_home_t:file manage_file_perms;
Chris PeBenito 17de1b
	userdom_user_home_dir_filetrans($1,xdm_t,$1_xauth_home_t,file)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	domain_use_interactive_fds($1_xauth_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_read_etc_files($1_xauth_t)
Chris PeBenito 17de1b
	files_search_pids($1_xauth_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	fs_getattr_xattr_fs($1_xauth_t)
Chris PeBenito 17de1b
	fs_search_auto_mountpoints($1_xauth_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# cjp: why?
Chris PeBenito 17de1b
	term_use_ptmx($1_xauth_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	libs_use_ld_so($1_xauth_t)
Chris PeBenito 17de1b
	libs_use_shared_libs($1_xauth_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	sysnet_dns_name_resolve($1_xauth_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	userdom_use_user_terminals($1,$1_xauth_t)
Chris PeBenito 17de1b
	userdom_read_user_tmp_files($1,$1_xauth_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	tunable_policy(`use_nfs_home_dirs',`
Chris PeBenito 17de1b
		fs_manage_nfs_files($1_xauth_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	tunable_policy(`use_samba_home_dirs',`
Chris PeBenito 17de1b
		fs_manage_cifs_files($1_xauth_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		nis_use_ypbind($1_xauth_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		ssh_sigchld($1_xauth_t)
Chris PeBenito 17de1b
		ssh_read_pipes($1_xauth_t)
Chris PeBenito 17de1b
		ssh_dontaudit_rw_tcp_sockets($1_xauth_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	##############################
Chris PeBenito 17de1b
	#
Chris PeBenito 17de1b
	# $1_iceauth_t Local policy
Chris PeBenito 17de1b
	#
Chris PeBenito 17de1b
Chris PeBenito c0868a
	domtrans_pattern($2, iceauth_exec_t, $1_iceauth_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $1_iceauth_t $1_iceauth_home_t:file manage_file_perms;
Chris PeBenito 17de1b
	userdom_user_home_dir_filetrans($1,$1_iceauth_t,$1_iceauth_home_t,file)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# allow ps to show iceauth
Chris PeBenito c0868a
	ps_process_pattern($2,$1_iceauth_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $2 $1_iceauth_home_t:file manage_file_perms;
Chris PeBenito 17de1b
	allow $2 $1_iceauth_home_t:file { relabelfrom relabelto };
Chris PeBenito 17de1b
Chris PeBenito ef659a
	allow xdm_t $1_iceauth_home_t:file read_file_perms;
Chris PeBenito 6b19be
Chris PeBenito 17de1b
	fs_search_auto_mountpoints($1_iceauth_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	libs_use_ld_so($1_iceauth_t)
Chris PeBenito 17de1b
	libs_use_shared_libs($1_iceauth_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	userdom_use_user_terminals($1,$1_iceauth_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	tunable_policy(`use_nfs_home_dirs',`
Chris PeBenito 17de1b
		fs_manage_nfs_files($1_iceauth_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	tunable_policy(`use_samba_home_dirs',`
Chris PeBenito 17de1b
		fs_manage_cifs_files($1_iceauth_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
#######################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Template for creating sessions on a
Chris PeBenito 17de1b
##	prefix X server, with read-only
Chris PeBenito 17de1b
##	access to the X server shared
Chris PeBenito 17de1b
##	memory segments.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="prefix">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The prefix of the domain (e.g., user
Chris PeBenito 17de1b
##	is the prefix for user_t).
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
## <param name="tmpfs_type">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The type of the domain SYSV tmpfs files.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
template(`xserver_ro_session_template',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type $1_xserver_t, $1_xserver_tmp_t, $1_xserver_tmpfs_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# Xserver read/write client shm
Chris PeBenito 17de1b
	allow $1_xserver_t $2:fd use;
Chris PeBenito 17de1b
	allow $1_xserver_t $2:shm rw_shm_perms;
Chris PeBenito 17de1b
	allow $1_xserver_t $3:file rw_file_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# Connect to xserver
Chris PeBenito 17de1b
	allow $2 $1_xserver_t:unix_stream_socket connectto;
Chris PeBenito 17de1b
	allow $2 $1_xserver_t:process signal;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# Read /tmp/.X0-lock
Chris PeBenito 17de1b
	allow $2 $1_xserver_tmp_t:file { getattr read };
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# Client read xserver shm
Chris PeBenito 17de1b
	allow $2 $1_xserver_t:fd use;
Chris PeBenito 17de1b
	allow $2 $1_xserver_t:shm r_shm_perms;
Chris PeBenito c0868a
	allow $2 $1_xserver_tmpfs_t:file read_file_perms;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
#######################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Template for creating sessions on a
Chris PeBenito 17de1b
##	prefix X server, with read and write
Chris PeBenito 17de1b
##	access to the X server shared
Chris PeBenito 17de1b
##	memory segments.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="prefix">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The prefix of the domain (e.g., user
Chris PeBenito 17de1b
##	is the prefix for user_t).
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
## <param name="tmpfs_type">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The type of the domain SYSV tmpfs files.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
template(`xserver_rw_session_template',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type $1_xserver_t, $1_xserver_tmpfs_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	xserver_ro_session_template($1,$2,$3)
Chris PeBenito 17de1b
	allow $2 $1_xserver_t:shm rw_shm_perms;
Chris PeBenito 17de1b
	allow $2 $1_xserver_tmpfs_t:file rw_file_perms;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
#######################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Template for creating full client sessions
Chris PeBenito 17de1b
##	on a user X server.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="prefix">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The prefix of the domain (e.g., user
Chris PeBenito 17de1b
##	is the prefix for user_t).
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
## <param name="tmpfs_type">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The type of the domain SYSV tmpfs files.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
template(`xserver_user_client_template',`
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type xdm_t, xdm_tmp_t;
Chris PeBenito 6b19be
		type $1_xauth_home_t, $1_iceauth_home_t, $1_xserver_t, $1_xserver_tmpfs_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $2 self:shm create_shm_perms;
Chris PeBenito 17de1b
	allow $2 self:unix_dgram_socket create_socket_perms;
Chris PeBenito 17de1b
	allow $2 self:unix_stream_socket { connectto create_stream_socket_perms };
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# Read .Xauthority file
Chris PeBenito 17de1b
	allow $2 $1_xauth_home_t:file { getattr read };
Chris PeBenito 6b19be
	allow $2 $1_iceauth_home_t:file { getattr read };
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# for when /tmp/.X11-unix is created by the system
Chris PeBenito 17de1b
	allow $2 xdm_t:fd use;
Chris PeBenito 17de1b
	allow $2 xdm_t:fifo_file { getattr read write ioctl };
Chris PeBenito 17de1b
	allow $2 xdm_tmp_t:dir search;
Chris PeBenito 17de1b
	allow $2 xdm_tmp_t:sock_file { read write };
Chris PeBenito 17de1b
	dontaudit $2 xdm_t:tcp_socket { read write };
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# Allow connections to X server.
Chris PeBenito 17de1b
	files_search_tmp($2)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	miscfiles_read_fonts($2)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	userdom_search_user_home_dirs($1,$2)
Chris PeBenito 17de1b
	# for .xsession-errors
Chris PeBenito 17de1b
	userdom_dontaudit_write_user_home_content_files($1,$2)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	xserver_ro_session_template(xdm,$2,$3)
Chris PeBenito 17de1b
	xserver_rw_session_template($1,$2,$3)
Chris PeBenito 17de1b
	xserver_use_user_fonts($1,$2)
Chris PeBenito 17de1b
Chris PeBenito 6b19be
	xserver_read_xdm_tmp_files($2)
Chris PeBenito 6b19be
Chris PeBenito 17de1b
	# Client write xserver shm
Chris PeBenito 17de1b
	tunable_policy(`allow_write_xshm',`
Chris PeBenito 17de1b
		allow $2 $1_xserver_t:shm rw_shm_perms;
Chris PeBenito 17de1b
		allow $2 $1_xserver_tmpfs_t:file rw_file_perms;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Read user fonts, user font configuration,
Chris PeBenito 17de1b
##	and manage the user font cache.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <desc>
Chris PeBenito 17de1b
##	

Chris PeBenito 17de1b
##	Read user fonts, user font configuration,
Chris PeBenito 17de1b
##	and manage the user font cache.
Chris PeBenito 17de1b
##	

Chris PeBenito 17de1b
##	

Chris PeBenito 17de1b
##	This is a templated interface, and should only
Chris PeBenito 17de1b
##	be called from a per-userdomain template.
Chris PeBenito 17de1b
##	

Chris PeBenito 17de1b
## </desc>
Chris PeBenito 17de1b
## <param name="userdomain_prefix">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The prefix of the user domain (e.g., user
Chris PeBenito 17de1b
##	is the prefix for user_t).
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
template(`xserver_use_user_fonts',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type $1_fonts_t, $1_fonts_cache_t, $1_fonts_config_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# Read per user fonts
Chris PeBenito 17de1b
	allow $2 $1_fonts_t:dir list_dir_perms;
Chris PeBenito 17de1b
	allow $2 $1_fonts_t:file read_file_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# Manipulate the global font cache
Chris PeBenito c0868a
	manage_dirs_pattern($2,$1_fonts_cache_t,$1_fonts_cache_t)
Chris PeBenito c0868a
	manage_files_pattern($2,$1_fonts_cache_t,$1_fonts_cache_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# Read per user font config
Chris PeBenito 17de1b
	allow $2 $1_fonts_config_t:dir list_dir_perms;
Chris PeBenito 17de1b
	allow $2 $1_fonts_config_t:file read_file_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	userdom_search_user_home_dirs($1,$2)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Transition to a user Xauthority domain.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <desc>
Chris PeBenito 17de1b
##	

Chris PeBenito 17de1b
##	Transition to a user Xauthority domain.
Chris PeBenito 17de1b
##	

Chris PeBenito 17de1b
##	

Chris PeBenito 17de1b
##	This is a templated interface, and should only
Chris PeBenito 17de1b
##	be called from a per-userdomain template.
Chris PeBenito 17de1b
##	

Chris PeBenito 17de1b
## </desc>
Chris PeBenito 17de1b
## <param name="userdomain_prefix">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The prefix of the user domain (e.g., user
Chris PeBenito 17de1b
##	is the prefix for user_t).
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
template(`xserver_domtrans_user_xauth',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type $1_xauth_t, xauth_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito c0868a
	domtrans_pattern($2, xauth_exec_t, $1_xauth_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 6b19be
##	Transition to a user Xauthority domain.
Chris PeBenito 6b19be
## </summary>
Chris PeBenito 6b19be
## <desc>
Chris PeBenito 6b19be
##	

Chris PeBenito 6b19be
##	Transition to a user Xauthority domain.
Chris PeBenito 6b19be
##	

Chris PeBenito 6b19be
##	

Chris PeBenito 6b19be
##	This is a templated interface, and should only
Chris PeBenito 6b19be
##	be called from a per-userdomain template.
Chris PeBenito 6b19be
##	

Chris PeBenito 6b19be
## </desc>
Chris PeBenito 6b19be
## <param name="userdomain_prefix">
Chris PeBenito 6b19be
##	<summary>
Chris PeBenito 6b19be
##	The prefix of the user domain (e.g., user
Chris PeBenito 6b19be
##	is the prefix for user_t).
Chris PeBenito 6b19be
##	</summary>
Chris PeBenito 6b19be
## </param>
Chris PeBenito 6b19be
## <param name="domain">
Chris PeBenito 6b19be
##	<summary>
Chris PeBenito 6b19be
##	Domain allowed access.
Chris PeBenito 6b19be
##	</summary>
Chris PeBenito 6b19be
## </param>
Chris PeBenito 6b19be
#
Chris PeBenito 6b19be
template(`xserver_user_home_dir_filetrans_user_xauth',`
Chris PeBenito 6b19be
	gen_require(`
Chris PeBenito 6b19be
		type $1_xauth_home_t;
Chris PeBenito 6b19be
	')
Chris PeBenito 6b19be
Chris PeBenito 6b19be
	userdom_user_home_dir_filetrans($1, $2, $1_xauth_home_t, file)
Chris PeBenito 6b19be
')
Chris PeBenito 6b19be
Chris PeBenito 6b19be
########################################
Chris PeBenito 6b19be
## <summary>
Chris PeBenito 17de1b
##	Read all users fonts, user font configurations,
Chris PeBenito 17de1b
##	and manage all users font caches.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`xserver_use_all_users_fonts',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		attribute fonts_type, fonts_cache_type, fonts_config_type;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# Read per user fonts
Chris PeBenito 17de1b
	allow $1 fonts_type:dir list_dir_perms;
Chris PeBenito 17de1b
	allow $1 fonts_type:file read_file_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# Manipulate the global font cache
Chris PeBenito c0868a
	manage_dirs_pattern($1,fonts_cache_type,fonts_cache_type)
Chris PeBenito c0868a
	manage_files_pattern($1,fonts_cache_type,fonts_cache_type)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# Read per user font config
Chris PeBenito 17de1b
	allow $1 fonts_config_type:dir list_dir_perms;
Chris PeBenito 17de1b
	allow $1 fonts_config_type:file read_file_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	userdom_search_all_users_home_dirs($1)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 4967aa
##	Read all users .Xauthority.
Chris PeBenito 4967aa
## </summary>
Chris PeBenito 4967aa
## <param name="domain">
Chris PeBenito 4967aa
##	<summary>
Chris PeBenito 4967aa
##	Domain allowed access.
Chris PeBenito 4967aa
##	</summary>
Chris PeBenito 4967aa
## </param>
Chris PeBenito 4967aa
#
Chris PeBenito 4967aa
interface(`xserver_read_all_users_xauth',`
Chris PeBenito 4967aa
	gen_require(`
Chris PeBenito 4967aa
		attribute xauth_home_type;
Chris PeBenito 4967aa
	')
Chris PeBenito 4967aa
Chris PeBenito 350b6a
	allow $1 xauth_home_type:file read_file_perms;
Chris PeBenito 350b6a
	userdom_search_all_users_home_dirs($1)
Chris PeBenito 4967aa
')
Chris PeBenito 4967aa
Chris PeBenito 4967aa
########################################
Chris PeBenito 4967aa
## <summary>
Chris PeBenito 17de1b
##	Set the attributes of the X windows console named pipes.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`xserver_setattr_console_pipes',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type xconsole_device_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $1 xconsole_device_t:fifo_file setattr;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Read and write the X windows console named pipe.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`xserver_rw_console',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type xconsole_device_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $1 xconsole_device_t:fifo_file { getattr read write };
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Use file descriptors for xdm.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`xserver_use_xdm_fds',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type xdm_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $1 xdm_t:fd use; 
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito d6d16b
##	Do not audit attempts to inherit
Chris PeBenito d6d16b
##	XDM file descriptors.
Chris PeBenito d6d16b
## </summary>
Chris PeBenito d6d16b
## <param name="domain">
Chris PeBenito d6d16b
##	<summary>
Chris PeBenito d6d16b
##	Domain to not audit.
Chris PeBenito d6d16b
##	</summary>
Chris PeBenito d6d16b
## </param>
Chris PeBenito d6d16b
#
Chris PeBenito d6d16b
interface(`xserver_dontaudit_use_xdm_fds',`
Chris PeBenito d6d16b
	gen_require(`
Chris PeBenito d6d16b
		type xdm_t;
Chris PeBenito d6d16b
	')
Chris PeBenito d6d16b
Chris PeBenito d6d16b
	dontaudit $1 xdm_t:fd use; 
Chris PeBenito d6d16b
')
Chris PeBenito d6d16b
Chris PeBenito d6d16b
########################################
Chris PeBenito d6d16b
## <summary>
Chris PeBenito 17de1b
##	Read and write XDM unnamed pipes.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito d6d16b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`xserver_rw_xdm_pipes',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type xdm_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $1 xdm_t:fifo_file { getattr read write }; 
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito d6d16b
##	Do not audit attempts to read and write
Chris PeBenito d6d16b
##	XDM unnamed pipes.
Chris PeBenito d6d16b
## </summary>
Chris PeBenito d6d16b
## <param name="domain">
Chris PeBenito d6d16b
##	<summary>
Chris PeBenito d6d16b
##	Domain to not audit.
Chris PeBenito d6d16b
##	</summary>
Chris PeBenito d6d16b
## </param>
Chris PeBenito d6d16b
#
Chris PeBenito d6d16b
interface(`xserver_dontaudit_rw_xdm_pipes',`
Chris PeBenito d6d16b
Chris PeBenito d6d16b
	gen_require(`
Chris PeBenito d6d16b
		type xdm_t;
Chris PeBenito d6d16b
	')
Chris PeBenito d6d16b
Chris PeBenito e66689
	dontaudit $1 xdm_t:fifo_file rw_fifo_file_perms; 
Chris PeBenito d6d16b
')
Chris PeBenito d6d16b
Chris PeBenito d6d16b
########################################
Chris PeBenito d6d16b
## <summary>
Chris PeBenito 17de1b
##	Connect to XDM over a unix domain
Chris PeBenito 17de1b
##	stream socket.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`xserver_stream_connect_xdm',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito eac818
		type xdm_t, xdm_tmp_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito eac818
	files_search_tmp($1)
Chris PeBenito c0868a
	stream_connect_pattern($1,xdm_tmp_t,xdm_tmp_t,xdm_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Read xdm-writable configuration files.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`xserver_read_xdm_rw_config',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type xdm_rw_etc_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_etc($1)
Chris PeBenito c0868a
	allow $1 xdm_rw_etc_t:file { getattr read };
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Set the attributes of XDM temporary directories.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`xserver_setattr_xdm_tmp_dirs',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type xdm_tmp_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $1 xdm_tmp_t:dir setattr;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Create a named socket in a XDM
Chris PeBenito 17de1b
##	temporary directory.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`xserver_create_xdm_tmp_sockets',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type xdm_tmp_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_tmp($1)
Chris PeBenito c0868a
	allow $1 xdm_tmp_t:dir list_dir_perms;
Chris PeBenito c0868a
	create_sock_files_pattern($1,xdm_tmp_t,xdm_tmp_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Read XDM pid files.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`xserver_read_xdm_pid',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type xdm_var_run_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_pids($1)
Chris PeBenito c0868a
	allow $1 xdm_var_run_t:file read_file_perms;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##      Read XDM var lib files.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##      <summary>
Chris PeBenito 17de1b
##      Domain allowed access.
Chris PeBenito 17de1b
##      </summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`xserver_read_xdm_lib_files',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type xdm_var_lib_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $1 xdm_var_lib_t:file { getattr read };
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Execute the X server in the XDM X server domain.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`xserver_domtrans_xdm_xserver',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type xdm_xserver_t, xserver_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 6b19be
 	allow $1 xdm_xserver_t:process siginh;
Chris PeBenito c0868a
	domtrans_pattern($1,xserver_exec_t,xdm_xserver_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Make an X session script an entrypoint for the specified domain.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The domain for which the shell is an entrypoint.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`xserver_xsession_entry_type',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type xsession_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	domain_entry_file($1,xsession_exec_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Execute an X session in the target domain.  This
Chris PeBenito 17de1b
##	is an explicit transition, requiring the
Chris PeBenito 17de1b
##	caller to use setexeccon().
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <desc>
Chris PeBenito 17de1b
##	

Chris PeBenito 17de1b
##	Execute an Xsession in the target domain.  This
Chris PeBenito 17de1b
##	is an explicit transition, requiring the
Chris PeBenito 17de1b
##	caller to use setexeccon().
Chris PeBenito 17de1b
##	

Chris PeBenito 17de1b
##	

Chris PeBenito 17de1b
##	No interprocess communication (signals, pipes,
Chris PeBenito 17de1b
##	etc.) is provided by this interface since
Chris PeBenito 17de1b
##	the domains are not owned by this module.
Chris PeBenito 17de1b
##	

Chris PeBenito 17de1b
## </desc>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
## <param name="target_domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The type of the shell process.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`xserver_xsession_spec_domtrans',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type xsession_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	domain_trans($1,xsession_exec_t,$2)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Get the attributes of X server logs.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`xserver_getattr_log',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type xserver_log_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	logging_search_logs($1)
Chris PeBenito 17de1b
	allow $1 xserver_log_t:file getattr;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Do not audit attempts to write the X server
Chris PeBenito 17de1b
##	log files.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain to not audit
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`xserver_dontaudit_write_log',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type xserver_log_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	dontaudit $1 xserver_log_t:file { append write };
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Do not audit attempts to write the X server
Chris PeBenito 17de1b
##	log files.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain to not audit
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`xserver_delete_log',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type xserver_log_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	logging_search_logs($1)
Chris PeBenito c0868a
	allow $1 xserver_log_t:dir list_dir_perms;
Chris PeBenito c0868a
	delete_files_pattern($1,xserver_log_t,xserver_log_t)
Chris PeBenito 6b19be
	delete_fifo_files_pattern($1,xserver_log_t,xserver_log_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Read X keyboard extension libraries.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain to not audit
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`xserver_read_xkb_libs',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type xkb_var_lib_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_var_lib($1)
Chris PeBenito 17de1b
	allow $1 xkb_var_lib_t:dir list_dir_perms;
Chris PeBenito c0868a
	read_files_pattern($1,xkb_var_lib_t,xkb_var_lib_t)
Chris PeBenito c0868a
	read_lnk_files_pattern($1,xkb_var_lib_t,xkb_var_lib_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Read xdm temporary files.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain to not audit
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`xserver_read_xdm_xserver_tmp_files',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type xdm_xserver_tmp_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $1 xdm_xserver_tmp_t:file { getattr read };
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito eac818
##	Read xdm temporary files.
Chris PeBenito eac818
## </summary>
Chris PeBenito eac818
## <param name="domain">
Chris PeBenito eac818
##	<summary>
Chris PeBenito eac818
##	Domain to not audit
Chris PeBenito eac818
##	</summary>
Chris PeBenito eac818
## </param>
Chris PeBenito eac818
#
Chris PeBenito eac818
interface(`xserver_read_xdm_tmp_files',`
Chris PeBenito eac818
	gen_require(`
Chris PeBenito eac818
		type xdm_tmp_t;
Chris PeBenito eac818
	')
Chris PeBenito eac818
Chris PeBenito 6b19be
 	files_search_tmp($1)
Chris PeBenito c0868a
	read_files_pattern($1,xdm_tmp_t,xdm_tmp_t)
Chris PeBenito eac818
')
Chris PeBenito eac818
Chris PeBenito eac818
########################################
Chris PeBenito eac818
## <summary>
Chris PeBenito 6b19be
##	Do not audit attempts to read xdm temporary files.
Chris PeBenito 6b19be
## </summary>
Chris PeBenito 6b19be
## <param name="domain">
Chris PeBenito 6b19be
##	<summary>
Chris PeBenito 6b19be
##	Domain to not audit
Chris PeBenito 6b19be
##	</summary>
Chris PeBenito 6b19be
## </param>
Chris PeBenito 6b19be
#
Chris PeBenito 6b19be
interface(`xserver_dontaudit_read_xdm_tmp_files',`
Chris PeBenito 6b19be
	gen_require(`
Chris PeBenito 6b19be
		type xdm_tmp_t;
Chris PeBenito 6b19be
	')
Chris PeBenito 6b19be
Chris PeBenito 6b19be
	dontaudit $1 xdm_tmp_t:dir search_dir_perms;
Chris PeBenito ef659a
	dontaudit $1 xdm_tmp_t:file read_file_perms;
Chris PeBenito 6b19be
')
Chris PeBenito 6b19be
Chris PeBenito 6b19be
########################################
Chris PeBenito 6b19be
## <summary>
Chris PeBenito 6b19be
##	Read write xdm temporary files.
Chris PeBenito 6b19be
## </summary>
Chris PeBenito 6b19be
## <param name="domain">
Chris PeBenito 6b19be
##	<summary>
Chris PeBenito 6b19be
##	Domain to not audit
Chris PeBenito 6b19be
##	</summary>
Chris PeBenito 6b19be
## </param>
Chris PeBenito 6b19be
#
Chris PeBenito 6b19be
interface(`xserver_rw_xdm_tmp_files',`
Chris PeBenito 6b19be
	gen_require(`
Chris PeBenito 6b19be
		type xdm_tmp_t;
Chris PeBenito 6b19be
	')
Chris PeBenito 6b19be
Chris PeBenito 6b19be
	allow $1 xdm_tmp_t:dir search_dir_perms;
Chris PeBenito 6b19be
	allow $1 xdm_tmp_t:file rw_file_perms;
Chris PeBenito 6b19be
')
Chris PeBenito 6b19be
Chris PeBenito 6b19be
########################################
Chris PeBenito 6b19be
## <summary>
Chris PeBenito 6b19be
##	Create, read, write, and delete xdm temporary files.
Chris PeBenito 6b19be
## </summary>
Chris PeBenito 6b19be
## <param name="domain">
Chris PeBenito 6b19be
##	<summary>
Chris PeBenito 6b19be
##	Domain to not audit
Chris PeBenito 6b19be
##	</summary>
Chris PeBenito 6b19be
## </param>
Chris PeBenito 6b19be
#
Chris PeBenito 6b19be
interface(`xserver_manage_xdm_tmp_files',`
Chris PeBenito 6b19be
	gen_require(`
Chris PeBenito 6b19be
		type xdm_tmp_t;
Chris PeBenito 6b19be
	')
Chris PeBenito 6b19be
Chris PeBenito 6b19be
	manage_files_pattern($1,xdm_tmp_t,xdm_tmp_t)
Chris PeBenito 6b19be
')
Chris PeBenito 6b19be
Chris PeBenito 6b19be
########################################
Chris PeBenito 6b19be
## <summary>
Chris PeBenito 6b19be
##	dontaudit getattr xdm temporary named sockets.
Chris PeBenito 6b19be
## </summary>
Chris PeBenito 6b19be
## <param name="domain">
Chris PeBenito 6b19be
##	<summary>
Chris PeBenito 6b19be
##	Domain to not audit
Chris PeBenito 6b19be
##	</summary>
Chris PeBenito 6b19be
## </param>
Chris PeBenito 6b19be
#
Chris PeBenito 6b19be
interface(`xserver_dontaudit_getattr_xdm_tmp_sockets',`
Chris PeBenito 6b19be
	gen_require(`
Chris PeBenito 6b19be
		type xdm_tmp_t;
Chris PeBenito 6b19be
	')
Chris PeBenito 6b19be
Chris PeBenito 6b19be
	dontaudit $1 xdm_tmp_t:sock_file getattr;
Chris PeBenito 6b19be
')
Chris PeBenito 6b19be
Chris PeBenito 6b19be
########################################
Chris PeBenito 6b19be
## <summary>
Chris PeBenito 75beb9
##	Signal XDM X servers
Chris PeBenito 75beb9
## </summary>
Chris PeBenito 75beb9
## <param name="domain">
Chris PeBenito 75beb9
##	<summary>
Chris PeBenito 75beb9
##	Domain to not audit
Chris PeBenito 75beb9
##	</summary>
Chris PeBenito 75beb9
## </param>
Chris PeBenito 75beb9
#
Chris PeBenito 75beb9
interface(`xserver_signal_xdm_xserver',`
Chris PeBenito 75beb9
	gen_require(`
Chris PeBenito 75beb9
		type xdm_xserver_t;
Chris PeBenito 75beb9
	')
Chris PeBenito 75beb9
Chris PeBenito 75beb9
	allow $1 xdm_xserver_t:process signal;
Chris PeBenito 75beb9
')
Chris PeBenito 75beb9
Chris PeBenito 75beb9
########################################
Chris PeBenito 75beb9
## <summary>
Chris PeBenito 17de1b
##	Kill XDM X servers
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain to not audit
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`xserver_kill_xdm_xserver',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type xdm_xserver_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $1 xdm_xserver_t:process sigkill;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Do not audit attempts to read and write to
Chris PeBenito 17de1b
##	a XDM X server socket.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain to not audit
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`xserver_dontaudit_rw_xdm_xserver_tcp_sockets',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type xdm_xserver_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	dontaudit $1 xdm_xserver_t:tcp_socket { read write };
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 6b19be
##	Do not audit attempts to read and write xdm_xserver
Chris PeBenito 6b19be
##	unix domain stream sockets.
Chris PeBenito 6b19be
## </summary>
Chris PeBenito 6b19be
## <param name="domain">
Chris PeBenito 6b19be
##	<summary>
Chris PeBenito 6b19be
##	Domain allowed access.
Chris PeBenito 6b19be
##	</summary>
Chris PeBenito 6b19be
## </param>
Chris PeBenito 6b19be
#
Chris PeBenito 6b19be
interface(`xserver_dontaudit_rw_xdm_stream_sockets',`
Chris PeBenito 6b19be
	gen_require(`
Chris PeBenito 6b19be
		type xdm_xserver_t;
Chris PeBenito 6b19be
	')
Chris PeBenito 6b19be
Chris PeBenito 6b19be
	dontaudit $1 xdm_xserver_t:unix_stream_socket { read write };
Chris PeBenito 6b19be
')
Chris PeBenito 6b19be
Chris PeBenito 6b19be
########################################
Chris PeBenito 6b19be
## <summary>
Chris PeBenito 17de1b
##	Connect to xdm_xserver over a unix domain
Chris PeBenito 17de1b
##	stream socket.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`xserver_stream_connect_xdm_xserver',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type xdm_xserver_t, xdm_xserver_tmp_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_tmp($1)
Chris PeBenito c0868a
	stream_connect_pattern($1,xdm_xserver_tmp_t,xdm_xserver_tmp_t,xdm_xserver_t)
Chris PeBenito 17de1b
')