3eaa993
3eaa993
## <summary>Telepathy framework.</summary>
3eaa993
3eaa993
#######################################
3eaa993
## <summary>
3eaa993
##  Creates basic types for telepathy
3eaa993
##  domain
3eaa993
## </summary>
3eaa993
## <param name="prefix">
3eaa993
##  <summary>
3eaa993
##  Prefix for the domain.
3eaa993
##  </summary>
3eaa993
## </param>
3eaa993
#
3eaa993
#
3eaa993
template(`telepathy_domain_template',`
3eaa993
3eaa993
	gen_require(`
3eaa993
		attribute telepathy_domain;
3eaa993
		attribute telepathy_executable;
3eaa993
	')
3eaa993
3eaa993
	type telepathy_$1_t, telepathy_domain;
3eaa993
	type telepathy_$1_exec_t, telepathy_executable;
3eaa993
	application_domain(telepathy_$1_t, telepathy_$1_exec_t)
3eaa993
	ubac_constrained(telepathy_$1_t)
3eaa993
3eaa993
	type telepathy_$1_tmp_t;
3eaa993
	files_tmp_file(telepathy_$1_tmp_t)
3eaa993
	ubac_constrained(telepathy_$1_tmp_t)
3eaa993
7ed755a
	dbus_session_domain(telepathy_$1_t, telepathy_$1_exec_t)
3eaa993
')
3eaa993
3eaa993
#######################################
3eaa993
## <summary>
3eaa993
##  	Role access for telepathy domains
3eaa993
###     that executes via dbus-session
3eaa993
## </summary>
3eaa993
## <param name="user_role">
3eaa993
##	<summary>
3eaa993
##	The role associated with the user domain.
3eaa993
##	</summary>
3eaa993
## </param>
3eaa993
## <param name="user_domain">
3eaa993
##	<summary>
3eaa993
##	The type of the user domain.
3eaa993
##	</summary>
3eaa993
## </param>
3eaa993
#
3eaa993
template(`telepathy_dbus_session_role', `
3eaa993
	gen_require(`
3eaa993
		attribute telepathy_domain;
3eaa993
	')
3eaa993
3eaa993
        role $1 types telepathy_domain;
3eaa993
3eaa993
	allow $2 telepathy_domain:process { ptrace signal_perms };
3eaa993
	ps_process_pattern($2, telepathy_domain)
3eaa993
3eaa993
	optional_policy(`
3eaa993
		telepathy_dbus_chat($2)
3eaa993
	')
3eaa993
3eaa993
	telepathy_gabble_stream_connect($2)
3eaa993
	telepathy_msn_stream_connect($2)
3eaa993
	telepathy_salut_stream_connect($2)	
3eaa993
')
3eaa993
3eaa993
########################################
3eaa993
## <summary>
3eaa993
##	Send DBus messages to and from
3eaa993
##	all Telepathy domain.
3eaa993
## </summary>
3eaa993
## <param name="domain">
3eaa993
## 	<summary>
3eaa993
##	Domain allowed access.
3eaa993
##	</summary>
3eaa993
## </param>
3eaa993
#
3eaa993
interface(`telepathy_dbus_chat', `
3eaa993
	gen_require(`
3eaa993
		attribute telepathy_domain;
3eaa993
		class dbus send_msg;
3eaa993
	')
3eaa993
3eaa993
	allow $1 telepathy_domain:dbus send_msg;
3eaa993
	allow telepathy_domain $1:dbus send_msg;
3eaa993
')
3eaa993
3eaa993
########################################
3eaa993
## <summary>
3eaa993
##	Send DBus messages to and from
3eaa993
##	Telepathy Gabble.
3eaa993
## </summary>
3eaa993
## <param name="domain">
3eaa993
## 	<summary>
3eaa993
##	Domain allowed access.
3eaa993
##	</summary>
3eaa993
## </param>
3eaa993
#
3eaa993
interface(`telepathy_gabble_dbus_chat', `
3eaa993
	gen_require(`
3eaa993
		type telepathy_gabble_t;
3eaa993
		class dbus send_msg;
3eaa993
	')
3eaa993
3eaa993
	allow $1 telepathy_gabble_t:dbus send_msg;
3eaa993
	allow telepathy_gabble_t $1:dbus send_msg;
3eaa993
')
3eaa993
3eaa993
########################################
3eaa993
## <summary>
3eaa993
##	Read and write Telepathy Butterfly
3eaa993
##	temporary files.
3eaa993
## </summary>
3eaa993
## <param name="domain">
3eaa993
## 	<summary>
3eaa993
##	Domain allowed access.
3eaa993
##	</summary>
3eaa993
## </param>
3eaa993
#
3eaa993
interface(`telepathy_butterfly_rw_tmp_files', `
3eaa993
	gen_require(`
3eaa993
		type telepathy_butterfly_tmp_t;
3eaa993
	')
3eaa993
3eaa993
	allow $1 telepathy_butterfly_tmp_t:file rw_file_perms;
3eaa993
	files_search_tmp($1)
3eaa993
')
3eaa993
3eaa993
########################################
3eaa993
## <summary>
3eaa993
##	Stream connect to Telepathy Gabble
3eaa993
## </summary>
3eaa993
## <param name="domain">
3eaa993
## 	<summary>
3eaa993
##	Domain allowed access.
3eaa993
##	</summary>
3eaa993
## </param>
3eaa993
#
3eaa993
interface(`telepathy_gabble_stream_connect', `
3eaa993
	gen_require(`
3eaa993
		type telepathy_gabble_t, telepathy_gabble_tmp_t;
3eaa993
	')
3eaa993
3eaa993
	stream_connect_pattern($1, telepathy_gabble_tmp_t, telepathy_gabble_tmp_t, telepathy_gabble_t)
3eaa993
	files_search_tmp($1)
3eaa993
')
3eaa993
3eaa993
#######################################
3eaa993
## <summary>
3eaa993
##      Stream connect to telepathy MSN managers
3eaa993
## </summary>
3eaa993
## <param name="domain">
3eaa993
##      <summary>
3eaa993
##      Domain allowed access.
3eaa993
##      </summary>
3eaa993
## </param>
3eaa993
#
3eaa993
interface(`telepathy_msn_stream_connect', `
3eaa993
        gen_require(`
3eaa993
                type telepathy_msn_t, telepathy_msn_tmp_t;
3eaa993
        ')
3eaa993
3eaa993
        stream_connect_pattern($1, telepathy_msn_tmp_t, telepathy_msn_tmp_t, telepathy_msn_t)
3eaa993
        files_search_tmp($1)
3eaa993
')
3eaa993
3eaa993
3eaa993
########################################
3eaa993
## <summary>
3eaa993
##	Stream connect to Telepathy Salut
3eaa993
## </summary>
3eaa993
## <param name="domain">
3eaa993
## 	<summary>
3eaa993
##	Domain allowed access.
3eaa993
##	</summary>
3eaa993
## </param>
3eaa993
#
3eaa993
interface(`telepathy_salut_stream_connect', `
3eaa993
	gen_require(`
3eaa993
		type telepathy_salut_t, telepathy_salut_tmp_t;
3eaa993
	')
3eaa993
3eaa993
	stream_connect_pattern($1, telepathy_salut_tmp_t, telepathy_salut_tmp_t, telepathy_salut_t)
3eaa993
	files_search_tmp($1)
3eaa993
')