Chris PeBenito 002190
## <summary>GNU network object model environment (GNOME)</summary>
Chris PeBenito 002190
Chris PeBenito 002190
########################################
Chris PeBenito 002190
## <summary>
Chris PeBenito 002190
##	The per role template for the gnome module.
Chris PeBenito 002190
## </summary>
Chris PeBenito 002190
## <desc>
Chris PeBenito 002190
##	

Chris PeBenito 002190
##	This template creates a derived domain which is used
Chris PeBenito 002190
##	for gconf sessions.
Chris PeBenito 002190
##	

Chris PeBenito 002190
##	

Chris PeBenito 002190
##	This template is invoked automatically for each role, and
Chris PeBenito 002190
##	generally does not need to be invoked directly
Chris PeBenito 002190
##	by policy writers.
Chris PeBenito 002190
##	

Chris PeBenito 002190
## </desc>
Chris PeBenito 002190
## <param name="userdomain_prefix">
Chris PeBenito 002190
##	<summary>
Chris PeBenito 002190
##	The prefix of the user domain (e.g., user
Chris PeBenito 002190
##	is the prefix for user_t).
Chris PeBenito 002190
##	</summary>
Chris PeBenito 002190
## </param>
Chris PeBenito 002190
## <param name="user_domain">
Chris PeBenito 002190
##	<summary>
Chris PeBenito 002190
##	The type of the user domain.
Chris PeBenito 002190
##	</summary>
Chris PeBenito 002190
## </param>
Chris PeBenito 002190
## <param name="user_role">
Chris PeBenito 002190
##	<summary>
Chris PeBenito 002190
##	The role associated with the user domain.
Chris PeBenito 002190
##	</summary>
Chris PeBenito 002190
## </param>
Chris PeBenito 002190
#
Chris PeBenito 002190
template(`gnome_per_role_template',`
Chris PeBenito 002190
	gen_require(`
Chris PeBenito 002190
		type gconfd_exec_t;
Chris PeBenito 6b19be
		attribute gnomedomain;
Chris PeBenito 002190
	')
Chris PeBenito 002190
Chris PeBenito 002190
	##############################
Chris PeBenito 002190
	#
Chris PeBenito 002190
	# Declarations
Chris PeBenito 002190
	#
Chris PeBenito 6b19be
	type $1_gconfd_t, gnomedomain;
Chris PeBenito 6b19be
Chris PeBenito d46cfe
	application_domain($1_gconfd_t, gconfd_exec_t)
Chris PeBenito 002190
	role $3 types $1_gconfd_t;
Chris PeBenito 002190
Chris PeBenito 002190
	type $1_gconf_home_t;
Chris PeBenito 6b19be
	userdom_user_home_content($1, $1_gconf_home_t)
Chris PeBenito 6b19be
Chris PeBenito 6b19be
	type $1_gnome_home_t;
Chris PeBenito 6b19be
	userdom_user_home_content($1, $1_gnome_home_t)
Chris PeBenito 002190
Chris PeBenito 002190
	type $1_gconf_tmp_t;
Chris PeBenito 002190
	files_tmp_file($1_gconf_tmp_t)
Chris PeBenito 002190
Chris PeBenito 002190
	##############################
Chris PeBenito 002190
	#
Chris PeBenito 002190
	# Local Policy
Chris PeBenito 002190
	#
Chris PeBenito 002190
Chris PeBenito 002190
	allow $1_gconfd_t self:process getsched;
Chris PeBenito 6b19be
 	allow $1_gconfd_t self:fifo_file rw_fifo_file_perms;
Chris PeBenito 002190
Chris PeBenito c0868a
	manage_dirs_pattern($1_gconfd_t,$1_gconf_home_t,$1_gconf_home_t)
Chris PeBenito c0868a
	manage_files_pattern($1_gconfd_t,$1_gconf_home_t,$1_gconf_home_t)
Chris PeBenito 002190
	userdom_user_home_dir_filetrans($1, $1_gconfd_t, $1_gconf_home_t, dir)
Chris PeBenito 002190
Chris PeBenito c0868a
	manage_dirs_pattern($1_gconfd_t,$1_gconf_tmp_t,$1_gconf_tmp_t)
Chris PeBenito c0868a
	manage_files_pattern($1_gconfd_t,$1_gconf_tmp_t,$1_gconf_tmp_t)
Chris PeBenito 002190
	userdom_user_tmp_filetrans($1,$1_gconfd_t,$1_gconf_tmp_t,{ dir file })
Chris PeBenito 002190
Chris PeBenito 002190
	domain_auto_trans($2, gconfd_exec_t, $1_gconfd_t)
Chris PeBenito 002190
	allow $1_gconfd_t $2:fd use;
Chris PeBenito 002190
	allow $1_gconfd_t $2:fifo_file write;
Chris PeBenito 002190
	allow $1_gconfd_t $2:unix_stream_socket connectto;
Chris PeBenito 002190
Chris PeBenito 002190
	allow $1_gconfd_t gconf_etc_t:dir list_dir_perms;
Chris PeBenito c0868a
	read_files_pattern($1_gconfd_t,gconf_etc_t,gconf_etc_t)
Chris PeBenito 002190
Chris PeBenito 6b19be
	ps_process_pattern($2,$1_gconfd_t)
Chris PeBenito 6b19be
Chris PeBenito 002190
	dev_read_urand($1_gconfd_t)
Chris PeBenito 002190
Chris PeBenito 002190
	files_read_etc_files($1_gconfd_t)
Chris PeBenito 002190
Chris PeBenito 002190
	libs_use_ld_so($1_gconfd_t)
Chris PeBenito 002190
	libs_use_shared_libs($1_gconfd_t)
Chris PeBenito 002190
Chris PeBenito 002190
	miscfiles_read_localization($1_gconfd_t)
Chris PeBenito 002190
Chris PeBenito 002190
	logging_send_syslog_msg($1_gconfd_t)
Chris PeBenito 002190
Chris PeBenito 002190
	userdom_manage_user_tmp_sockets($1, $1_gconfd_t)
Chris PeBenito 002190
	userdom_manage_user_tmp_dirs($1,$1_gconfd_t)
Chris PeBenito 002190
	userdom_tmp_filetrans_user_tmp($1,$1_gconfd_t,dir)
Chris PeBenito 002190
Chris PeBenito 002190
	gnome_stream_connect_gconf_template($1,$2)
Chris PeBenito 002190
Chris PeBenito 002190
	optional_policy(`
Chris PeBenito 002190
		nscd_dontaudit_search_pid($1_gconfd_t)
Chris PeBenito 002190
	')
Chris PeBenito 002190
Chris PeBenito 002190
	optional_policy(`
Chris PeBenito 002190
		xserver_use_xdm_fds($1_gconfd_t)
Chris PeBenito 002190
		xserver_rw_xdm_pipes($1_gconfd_t)
Chris PeBenito 002190
	')
Chris PeBenito 002190
')
Chris PeBenito 002190
	
Chris PeBenito 002190
########################################
Chris PeBenito 002190
## <summary>
Chris PeBenito 002190
##	gconf connection template.
Chris PeBenito 002190
## </summary>
Chris PeBenito 002190
## <param name="userdomain_prefix">
Chris PeBenito 002190
##	<summary>
Chris PeBenito 002190
##	The prefix of the user domain (e.g., user
Chris PeBenito 002190
##	is the prefix for user_t).
Chris PeBenito 002190
##	</summary>
Chris PeBenito 002190
## </param>
Chris PeBenito 002190
## <param name="user_domain">
Chris PeBenito 002190
##	<summary>
Chris PeBenito 002190
##	The type of the user domain.
Chris PeBenito 002190
##	</summary>
Chris PeBenito 002190
## </param>
Chris PeBenito 002190
#
Chris PeBenito 002190
template(`gnome_stream_connect_gconf_template',`
Chris PeBenito 002190
	gen_require(`
Chris PeBenito 002190
		type $1_gconfd_t;
Chris PeBenito 002190
		type $1_gconf_tmp_t;
Chris PeBenito 002190
	')
Chris PeBenito 002190
Chris PeBenito 6b19be
	read_files_pattern($2,$1_gconf_tmp_t,$1_gconf_tmp_t)
Chris PeBenito 002190
	allow $2 $1_gconfd_t:unix_stream_socket connectto;
Chris PeBenito 6b19be
')
Chris PeBenito 6b19be
Chris PeBenito 6b19be
########################################
Chris PeBenito 6b19be
## <summary>
Chris PeBenito 6b19be
##	Run gconfd in the role-specific gconfd domain.
Chris PeBenito 6b19be
## </summary>
Chris PeBenito 6b19be
## <desc>
Chris PeBenito 6b19be
##	

Chris PeBenito 6b19be
##	Run gconfd in the role-specfic gconfd 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(`gnome_domtrans_user_gconf',`
Chris PeBenito 6b19be
	gen_require(`
Chris PeBenito 6b19be
		type $1_gconfd_t, gconfd_exec_t;
Chris PeBenito 6b19be
	')
Chris PeBenito 6b19be
Chris PeBenito 6b19be
	domtrans_pattern($2,gconfd_exec_t,$1_gconfd_t)
Chris PeBenito 6b19be
')
Chris PeBenito 6b19be
Chris PeBenito 6b19be
########################################
Chris PeBenito 6b19be
## <summary>
Chris PeBenito 6b19be
##	manage gnome homedir content (.config)
Chris PeBenito 6b19be
## </summary>
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="user_domain">
Chris PeBenito 6b19be
##	<summary>
Chris PeBenito 6b19be
##	The type of the user domain.
Chris PeBenito 6b19be
##	</summary>
Chris PeBenito 6b19be
## </param>
Chris PeBenito 6b19be
#
Chris PeBenito 6b19be
template(`gnome_manage_user_gnome_config',`
Chris PeBenito 6b19be
	gen_require(`
Chris PeBenito 6b19be
		type $1_gnome_home_t;
Chris PeBenito 6b19be
	')
Chris PeBenito 6b19be
Chris PeBenito 6b19be
	allow $2 $1_gnome_home_t:dir manage_dir_perms;
Chris PeBenito 6b19be
	allow $2 $1_gnome_home_t:file manage_file_perms;
Chris PeBenito 002190
')