Chris PeBenito 9401ae1
## <summary>Thunderbird email client</summary>
Chris PeBenito 9401ae1
Chris PeBenito 9401ae1
########################################
Chris PeBenito 9401ae1
## <summary>
Chris PeBenito 9401ae1
##	Role access for thunderbird
Chris PeBenito 9401ae1
## </summary>
Chris PeBenito 9401ae1
## <param name="role">
Chris PeBenito 9401ae1
##	<summary>
Chris PeBenito 9401ae1
##	Role allowed access
Chris PeBenito 9401ae1
##	</summary>
Chris PeBenito 9401ae1
## </param>
Chris PeBenito 9401ae1
## <param name="domain">
Chris PeBenito 9401ae1
##	<summary>
Chris PeBenito 9401ae1
##	User domain for the role
Chris PeBenito 9401ae1
##	</summary>
Chris PeBenito 9401ae1
## </param>
Chris PeBenito 9401ae1
#
Chris PeBenito 9401ae1
interface(`thunderbird_role',`
Chris PeBenito 9401ae1
	gen_require(`
Chris PeBenito 9401ae1
		type thunderbird_t, thunderbird_exec_t;
Chris PeBenito 9401ae1
		type thunderbird_home_t, thunderbird_tmpfs_t;
Chris PeBenito 9401ae1
	')
Chris PeBenito 9401ae1
Chris PeBenito 9401ae1
	role $1 types thunderbird_t;
Chris PeBenito 9401ae1
Chris PeBenito 9401ae1
	domain_auto_trans($2, thunderbird_exec_t, thunderbird_t)
Chris PeBenito 9401ae1
	allow $2 thunderbird_t:fd use;
Chris PeBenito 9401ae1
	allow $2 thunderbird_t:shm { associate getattr };
Chris PeBenito 9401ae1
	allow $2 thunderbird_t:unix_stream_socket connectto;
Chris PeBenito 9401ae1
	allow thunderbird_t $2:fd use;
Chris PeBenito 9401ae1
	allow thunderbird_t $2:process sigchld;
Chris PeBenito 9401ae1
	allow thunderbird_t $2:unix_stream_socket connectto;
Chris PeBenito 9401ae1
Chris PeBenito 9401ae1
	# allow ps to show thunderbird and allow the user to kill it 
Chris PeBenito 9401ae1
	ps_process_pattern($2, thunderbird_t)
Chris PeBenito 9401ae1
	allow $2 thunderbird_t:process signal;
Chris PeBenito 9401ae1
Chris PeBenito 9401ae1
	# Access ~/.thunderbird
Chris PeBenito 9401ae1
	manage_dirs_pattern($2, thunderbird_home_t, thunderbird_home_t)
Chris PeBenito 9401ae1
	manage_files_pattern($2, thunderbird_home_t, thunderbird_home_t)
Chris PeBenito 9401ae1
	manage_lnk_files_pattern($2, thunderbird_home_t, thunderbird_home_t)
Chris PeBenito 9401ae1
	relabel_dirs_pattern($2, thunderbird_home_t, thunderbird_home_t)
Chris PeBenito 9401ae1
	relabel_files_pattern($2, thunderbird_home_t, thunderbird_home_t)
Chris PeBenito 9401ae1
	relabel_lnk_files_pattern($2, thunderbird_home_t, thunderbird_home_t)
Chris PeBenito 9401ae1
')
Chris PeBenito 9401ae1
Chris PeBenito 9401ae1
########################################
Chris PeBenito 9401ae1
## <summary>
Chris PeBenito 9401ae1
##	Run thunderbird in the user thunderbird domain.
Chris PeBenito 9401ae1
## </summary>
Chris PeBenito 9401ae1
## <param name="domain">
Chris PeBenito 9401ae1
##	<summary>
Chris PeBenito 9401ae1
##	Domain allowed to transition.
Chris PeBenito 9401ae1
##	</summary>
Chris PeBenito 9401ae1
## </param>
Chris PeBenito 9401ae1
#
Chris PeBenito 9401ae1
interface(`thunderbird_domtrans',`
Chris PeBenito 9401ae1
	gen_require(`
Chris PeBenito 9401ae1
		type thunderbird_t, thunderbird_exec_t;
Chris PeBenito 9401ae1
	')
Chris PeBenito 9401ae1
Chris PeBenito 9401ae1
	domtrans_pattern($1, thunderbird_exec_t, thunderbird_t)
Chris PeBenito 9401ae1
')