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 2c12b4
Chris PeBenito 2c12b4
		attribute x_server_domain;
Chris PeBenito 2c12b4
		class x_drawable all_x_drawable_perms;
Chris PeBenito 2c12b4
		class x_colormap all_x_colormap_perms;
Chris PeBenito 2c12b4
		class x_screen all_x_screen_perms;
Chris PeBenito 563e58
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	##############################
Chris PeBenito 17de1b
	#
Chris PeBenito 17de1b
	# Declarations
Chris PeBenito 17de1b
	#
Chris PeBenito 17de1b
Chris PeBenito 2c12b4
	attribute $1_x_domain;
Chris PeBenito 2c12b4
	attribute $1_input_xevent_type;
Chris PeBenito 2c12b4
Chris PeBenito 2c12b4
	type $1_rootwindow_t, rootwindow_type;
Chris PeBenito 2c12b4
Chris PeBenito 2c12b4
	type $1_xserver_t, x_server_domain;
Chris PeBenito 17de1b
	domain_type($1_xserver_t)
Chris PeBenito 0bfccd
	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:tcp_socket create_stream_socket_perms;
Chris PeBenito 17de1b
	allow $1_xserver_t self:udp_socket create_socket_perms;
Chris PeBenito 17de1b
Chris PeBenito 0bfccd
	manage_dirs_pattern($1_xserver_t, $1_xserver_tmp_t, $1_xserver_tmp_t)
Chris PeBenito 0bfccd
	manage_files_pattern($1_xserver_t, $1_xserver_tmp_t, $1_xserver_tmp_t)
Chris PeBenito 0bfccd
	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 0bfccd
	filetrans_pattern($1_xserver_t, xdm_xserver_tmp_t, $1_xserver_tmp_t, sock_file)
Chris PeBenito 17de1b
Chris PeBenito 0bfccd
	manage_dirs_pattern($1_xserver_t, $1_xserver_tmpfs_t, $1_xserver_tmpfs_t)
Chris PeBenito 0bfccd
	manage_files_pattern($1_xserver_t, $1_xserver_tmpfs_t, $1_xserver_tmpfs_t)
Chris PeBenito 0bfccd
	manage_lnk_files_pattern($1_xserver_t, $1_xserver_tmpfs_t, $1_xserver_tmpfs_t)
Chris PeBenito 0bfccd
	manage_fifo_files_pattern($1_xserver_t, $1_xserver_tmpfs_t, $1_xserver_tmpfs_t)
Chris PeBenito 0bfccd
	manage_sock_files_pattern($1_xserver_t, $1_xserver_tmpfs_t, $1_xserver_tmpfs_t)
Chris PeBenito 0bfccd
	fs_tmpfs_filetrans($1_xserver_t, $1_xserver_tmpfs_t, { dir file lnk_file sock_file fifo_file })
Chris PeBenito 17de1b
Chris PeBenito 0bfccd
	manage_files_pattern($1_xserver_t, xkb_var_lib_t, xkb_var_lib_t)
Chris PeBenito 0bfccd
	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 0bfccd
	manage_files_pattern($1_xserver_t, xserver_log_t, xserver_log_t)
Chris PeBenito 0bfccd
	logging_log_filetrans($1_xserver_t, xserver_log_t, file)
Chris PeBenito 17de1b
Chris PeBenito 2c12b4
	# Labeling rules for default windows and colormaps
Chris PeBenito 2c12b4
	type_transition $1_xserver_t $1_xserver_t:{ x_drawable x_colormap } $1_rootwindow_t;
Chris PeBenito 2c12b4
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 2c12b4
	selinux_validate_context($1_xserver_t)
Chris PeBenito 2c12b4
	selinux_compute_access_vector($1_xserver_t)
Chris PeBenito 2c12b4
	selinux_compute_create_context($1_xserver_t)
Chris PeBenito 2c12b4
Chris PeBenito c0cf6e
	auth_use_nsswitch($1_xserver_t)
