Chris PeBenito 17de1b
## <summary>Dynamic host configuration protocol (DHCP) server</summary>
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Dominick Grift 1031ee
##	Transition to dhcpd.
Dominick Grift 1031ee
## </summary>
Dominick Grift 1031ee
## <param name="domain">
Dominick Grift 1031ee
##	<summary>
Dominick Grift 288845
##	Domain allowed to transition.
Dominick Grift 1031ee
##	</summary>
Dominick Grift 1031ee
## </param>
Dominick Grift 1031ee
#
Dominick Grift 1031ee
interface(`dhcpd_domtrans',`
Dominick Grift 1031ee
	gen_require(`
Dominick Grift 1031ee
		type dhcpd_t, dhcpd_exec_t;
Dominick Grift 1031ee
	')
Dominick Grift 1031ee
Dominick Grift 1031ee
	corecmd_search_bin($1)
Dominick Grift 1031ee
	domtrans_pattern($1, dhcpd_exec_t, dhcpd_t)
Dominick Grift 1031ee
')
Dominick Grift 1031ee
Dominick Grift 1031ee
########################################
Dominick Grift 1031ee
## <summary>
Chris PeBenito 17de1b
##	Set the attributes of the DCHP
Chris PeBenito 17de1b
##	server state files.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`dhcpd_setattr_state_files',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type dhcpd_state_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	sysnet_search_dhcp_state($1)
Dominick Grift 9fa4de
	allow $1 dhcpd_state_t:file setattr_file_perms;
Chris PeBenito 17de1b
')
Chris PeBenito 659c86
Chris PeBenito 659c86
########################################
Chris PeBenito 659c86
## <summary>
Chris PeBenito 93d300
##	Execute dhcp server in the dhcp domain.
Chris PeBenito 93d300
## </summary>
Chris PeBenito 93d300
## <param name="domain">
Chris PeBenito 93d300
##	<summary>
Dominick Grift 288845
##	Domain allowed to transition.
Chris PeBenito 93d300
##	</summary>
Chris PeBenito 93d300
## </param>
Chris PeBenito 93d300
#
Chris PeBenito 93d300
#
Chris PeBenito 93d300
interface(`dhcpd_initrc_domtrans',`
Chris PeBenito 93d300
	gen_require(`
Chris PeBenito 93d300
		type dhcpd_initrc_exec_t;
Chris PeBenito 93d300
	')
Chris PeBenito 93d300
Chris PeBenito 93d300
	init_labeled_script_domtrans($1, dhcpd_initrc_exec_t)
Chris PeBenito 93d300
')
Chris PeBenito 93d300
Chris PeBenito 93d300
########################################
Chris PeBenito 93d300
## <summary>
Chris PeBenito 659c86
##	All of the rules required to administrate 
Chris PeBenito 659c86
##	an dhcp environment
Chris PeBenito 659c86
## </summary>
Chris PeBenito 659c86
## <param name="domain">
Chris PeBenito 659c86
##	<summary>
Chris PeBenito 659c86
##	Domain allowed access.
Chris PeBenito 659c86
##	</summary>
Chris PeBenito 659c86
## </param>
Chris PeBenito 659c86
## <param name="role">
Chris PeBenito 659c86
##	<summary>
Chris PeBenito 659c86
##	The role to be allowed to manage the dhcp domain.
Chris PeBenito 659c86
##	</summary>
Chris PeBenito 659c86
## </param>
Chris PeBenito 659c86
## <rolecap/>
Chris PeBenito 659c86
#
Chris PeBenito 659c86
interface(`dhcpd_admin',`
Chris PeBenito 659c86
	gen_require(`
Dominick Grift cf152b
		type dhcpd_t, dhcpd_tmp_t, dhcpd_state_t;
Chris PeBenito 659c86
		type dhcpd_var_run_t, dhcpd_initrc_exec_t;
Chris PeBenito 659c86
	')
Chris PeBenito 659c86
Chris PeBenito 659c86
	allow $1 dhcpd_t:process { ptrace signal_perms };
Chris PeBenito 659c86
	ps_process_pattern($1, dhcpd_t)
Chris PeBenito 659c86
Chris PeBenito 659c86
	init_labeled_script_domtrans($1, dhcpd_initrc_exec_t)
Chris PeBenito 659c86
	domain_system_change_exemption($1)
Chris PeBenito 659c86
	role_transition $2 dhcpd_initrc_exec_t system_r;
Chris PeBenito 659c86
	allow $2 system_r;
Chris PeBenito 659c86
Chris PeBenito 659c86
	files_list_tmp($1)
Chris PeBenito 659c86
	admin_pattern($1, dhcpd_tmp_t)
Chris PeBenito 659c86
Chris PeBenito 659c86
	admin_pattern($1, dhcpd_state_t)
Chris PeBenito 659c86
Chris PeBenito 659c86
	files_list_pids($1)
Chris PeBenito 659c86
	admin_pattern($1, dhcpd_var_run_t)
Chris PeBenito 659c86
')