## <summary>Bugtracker.</summary>

########################################
## <summary>
##	Search bugzilla directories.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`bugzilla_search_content',`
	gen_require(`
		type bugzilla_content_t;
	')

	allow $1 bugzilla_content_t:dir search_dir_perms;
')

########################################
## <summary>
##	Do not audit attempts to read and
##	write bugzilla script unix domain
##	stream sockets.
## </summary>
## <param name="domain">
##	<summary>
##	Domain to not audit.
##	</summary>
## </param>
#
interface(`bugzilla_dontaudit_rw_stream_sockets',`
	gen_require(`
		type bugzilla_script_t;
	')

	dontaudit $1 bugzilla_script_t:unix_stream_socket { read write };
')

########################################
## <summary>
##	All of the rules required to
##	administrate an bugzilla environment.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`bugzilla_admin',`
	gen_require(`
		type bugzilla_script_t, bugzilla_content_t, bugzilla_ra_content_t;
		type bugzilla_rw_content_t, bugzilla_script_exec_t;
		type bugzilla_htaccess_t, bugzilla_tmp_t;
	')

	allow $1 bugzilla_script_t:process signal_perms;
	ps_process_pattern($1, bugzilla_script_t)

	tunable_policy(`deny_ptrace',`',`
		allow $1 bugzilla_script_t:process ptrace;
	')

	files_list_tmp($1)
	admin_pattern($1, bugzilla_tmp_t)

	files_list_var_lib(bugzilla_script_t)

	admin_pattern($1, bugzilla_script_exec_t)
	admin_pattern($1, bugzilla_script_t)
	admin_pattern($1, bugzilla_content_t)
	admin_pattern($1, bugzilla_htaccess_t)
	admin_pattern($1, bugzilla_ra_content_t)

	files_search_tmp($1)
	files_search_var_lib($1)
	admin_pattern($1, bugzilla_rw_content_t)

	optional_policy(`
		apache_list_sys_content($1)
	')
')