Chris PeBenito c0cf6e
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 2c12b4
	logging_send_audit_msgs($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 2c12b4
	# read x_contexts
Chris PeBenito 2c12b4
	seutil_read_default_contexts($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 2c12b4
	tunable_policy(`!xserver_object_manager',`
Chris PeBenito 2c12b4
		# should be xserver_unconfined($1_xserver_t),
Chris PeBenito 2c12b4
		# but typeattribute doesnt work in conditionals
Chris PeBenito 2c12b4
		gen_require(`
Chris PeBenito 2c12b4
			attribute x_server_domain, x_domain;
Chris PeBenito 2c12b4
			attribute xproperty_type, xselection_type;
Chris PeBenito 2c12b4
			attribute xextension_type, xevent_type;
Chris PeBenito 2c12b4
			attribute rootwindow_type;
Chris PeBenito 2c12b4
Chris PeBenito 2c12b4
			type remote_xclient_t;
Chris PeBenito 2c12b4
		')
Chris PeBenito 2c12b4
		allow $1_xserver_t x_server_domain:x_server *;
Chris PeBenito 2c12b4
		allow $1_xserver_t { x_domain rootwindow_type }:x_drawable *;
Chris PeBenito 2c12b4
		allow $1_xserver_t x_server_domain:x_screen *;
Chris PeBenito 2c12b4
		allow $1_xserver_t x_domain:x_gc *;
Chris PeBenito 2c12b4
		allow $1_xserver_t { x_domain rootwindow_type }:x_colormap *;
Chris PeBenito 2c12b4
		allow $1_xserver_t xproperty_type:x_property *;
Chris PeBenito 2c12b4
		allow $1_xserver_t xselection_type:x_selection *;
Chris PeBenito 2c12b4
		allow $1_xserver_t x_domain:x_cursor *;
Chris PeBenito 2c12b4
		allow $1_xserver_t { x_domain remote_xclient_t }:x_client *;
Chris PeBenito 2c12b4
		allow $1_xserver_t { x_domain x_server_domain }:x_device *;
Chris PeBenito 2c12b4
		allow $1_xserver_t xextension_type:x_extension *;
Chris PeBenito 2c12b4
		allow $1_xserver_t { x_domain x_server_domain }:x_resource *;
Chris PeBenito 2c12b4
		allow $1_xserver_t xevent_type:{ x_event x_synthetic_event } *;
Chris PeBenito 2c12b4
	')
Chris PeBenito 2c12b4
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 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 0bfccd
	userdom_user_home_content($1, $1_fonts_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	type $1_fonts_cache_t, fonts_cache_type;
Chris PeBenito 0bfccd
	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 0bfccd
	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 0bfccd
	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 0bfccd
	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 0bfccd
	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 0bfccd
	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 0bfccd
	manage_dirs_pattern($2, $1_fonts_t, $1_fonts_t)
Chris PeBenito 0bfccd
	manage_files_pattern($2, $1_fonts_t, $1_fonts_t)
Chris PeBenito 0bfccd
	relabel_dirs_pattern($2, $1_fonts_t, $1_fonts_t)
Chris PeBenito 0bfccd
	relabel_files_pattern($2, $1_fonts_t, $1_fonts_t)
Chris PeBenito 17de1b
Chris PeBenito 0bfccd
	manage_dirs_pattern($2, $1_fonts_config_t, $1_fonts_config_t)
Chris PeBenito 0bfccd
	manage_files_pattern($2, $1_fonts_config_t, $1_fonts_config_t)
Chris PeBenito 0bfccd
	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 0bfccd
	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 0bfccd
	userdom_search_user_home_dirs($1, $1_xserver_t)
Chris PeBenito 0bfccd
	userdom_use_user_ttys($1, $1_xserver_t)
Chris PeBenito 0bfccd
	userdom_setattr_user_ttys($1, $1_xserver_t)
Chris PeBenito 0bfccd
	userdom_rw_user_tmpfs_files($1, $1_xserver_t)
Chris PeBenito 17de1b
Chris PeBenito 0bfccd
	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 0bfccd
	userdom_user_home_dir_filetrans($1, $1_xauth_t, $1_xauth_home_t,file)
Chris PeBenito 17de1b
Chris PeBenito 0bfccd
	manage_dirs_pattern($1_xauth_t, $1_xauth_tmp_t, $1_xauth_tmp_t)
Chris PeBenito 0bfccd
	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 0bfccd
	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 c0cf6e
	auth_use_nsswitch($1_xauth_t)
Chris PeBenito c0cf6e
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 0bfccd
	userdom_use_user_terminals($1, $1_xauth_t)
Chris PeBenito 0bfccd
	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
		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 0bfccd
	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 0bfccd
	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 0bfccd
	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 2c12b4
Chris PeBenito 2c12b4
	##############################
Chris PeBenito 2c12b4
	#
Chris PeBenito 2c12b4
	# User X object manager local policy
Chris PeBenito 2c12b4
	#
Chris PeBenito 2c12b4
Chris PeBenito 2c12b4
	# Device rules
Chris PeBenito 2c12b4
	allow $1_x_domain $1_xserver_t:x_device { read getattr use setattr setfocus grab bell };
Chris PeBenito 2c12b4
Chris PeBenito 2c12b4
	allow $1_xserver_t { input_xevent_t $1_input_xevent_type }:x_event send;
Chris PeBenito 2c12b4
	allow $1_xserver_t { $1_rootwindow_t $1_x_domain }:x_drawable send;
Chris PeBenito 2c12b4
Chris PeBenito 2c12b4
	# manage: xhost X11:ChangeHosts
Chris PeBenito 2c12b4
	# freeze: metacity X11:GrabKey
Chris PeBenito 2c12b4
	# force_cursor: metacity X11:GrabPointer
Chris PeBenito 2c12b4
	allow $2 $1_xserver_t:x_device { manage freeze force_cursor };
Chris PeBenito 2c12b4
Chris PeBenito 2c12b4
	# gnome-settings-daemon XKEYBOARD:SetControls
Chris PeBenito 2c12b4
	allow $2 $1_xserver_t:x_server manage;
Chris PeBenito 2c12b4
Chris PeBenito 2c12b4
	# gnome-settings-daemon RANDR:SelectInput
Chris PeBenito 2c12b4
	allow $2 $1_xserver_t:x_resource write;
Chris PeBenito 2c12b4
Chris PeBenito 2c12b4
	# metacity X11:InstallColormap X11:UninstallColormap
Chris PeBenito 2c12b4
	allow $2 $1_rootwindow_t:x_colormap { install uninstall };
Chris PeBenito 2c12b4
Chris PeBenito 2c12b4
	# read: gnome-settings-daemon RANDR:GetScreenSizeRange
Chris PeBenito 2c12b4
	# write: gnome-settings-daemon RANDR:SelectInput
Chris PeBenito 2c12b4
	# setattr: gnome-settings-daemon X11:GrabKey
Chris PeBenito 2c12b4
	# manage: metacity X11:ChangeWindowAttributes
Chris PeBenito 2c12b4
	allow $2 $1_rootwindow_t:x_drawable { read write manage setattr };
Chris PeBenito 2c12b4
Chris PeBenito 2c12b4
	# setattr: metacity X11:InstallColormap
Chris PeBenito 2c12b4
	allow $2 $1_xserver_t:x_screen { saver_setattr saver_getattr setattr };
Chris PeBenito 2c12b4
Chris PeBenito 2c12b4
	# xrdb X11:ChangeProperty prop=RESOURCE_MANAGER
Chris PeBenito 2c12b4
	allow $2 info_xproperty_t:x_property { create write append };
Chris PeBenito 2c12b4
Chris PeBenito 2c12b4
	mls_xwin_read_to_clearance($1_xserver_t)
Chris PeBenito 2c12b4
Chris PeBenito 0bfccd
	xserver_common_x_domain_template($1, $1, $2)
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 0bfccd
	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 2c12b4
#	refpolicywarn(`$0() has been deprecated, please use xserver_user_x_domain_template instead.')
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 0bfccd
	userdom_search_user_home_dirs($1, $2)
Chris PeBenito 17de1b
	# for .xsession-errors
Chris PeBenito 0bfccd
	userdom_dontaudit_write_user_home_content_files($1, $2)
Chris PeBenito 17de1b
Chris PeBenito 0bfccd
	xserver_ro_session_template(xdm, $2, $3)
Chris PeBenito 0bfccd
	xserver_rw_session_template($1, $2, $3)
Chris PeBenito 0bfccd
	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 2c12b4
#######################################
Chris PeBenito 2c12b4
## <summary>
Chris PeBenito 2c12b4
##	Interface to provide X object permissions on a given X server to
Chris PeBenito 2c12b4
##	an X client domain.  Provides the minimal set required by a basic
Chris PeBenito 2c12b4
##	X client application.
Chris PeBenito 2c12b4
## </summary>
Chris PeBenito 2c12b4
## <param name="user">
Chris PeBenito 2c12b4
##	<summary>
Chris PeBenito 2c12b4
##	The prefix of the X server domain (e.g., user
Chris PeBenito 2c12b4
##	is the prefix for user_t).
Chris PeBenito 2c12b4
##	</summary>
Chris PeBenito 2c12b4
## </param>
Chris PeBenito 2c12b4
## <param name="prefix">
Chris PeBenito 2c12b4
##	<summary>
Chris PeBenito 2c12b4
##	The prefix of the X client domain (e.g., user
Chris PeBenito 2c12b4
##	is the prefix for user_t).
Chris PeBenito 2c12b4
##	</summary>
Chris PeBenito 2c12b4
## </param>
Chris PeBenito 2c12b4
## <param name="domain">
Chris PeBenito 2c12b4
##	<summary>
Chris PeBenito 2c12b4
##	Client domain allowed access.
Chris PeBenito 2c12b4
##	</summary>
Chris PeBenito 2c12b4
## </param>
Chris PeBenito 2c12b4
#
Chris PeBenito 2c12b4
template(`xserver_common_x_domain_template',`
Chris PeBenito 2c12b4
	gen_require(`
Chris PeBenito 2c12b4
		type $1_rootwindow_t, std_xext_t, shmem_xext_t;
Chris PeBenito 2c12b4
		type xproperty_t, info_xproperty_t, clipboard_xproperty_t;
Chris PeBenito 2c12b4
		type input_xevent_t, focus_xevent_t, property_xevent_t, manage_xevent_t;
Chris PeBenito 2c12b4
		type xevent_t, client_xevent_t;
Chris PeBenito 2c12b4
		type clipboard_xselection_t, xselection_t;
Chris PeBenito 2c12b4
Chris PeBenito 2c12b4
		attribute x_server_domain, x_domain;
Chris PeBenito 2c12b4
		attribute xproperty_type;
Chris PeBenito 2c12b4
		attribute xevent_type, xextension_type;
Chris PeBenito 2c12b4
		attribute $1_x_domain, $1_input_xevent_type;
Chris PeBenito 2c12b4
Chris PeBenito 2c12b4
		class x_drawable all_x_drawable_perms;
Chris PeBenito 2c12b4
		class x_screen all_x_screen_perms;
Chris PeBenito 2c12b4
		class x_gc all_x_gc_perms;
Chris PeBenito 2c12b4
		class x_font all_x_font_perms;
Chris PeBenito 2c12b4
		class x_colormap all_x_colormap_perms;
Chris PeBenito 2c12b4
		class x_property all_x_property_perms;
Chris PeBenito 2c12b4
		class x_selection all_x_selection_perms;
Chris PeBenito 2c12b4
		class x_cursor all_x_cursor_perms;	
Chris PeBenito 2c12b4
		class x_client all_x_client_perms;
Chris PeBenito 2c12b4
		class x_device all_x_device_perms;
Chris PeBenito 2c12b4
		class x_server all_x_server_perms;
Chris PeBenito 2c12b4
		class x_extension all_x_extension_perms;
Chris PeBenito 2c12b4
		class x_resource all_x_resource_perms;
Chris PeBenito 2c12b4
		class x_event all_x_event_perms;
Chris PeBenito 2c12b4
		class x_synthetic_event all_x_synthetic_event_perms;
Chris PeBenito 2c12b4
	')
Chris PeBenito 2c12b4
Chris PeBenito 2c12b4
	##############################
Chris PeBenito 2c12b4
	#
Chris PeBenito 2c12b4
	# Declarations
Chris PeBenito 2c12b4
	#
Chris PeBenito 2c12b4
Chris PeBenito 2c12b4
	# Type attributes
Chris PeBenito 2c12b4
	typeattribute $3 $1_x_domain, x_domain;
Chris PeBenito 2c12b4
Chris PeBenito 2c12b4
	# Types for properties
Chris PeBenito 2c12b4
	type $2_xproperty_t alias $2_default_xproperty_t, xproperty_type;
Chris PeBenito 2c12b4
Chris PeBenito 2c12b4
	# Types for events
Chris PeBenito 2c12b4
	type $2_input_xevent_t, $1_input_xevent_type, xevent_type;
Chris PeBenito 2c12b4
	type $2_property_xevent_t, xevent_type;
Chris PeBenito 2c12b4
	type $2_focus_xevent_t, xevent_type;
Chris PeBenito 2c12b4
	type $2_manage_xevent_t, xevent_type;
Chris PeBenito 2c12b4
	type $2_default_xevent_t, xevent_type;
Chris PeBenito 2c12b4
	type $2_client_xevent_t, xevent_type;
Chris PeBenito 2c12b4
Chris PeBenito 2c12b4
	##############################
Chris PeBenito 2c12b4
	#
Chris PeBenito 2c12b4
	# Local Policy
Chris PeBenito 2c12b4
	#
Chris PeBenito 2c12b4
Chris PeBenito 2c12b4
	# Hacks
Chris PeBenito 2c12b4
	# everyone can get the input focus of everyone else
Chris PeBenito 2c12b4
	# this is a fundamental brokenness in the X protocol
Chris PeBenito 2c12b4
	allow $3 { x_domain x_server_domain }:x_device getfocus;
Chris PeBenito 2c12b4
	# everyone can grab the server
Chris PeBenito 2c12b4
	# everyone does it, it is basically a free DOS attack
Chris PeBenito 2c12b4
	allow $3 x_server_domain:x_server grab;
Chris PeBenito 2c12b4
	# everyone can get the font path, etc.
Chris PeBenito 2c12b4
	# this could leak out sensitive information
Chris PeBenito 2c12b4
	allow $3 x_server_domain:x_server getattr;
Chris PeBenito 2c12b4
	# everyone can do override-redirect windows.
Chris PeBenito 2c12b4
	# this could be used to spoof labels
Chris PeBenito 2c12b4
	allow $3 self:x_drawable override;
Chris PeBenito 2c12b4
	# everyone can receive management events on the root window
Chris PeBenito 2c12b4
	# allows to know when new windows appear, among other things
Chris PeBenito 2c12b4
	allow $3 manage_xevent_t:x_event receive;
Chris PeBenito 2c12b4
Chris PeBenito 2c12b4
	# X Server
Chris PeBenito 2c12b4
	# can read server-owned resources
Chris PeBenito 2c12b4
	allow $3 x_server_domain:x_resource read;
Chris PeBenito 2c12b4
	# can mess with own clients
Chris PeBenito 2c12b4
	allow $3 self:x_client { manage destroy };
Chris PeBenito 2c12b4
Chris PeBenito 2c12b4
	# X Protocol Extensions
Chris PeBenito 2c12b4
	allow $3 std_xext_t:x_extension { query use };
Chris PeBenito 2c12b4
	allow $3 shmem_xext_t:x_extension { query use };
Chris PeBenito 2c12b4
	dontaudit $3 xextension_type:x_extension { query use };
Chris PeBenito 2c12b4
Chris PeBenito 2c12b4
	# X Properties
Chris PeBenito 2c12b4
	# can read and write client properties
Chris PeBenito 2c12b4
	allow $3 $2_xproperty_t:x_property { create destroy read write append };
Chris PeBenito 2c12b4
	type_transition $3 xproperty_t:x_property $2_xproperty_t;
Chris PeBenito 2c12b4
	# can read and write cut buffers
Chris PeBenito 2c12b4
	allow $3 clipboard_xproperty_t:x_property { create read write append };
Chris PeBenito 2c12b4
	# can read info properties
Chris PeBenito 2c12b4
	allow $3 info_xproperty_t:x_property read;
Chris PeBenito 2c12b4
	# can change properties of root window
Chris PeBenito 2c12b4
	allow $3 $1_rootwindow_t:x_drawable { list_property get_property set_property };
Chris PeBenito 2c12b4
	# can change properties of own windows
Chris PeBenito 2c12b4
	allow $3 self:x_drawable { list_property get_property set_property };
Chris PeBenito 2c12b4
Chris PeBenito 2c12b4
	# X Windows
Chris PeBenito 2c12b4
	# operations allowed on root windows
Chris PeBenito 2c12b4
	allow $3 $1_rootwindow_t:x_drawable { getattr list_child add_child remove_child send receive };
Chris PeBenito 2c12b4
	# operations allowed on my windows
Chris PeBenito 2c12b4
	allow $3 self:x_drawable { create destroy getattr setattr read write show hide list_child add_child remove_child manage send receive };
Chris PeBenito 2c12b4
	type_transition $3 $1_rootwindow_t:x_drawable $3;
Chris PeBenito 2c12b4
Chris PeBenito 2c12b4
	# X Colormaps
Chris PeBenito 2c12b4
	# can use the default colormap
Chris PeBenito 2c12b4
	allow $3 $1_rootwindow_t:x_colormap { read use add_color };
Chris PeBenito 2c12b4
Chris PeBenito 2c12b4
	# X Input
Chris PeBenito 2c12b4
	# can receive own events
Chris PeBenito 2c12b4
	allow $3 $2_input_xevent_t:{ x_event x_synthetic_event } receive;
Chris PeBenito 2c12b4
	allow $3 $2_property_xevent_t:{ x_event x_synthetic_event } receive;
Chris PeBenito 2c12b4
	allow $3 $2_focus_xevent_t:{ x_event x_synthetic_event } receive;
Chris PeBenito 2c12b4
	allow $3 $2_manage_xevent_t:{ x_event x_synthetic_event } receive;
Chris PeBenito 2c12b4
	allow $3 $2_default_xevent_t:{ x_event x_synthetic_event } receive;
Chris PeBenito 2c12b4
	allow $3 $2_client_xevent_t:{ x_event x_synthetic_event } receive;
Chris PeBenito 2c12b4
	type_transition $3 input_xevent_t:x_event $2_input_xevent_t;
Chris PeBenito 2c12b4
	type_transition $3 property_xevent_t:x_event $2_property_xevent_t;
Chris PeBenito 2c12b4
	type_transition $3 focus_xevent_t:x_event $2_focus_xevent_t;
Chris PeBenito 2c12b4
	type_transition $3 manage_xevent_t:x_event $2_manage_xevent_t;
Chris PeBenito 2c12b4
	type_transition $3 client_xevent_t:x_event $2_client_xevent_t;
Chris PeBenito 2c12b4
	type_transition $3 xevent_t:x_event $2_default_xevent_t;
Chris PeBenito 2c12b4
	# can receive certain root window events
Chris PeBenito 2c12b4
	allow $3 focus_xevent_t:x_event receive;
Chris PeBenito 2c12b4
	allow $3 property_xevent_t:x_event receive;
Chris PeBenito 2c12b4
	allow $3 client_xevent_t:x_synthetic_event receive;
Chris PeBenito 2c12b4
	allow $3 manage_xevent_t:x_synthetic_event receive;
Chris PeBenito 2c12b4
	# can send ICCCM events to myself
Chris PeBenito 2c12b4
	allow $3 $2_manage_xevent_t:x_synthetic_event send;
Chris PeBenito 2c12b4
	# can send ICCCM events to the root window
Chris PeBenito 2c12b4
	allow $3 manage_xevent_t:x_synthetic_event send;
Chris PeBenito 2c12b4
	allow $3 client_xevent_t:x_synthetic_event send;
Chris PeBenito 2c12b4
Chris PeBenito 2c12b4
	# X Selections
Chris PeBenito 2c12b4
	# can use the clipboard
Chris PeBenito 2c12b4
	allow $3 clipboard_xselection_t:x_selection { getattr setattr read };
Chris PeBenito 2c12b4
	# can query all other selections
Chris PeBenito 2c12b4
	allow $3 xselection_t:x_selection { getattr read };
Chris PeBenito 2c12b4
Chris PeBenito 2c12b4
	# Other X Objects
Chris PeBenito 2c12b4
	# can create and use cursors
Chris PeBenito 2c12b4
	allow $3 self:x_cursor *;
Chris PeBenito 2c12b4
	# can create and use graphics contexts
Chris PeBenito 2c12b4
	allow $3 self:x_gc *;
Chris PeBenito 2c12b4
	# can create and use colormaps
Chris PeBenito 2c12b4
	allow $3 self:x_colormap *;
Chris PeBenito 2c12b4
	# can read and write own objects
Chris PeBenito 2c12b4
	allow $3 self:x_resource { read write };
Chris PeBenito 2c12b4
Chris PeBenito 2c12b4
	tunable_policy(`! xserver_object_manager',`
Chris PeBenito 2c12b4
		# should be xserver_unconfined($3),
Chris PeBenito 2c12b4
		# but typeattribute doesnt work in conditionals
Chris PeBenito 2c12b4
		gen_require(`
Chris PeBenito 2c12b4
			attribute x_server_domain, x_domain;
Chris PeBenito 2c12b4
			attribute xproperty_type, xselection_type;
Chris PeBenito 2c12b4
			attribute xextension_type, xevent_type;
Chris PeBenito 2c12b4
			attribute rootwindow_type;
Chris PeBenito 2c12b4
Chris PeBenito 2c12b4
			type remote_xclient_t;
Chris PeBenito 2c12b4
		')
Chris PeBenito 2c12b4
		allow $3 x_server_domain:x_server *;
Chris PeBenito 2c12b4
		allow $3 { x_domain rootwindow_type }:x_drawable *;
Chris PeBenito 2c12b4
		allow $3 x_server_domain:x_screen *;
Chris PeBenito 2c12b4
		allow $3 x_domain:x_gc *;
Chris PeBenito 2c12b4
		allow $3 { x_domain rootwindow_type }:x_colormap *;
Chris PeBenito 2c12b4
		allow $3 xproperty_type:x_property *;
Chris PeBenito 2c12b4
		allow $3 xselection_type:x_selection *;
Chris PeBenito 2c12b4
		allow $3 x_domain:x_cursor *;
Chris PeBenito 2c12b4
		allow $3 { x_domain remote_xclient_t }:x_client *;
Chris PeBenito 2c12b4
		allow $3 { x_domain x_server_domain }:x_device *;
Chris PeBenito 2c12b4
		allow $3 xextension_type:x_extension *;
Chris PeBenito 2c12b4
		allow $3 { x_domain x_server_domain }:x_resource *;
Chris PeBenito 2c12b4
		allow $3 xevent_type:{ x_event x_synthetic_event } *;
Chris PeBenito 2c12b4
	')
Chris PeBenito 2c12b4
')
Chris PeBenito 2c12b4
Chris PeBenito 2c12b4
#######################################
Chris PeBenito 2c12b4
## <summary>
Chris PeBenito 2c12b4
##	Interface to provide X object permissions on a given X server to
Chris PeBenito 2c12b4
##	an X client domain.  Provides the minimal set required by a basic
Chris PeBenito 2c12b4
##	X client application.
Chris PeBenito 2c12b4
## </summary>
Chris PeBenito 2c12b4
## <param name="user">
Chris PeBenito 2c12b4
##	<summary>
Chris PeBenito 2c12b4
##	The prefix of the X server domain (e.g., user
Chris PeBenito 2c12b4
##	is the prefix for user_t).
Chris PeBenito 2c12b4
##	</summary>
Chris PeBenito 2c12b4
## </param>
Chris PeBenito 2c12b4
## <param name="prefix">
Chris PeBenito 2c12b4
##	<summary>
Chris PeBenito 2c12b4
##	The prefix of the X client domain (e.g., user
Chris PeBenito 2c12b4
##	is the prefix for user_t).
Chris PeBenito 2c12b4
##	</summary>
Chris PeBenito 2c12b4
## </param>
Chris PeBenito 2c12b4
## <param name="domain">
Chris PeBenito 2c12b4
##	<summary>
Chris PeBenito 2c12b4
##	Client domain allowed access.
Chris PeBenito 2c12b4
##	</summary>
Chris PeBenito 2c12b4
## </param>
Chris PeBenito 2c12b4
## <param name="tmpfs_type">
Chris PeBenito 2c12b4
##	<summary>
Chris PeBenito 2c12b4
##	The type of the domain SYSV tmpfs files.
Chris PeBenito 2c12b4
##	</summary>
Chris PeBenito 2c12b4
## </param>
Chris PeBenito 2c12b4
#
Chris PeBenito 2c12b4
template(`xserver_user_x_domain_template',`
Chris PeBenito 2c12b4
	gen_require(`
Chris PeBenito 2c12b4
		type xdm_t, xdm_tmp_t;
Chris PeBenito 2c12b4
		type $1_xauth_home_t, $1_iceauth_home_t, $1_xserver_t, $1_xserver_tmpfs_t;
Chris PeBenito 2c12b4
	')
Chris PeBenito 2c12b4
Chris PeBenito 2c12b4
	allow $3 self:shm create_shm_perms;
Chris PeBenito 2c12b4
	allow $3 self:unix_dgram_socket create_socket_perms;
Chris PeBenito 2c12b4
	allow $3 self:unix_stream_socket { connectto create_stream_socket_perms };
Chris PeBenito 2c12b4
Chris PeBenito 2c12b4
	# Read .Xauthority file
Chris PeBenito 2c12b4
	allow $3 $1_xauth_home_t:file { getattr read };
Chris PeBenito 2c12b4
	allow $3 $1_iceauth_home_t:file { getattr read };
Chris PeBenito 2c12b4
Chris PeBenito 2c12b4
	# for when /tmp/.X11-unix is created by the system
Chris PeBenito 2c12b4
	allow $3 xdm_t:fd use;
Chris PeBenito 2c12b4
	allow $3 xdm_t:fifo_file { getattr read write ioctl };
Chris PeBenito 2c12b4
	allow $3 xdm_tmp_t:dir search;
Chris PeBenito 2c12b4
	allow $3 xdm_tmp_t:sock_file { read write };
Chris PeBenito 2c12b4
	dontaudit $3 xdm_t:tcp_socket { read write };
Chris PeBenito 2c12b4
Chris PeBenito 2c12b4
	# Allow connections to X server.
Chris PeBenito 2c12b4
	files_search_tmp($3)
Chris PeBenito 2c12b4
Chris PeBenito 2c12b4
	miscfiles_read_fonts($3)
Chris PeBenito 2c12b4
Chris PeBenito 0bfccd
	userdom_search_user_home_dirs($1, $3)
Chris PeBenito 2c12b4
	# for .xsession-errors
Chris PeBenito 0bfccd
	userdom_dontaudit_write_user_home_content_files($1, $3)
Chris PeBenito 2c12b4
Chris PeBenito 0bfccd
	xserver_ro_session_template(xdm, $3, $4)
Chris PeBenito 0bfccd
	xserver_rw_session_template($1, $3, $4)
Chris PeBenito 0bfccd
	xserver_use_user_fonts($1, $3)
Chris PeBenito 2c12b4
Chris PeBenito 2c12b4
	xserver_read_xdm_tmp_files($3)
Chris PeBenito 2c12b4
Chris PeBenito 2c12b4
	# X object manager
Chris PeBenito 0bfccd
	xserver_common_x_domain_template($1, $2, $3)
Chris PeBenito 2c12b4
Chris PeBenito 2c12b4
	# Client write xserver shm
Chris PeBenito 2c12b4
	tunable_policy(`allow_write_xshm',`
Chris PeBenito 2c12b4
		allow $3 $1_xserver_t:shm rw_shm_perms;
Chris PeBenito 2c12b4
		allow $3 $1_xserver_tmpfs_t:file rw_file_perms;
Chris PeBenito 2c12b4
	')
Chris PeBenito 2c12b4
')
Chris PeBenito 2c12b4
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 0bfccd
	manage_dirs_pattern($2, $1_fonts_cache_t, $1_fonts_cache_t)
Chris PeBenito 0bfccd
	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 0bfccd
	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 0bfccd
	manage_dirs_pattern($1, fonts_cache_type, fonts_cache_type)
Chris PeBenito 0bfccd
	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 5f63dd
	allow $1 xconsole_device_t:fifo_file rw_fifo_file_perms;
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 0bfccd
	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 0bfccd
	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 0bfccd
	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 0bfccd
	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 0bfccd
	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 0bfccd
	delete_files_pattern($1, xserver_log_t, xserver_log_t)
Chris PeBenito 0bfccd
	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 0bfccd
	read_files_pattern($1, xkb_var_lib_t, xkb_var_lib_t)
Chris PeBenito 0bfccd
	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 0bfccd
	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 0bfccd
	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 0bfccd
	stream_connect_pattern($1, xdm_xserver_tmp_t, xdm_xserver_tmp_t, xdm_xserver_t)
Chris PeBenito 17de1b
')
Chris PeBenito 2c12b4
Chris PeBenito 2c12b4
########################################
Chris PeBenito 2c12b4
## <summary>
Chris PeBenito 2c12b4
##	Interface to provide X object permissions on a given X server to
Chris PeBenito 2c12b4
##	an X client domain.  Gives the domain complete control over the
Chris PeBenito 2c12b4
##	display.
Chris PeBenito 2c12b4
## </summary>
Chris PeBenito 2c12b4
## <param name="domain">
Chris PeBenito 2c12b4
##	<summary>
Chris PeBenito 2c12b4
##	Domain allowed access.
Chris PeBenito 2c12b4
##	</summary>
Chris PeBenito 2c12b4
## </param>
Chris PeBenito 2c12b4
#
Chris PeBenito 2c12b4
interface(`xserver_unconfined',`
Chris PeBenito 2c12b4
	gen_require(`
Chris PeBenito 2c12b4
		attribute xserver_unconfined_type;
Chris PeBenito 2c12b4
	')
Chris PeBenito 2c12b4
Chris PeBenito 2c12b4
	typeattribute $1 xserver_unconfined_type;
Chris PeBenito 2c12b4
')