1ec3d1a
## <summary>Andrew Filesystem server</summary>
1ec3d1a
1ec3d1a
########################################
1ec3d1a
## <summary>
1ec3d1a
##	Execute a domain transition to run the
1ec3d1a
##	afs client.
1ec3d1a
## </summary>
1ec3d1a
## <param name="domain">
1ec3d1a
## <summary>
1ec3d1a
##	Domain allowed to transition.
1ec3d1a
## </summary>
1ec3d1a
## </param>
1ec3d1a
#
1ec3d1a
interface(`afs_domtrans',`
1ec3d1a
	gen_require(`
1ec3d1a
		type afs_t, afs_exec_t;
1ec3d1a
	')
1ec3d1a
1ec3d1a
	corecmd_search_bin($1)
1ec3d1a
	domtrans_pattern($1, afs_exec_t, afs_t)
1ec3d1a
')
1ec3d1a
1ec3d1a
########################################
1ec3d1a
## <summary>
1ec3d1a
##	Read and write afs client UDP sockets.
1ec3d1a
## </summary>
1ec3d1a
## <param name="domain">
1ec3d1a
##	<summary>
1ec3d1a
##	Domain allowed access.
1ec3d1a
##	</summary>
1ec3d1a
## </param>
1ec3d1a
#
1ec3d1a
interface(`afs_rw_udp_sockets',`
1ec3d1a
	gen_require(`
1ec3d1a
		type afs_t;
1ec3d1a
	')
1ec3d1a
1ec3d1a
	allow $1 afs_t:udp_socket { read write };
1ec3d1a
')
1ec3d1a
1ec3d1a
########################################
1ec3d1a
## <summary>
1ec3d1a
##	read/write afs cache files
1ec3d1a
## </summary>
1ec3d1a
## <param name="domain">
1ec3d1a
## <summary>
1ec3d1a
##	Domain allowed access.
1ec3d1a
## </summary>
1ec3d1a
## </param>
1ec3d1a
#
1ec3d1a
interface(`afs_rw_cache',`
1ec3d1a
	gen_require(`
1ec3d1a
		type afs_cache_t;
1ec3d1a
	')
1ec3d1a
1ec3d1a
	files_search_var($1)
1ec3d1a
	allow $1 afs_cache_t:file { read write };
1ec3d1a
')
1ec3d1a
1ec3d1a
########################################
1ec3d1a
## <summary>
1ec3d1a
##	Execute afs server in the afs domain.
1ec3d1a
## </summary>
1ec3d1a
## <param name="domain">
1ec3d1a
##	<summary>
1ec3d1a
##	Domain allowed to transition.
1ec3d1a
##	</summary>
1ec3d1a
## </param>
1ec3d1a
#
1ec3d1a
interface(`afs_initrc_domtrans',`
1ec3d1a
	gen_require(`
1ec3d1a
		type afs_initrc_exec_t;
1ec3d1a
	')
1ec3d1a
1ec3d1a
	init_labeled_script_domtrans($1, afs_initrc_exec_t)
1ec3d1a
')
1ec3d1a
1ec3d1a
########################################
1ec3d1a
## <summary>
1ec3d1a
##	All of the rules required to administrate 
1ec3d1a
##	an afs environment
1ec3d1a
## </summary>
1ec3d1a
## <param name="domain">
1ec3d1a
##	<summary>
1ec3d1a
##	Domain allowed access.
1ec3d1a
##	</summary>
1ec3d1a
## </param>
1ec3d1a
## <param name="role">
1ec3d1a
##	<summary>
1ec3d1a
##	The role to be allowed to manage the afs domain.
1ec3d1a
##	</summary>
1ec3d1a
## </param>
1ec3d1a
## <rolecap/>
1ec3d1a
#
1ec3d1a
interface(`afs_admin',`
1ec3d1a
	gen_require(`
1ec3d1a
		type afs_t, afs_initrc_exec_t;
1ec3d1a
	')
1ec3d1a
1ec3d1a
	allow $1 afs_t:process signal_perms;
1ec3d1a
	ps_process_pattern($1, afs_t)
1ec3d1a
1ec3d1a
	tunable_policy(`deny_ptrace',`',`
1ec3d1a
		allow $1 afs_t:process ptrace;
1ec3d1a
	')
1ec3d1a
1ec3d1a
	# Allow afs_admin to restart the afs service
1ec3d1a
	afs_initrc_domtrans($1)
1ec3d1a
	domain_system_change_exemption($1)
1ec3d1a
	role_transition $2 afs_initrc_exec_t system_r;
1ec3d1a
	allow $2 system_r;
1ec3d1a
1ec3d1a
')