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