1ec3d1a
## <summary>X Window Managers</summary>
1ec3d1a
1ec3d1a
#######################################
1ec3d1a
## <summary>
1ec3d1a
##	The role template for the wm module.
1ec3d1a
## </summary>
1ec3d1a
## <desc>
1ec3d1a
##	

1ec3d1a
##	This template creates a derived domains which are used
1ec3d1a
##	for window manager applications.
1ec3d1a
##	

1ec3d1a
## </desc>
1ec3d1a
## <param name="role_prefix">
1ec3d1a
##	<summary>
1ec3d1a
##	The prefix of the user domain (e.g., user
1ec3d1a
##	is the prefix for user_t).
1ec3d1a
##	</summary>
1ec3d1a
## </param>
1ec3d1a
## <param name="user_role">
1ec3d1a
##	<summary>
1ec3d1a
##	The role associated with the user domain.
1ec3d1a
##	</summary>
1ec3d1a
## </param>
1ec3d1a
## <param name="user_domain">
1ec3d1a
##	<summary>
1ec3d1a
##	The type of the user domain.
1ec3d1a
##	</summary>
1ec3d1a
## </param>
1ec3d1a
#
1ec3d1a
template(`wm_role_template',`
1ec3d1a
	gen_require(`
1ec3d1a
		type wm_exec_t;
1ec3d1a
		class dbus send_msg;
1ec3d1a
	')
1ec3d1a
1ec3d1a
	type $1_wm_t;
1ec3d1a
	domain_type($1_wm_t)
1ec3d1a
	domain_entry_file($1_wm_t, wm_exec_t)
1ec3d1a
	role $2 types $1_wm_t;
1ec3d1a
1ec3d1a
	allow $1_wm_t self:fifo_file rw_fifo_file_perms;
1ec3d1a
	allow $1_wm_t self:process getsched;
1ec3d1a
	allow $1_wm_t self:shm create_shm_perms;
1ec3d1a
1ec3d1a
	allow $1_wm_t $3:unix_stream_socket connectto;
1ec3d1a
	allow $3 $1_wm_t:unix_stream_socket connectto;
1ec3d1a
	allow $3 $1_wm_t:process { signal sigchld signull };
1ec3d1a
	allow $1_wm_t $3:process { signull sigkill };
1ec3d1a
1ec3d1a
	allow $1_wm_t $3:dbus send_msg;
1ec3d1a
	allow $3 $1_wm_t:dbus send_msg;
1ec3d1a
1ec3d1a
	domtrans_pattern($3, wm_exec_t, $1_wm_t)
1ec3d1a
1ec3d1a
	kernel_read_system_state($1_wm_t)
1ec3d1a
1ec3d1a
	corecmd_bin_domtrans($1_wm_t, $3)
1ec3d1a
	corecmd_shell_domtrans($1_wm_t, $3)
1ec3d1a
1ec3d1a
	dev_read_urand($1_wm_t)
1ec3d1a
4a1862e
	files_read_etc_files($1_wm_t)
1ec3d1a
	files_read_usr_files($1_wm_t)
1ec3d1a
1ec3d1a
	fs_getattr_tmpfs($1_wm_t)
1ec3d1a
1ec3d1a
	mls_file_read_all_levels($1_wm_t)
1ec3d1a
	mls_file_write_all_levels($1_wm_t)
1ec3d1a
	mls_xwin_read_all_levels($1_wm_t)
1ec3d1a
	mls_xwin_write_all_levels($1_wm_t)
1ec3d1a
	mls_fd_use_all_levels($1_wm_t)
1ec3d1a
1ec3d1a
	auth_use_nsswitch($1_wm_t)
1ec3d1a
1ec3d1a
	application_signull($1_wm_t)
1ec3d1a
1ec3d1a
	miscfiles_read_fonts($1_wm_t)
1ec3d1a
1ec3d1a
	userdom_manage_home_role($2, $1_wm_t)
1ec3d1a
	userdom_manage_tmpfs_role($2, $1_wm_t)
1ec3d1a
	userdom_manage_tmp_role($2, $1_wm_t)
1ec3d1a
	userdom_exec_user_tmp_files($1_wm_t)
1ec3d1a
1ec3d1a
	optional_policy(`
1ec3d1a
		dbus_system_bus_client($1_wm_t)
1ec3d1a
		dbus_session_bus_client($1_wm_t)
1ec3d1a
	')
1ec3d1a
1ec3d1a
	optional_policy(`
1ec3d1a
		pulseaudio_stream_connect($1_wm_t)
1ec3d1a
	')
1ec3d1a
1ec3d1a
	optional_policy(`
1ec3d1a
		xserver_role($2, $1_wm_t)
1ec3d1a
		xserver_manage_core_devices($1_wm_t)
1ec3d1a
	')
1ec3d1a
')
1ec3d1a
1ec3d1a
########################################
1ec3d1a
## <summary>
1ec3d1a
##	Execute the wm program in the wm domain.
1ec3d1a
## </summary>
1ec3d1a
## <param name="domain">
1ec3d1a
##	<summary>
1ec3d1a
##	Domain allowed access.
1ec3d1a
##	</summary>
1ec3d1a
## </param>
1ec3d1a
#
1ec3d1a
interface(`wm_exec',`
1ec3d1a
	gen_require(`
1ec3d1a
		type wm_exec_t;
1ec3d1a
	')
1ec3d1a
1ec3d1a
	can_exec($1, wm_exec_t)
1ec3d1a
')