Dan Walsh 3eaa99
## <summary>policy for zarafa services</summary>
Dan Walsh 3eaa99
Dan Walsh 3eaa99
######################################
Dan Walsh 3eaa99
## <summary>
Dominick Grift 2d102f
##	Creates types and rules for a basic
Dominick Grift 2d102f
##	zararfa init daemon domain.
Dan Walsh 3eaa99
## </summary>
Dan Walsh 3eaa99
## <param name="prefix">
Dominick Grift 2d102f
##	<summary>
Dominick Grift 2d102f
##	Prefix for the domain.
Dominick Grift 2d102f
##	</summary>
Dan Walsh 3eaa99
## </param>
Dan Walsh 3eaa99
#
Dan Walsh 3eaa99
template(`zarafa_domain_template',`
Dan Walsh 3eaa99
	gen_require(`
Dan Walsh 3eaa99
		attribute zarafa_domain;
Dan Walsh 3eaa99
	')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	##############################
Dominick Grift 2d102f
	#
Dominick Grift 2d102f
	# $1_t declarations
Dominick Grift 2d102f
	#
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	type zarafa_$1_t, zarafa_domain;
Dominick Grift 2d102f
	type zarafa_$1_exec_t;
Dan Walsh 3eaa99
	init_daemon_domain(zarafa_$1_t, zarafa_$1_exec_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	type zarafa_$1_log_t;
Dan Walsh 3eaa99
	logging_log_file(zarafa_$1_log_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	type zarafa_$1_var_run_t;
Dan Walsh 3eaa99
	files_pid_file(zarafa_$1_var_run_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	##############################
Dominick Grift 2d102f
	#
Dan Walsh 3eaa99
	# $1_t local policy
Dominick Grift 2d102f
	#
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	manage_files_pattern(zarafa_$1_t, zarafa_$1_var_run_t, zarafa_$1_var_run_t)
Dominick Grift 2d102f
	manage_sock_files_pattern(zarafa_$1_t, zarafa_$1_var_run_t, zarafa_$1_var_run_t)
Dominick Grift 2d102f
	files_pid_filetrans(zarafa_$1_t, zarafa_$1_var_run_t, { file sock_file })
Dan Walsh 3eaa99
	#stream_connect_pattern(zarafa_$1_t, $1_var_run_t, $1_var_run_t, virtd_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	manage_files_pattern(zarafa_$1_t, zarafa_$1_log_t,zarafa_$1_log_t)
Dan Walsh 3eaa99
	#manage_sock_files_pattern(zarafa_$1_t, zarafa_$1_log_t,zarafa_$1_log_t)
Dan Walsh 3eaa99
	logging_log_filetrans(zarafa_$1_t,zarafa_$1_log_t,{ file })
Dominick Grift 2d102f
')
Dominick Grift 2d102f
Dan Walsh 3eaa99
########################################
Dan Walsh 3eaa99
## <summary>
Dan Walsh 3eaa99
##	Execute a domain transition to run zarafa_server.
Dan Walsh 3eaa99
## </summary>
Dan Walsh 3eaa99
## <param name="domain">
Dominick Grift 2d102f
##	<summary>
Dan Walsh 3eaa99
##	Domain allowed to transition.
Dominick Grift 2d102f
##	</summary>
Dan Walsh 3eaa99
## </param>
Dan Walsh 3eaa99
#
Dan Walsh 3eaa99
interface(`zarafa_server_domtrans',`
Dan Walsh 3eaa99
	gen_require(`
Dan Walsh 3eaa99
		type zarafa_server_t, zarafa_server_exec_t;
Dan Walsh 3eaa99
	')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	domtrans_pattern($1, zarafa_server_exec_t, zarafa_server_t)
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
########################################
Dan Walsh 3eaa99
## <summary>
Dan Walsh 3eaa99
##	Execute a domain transition to run zarafa_deliver.
Dan Walsh 3eaa99
## </summary>
Dan Walsh 3eaa99
## <param name="domain">
Dominick Grift 2d102f
##	<summary>
Dan Walsh 3eaa99
##	Domain allowed to transition.
Dominick Grift 2d102f
##	</summary>
Dan Walsh 3eaa99
## </param>
Dan Walsh 3eaa99
#
Dan Walsh 3eaa99
interface(`zarafa_deliver_domtrans',`
Dan Walsh 3eaa99
	gen_require(`
Dan Walsh 3eaa99
		type zarafa_deliver_t, zarafa_deliver_exec_t;
Dan Walsh 3eaa99
	')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	domtrans_pattern($1, zarafa_deliver_exec_t, zarafa_deliver_t)
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
#######################################
Dan Walsh 3eaa99
## <summary>
Dominick Grift 2d102f
##	Connect to zarafa-server unix domain stream socket.
Dan Walsh 3eaa99
## </summary>
Dan Walsh 3eaa99
## <param name="domain">
Dominick Grift 2d102f
##	<summary>
Dominick Grift 2d102f
##	Domain allowed access.
Dominick Grift 2d102f
##	</summary>
Dan Walsh 3eaa99
## </param>
Dan Walsh 3eaa99
#
Dan Walsh 3eaa99
interface(`zarafa_stream_connect_server',`
Dominick Grift 2d102f
	gen_require(`
Dominick Grift 2d102f
		type zarafa_server_t, zarafa_server_var_run_t;
Dominick Grift 2d102f
	')
Dan Walsh 3eaa99
Dominick Grift f92662
	files_search_var_lib($1)
Dominick Grift 2d102f
	stream_connect_pattern($1, zarafa_server_t, zarafa_server_var_run_t, zarafa_server_t)
Dan Walsh 3eaa99
')