Chris PeBenito 4483ee
## <summary>Advanced power management daemon</summary>
Chris PeBenito 4483ee
Chris PeBenito 4483ee
########################################
Chris PeBenito 4483ee
## <summary>
Chris PeBenito 4483ee
##	Execute APM in the apm domain.
Chris PeBenito 4483ee
## </summary>
Chris PeBenito 4483ee
## <param name="domain">
Chris PeBenito 4483ee
##	Domain allowed access.
Chris PeBenito 4483ee
## </param>
Chris PeBenito 4483ee
#
Chris PeBenito 4483ee
interface(`apm_domtrans_client',`
Chris PeBenito 4483ee
	gen_require(`
Chris PeBenito 4483ee
		type apm_t, apm_exec_t;
Chris PeBenito 4483ee
	')
Chris PeBenito 4483ee
Chris PeBenito 4483ee
	corecmd_search_bin($1)
Chris PeBenito 4483ee
	domain_auto_trans($1,apm_exec_t,apm_t)
Chris PeBenito 4483ee
Chris PeBenito 4483ee
	allow $1 apm_t:fd use;
Chris PeBenito 4483ee
	allow apm_t $1:fd use;
Chris PeBenito 4483ee
	allow apm_t $1:fifo_file rw_file_perms;
Chris PeBenito 4483ee
	allow apm_t $1:process sigchld;
Chris PeBenito 4483ee
')
Chris PeBenito 4483ee
Chris PeBenito 4483ee
########################################
Chris PeBenito 4483ee
## <summary>
Chris PeBenito 4483ee
##	Use file descriptors for apmd.
Chris PeBenito 4483ee
## </summary>
Chris PeBenito 4483ee
## <param name="domain">
Chris PeBenito 4483ee
##	The type of the process performing this action.
Chris PeBenito 4483ee
## </param>
Chris PeBenito 4483ee
#
Chris PeBenito 4483ee
interface(`apm_use_fd',`
Chris PeBenito 4483ee
	gen_require(`
Chris PeBenito 4483ee
		type apmd_t;
Chris PeBenito 4483ee
	')
Chris PeBenito 4483ee
Chris PeBenito 4483ee
	allow $1 apmd_t:fd use; 
Chris PeBenito 4483ee
')
Chris PeBenito 4483ee
Chris PeBenito 4483ee
########################################
Chris PeBenito 4483ee
## <summary>
Chris PeBenito 4483ee
##	Write to apmd unnamed pipes.
Chris PeBenito 4483ee
## </summary>
Chris PeBenito 4483ee
## <param name="domain">
Chris PeBenito 4483ee
##	The type of the process performing this action.
Chris PeBenito 4483ee
## </param>
Chris PeBenito 4483ee
#
Chris PeBenito 4483ee
interface(`apm_write_pipe',`
Chris PeBenito 4483ee
	gen_require(`
Chris PeBenito 4483ee
		type apmd_t;
Chris PeBenito 4483ee
	')
Chris PeBenito 4483ee
Chris PeBenito 4483ee
	allow $1 apmd_t:fifo_file write; 
Chris PeBenito 4483ee
')
Chris PeBenito 4483ee
Chris PeBenito 4483ee
########################################
Chris PeBenito 4483ee
## <summary>
Chris PeBenito 4483ee
##	Read and write to an apm unix stream socket.
Chris PeBenito 4483ee
## </summary>
Chris PeBenito 4483ee
## <param name="domain">
Chris PeBenito 4483ee
##	Domain allowed access.
Chris PeBenito 4483ee
## </param>
Chris PeBenito 4483ee
#
Chris PeBenito 4483ee
interface(`apm_rw_stream_socket',`
Chris PeBenito 4483ee
	gen_require(`
Chris PeBenito 4483ee
		type apmd_t;
Chris PeBenito 4483ee
	')
Chris PeBenito 4483ee
Chris PeBenito 4483ee
	allow $1 apmd_t:unix_stream_socket { read write };
Chris PeBenito 4483ee
')
Chris PeBenito 4483ee
Chris PeBenito 4483ee
########################################
Chris PeBenito 4483ee
## <summary>
Chris PeBenito 4483ee
##	Append to apm's log file.
Chris PeBenito 4483ee
## </summary>
Chris PeBenito 4483ee
## <param name="domain">
Chris PeBenito 4483ee
##	Domain allowed access.
Chris PeBenito 4483ee
## </param>
Chris PeBenito 4483ee
#
Chris PeBenito 4483ee
interface(`apm_append_log',`
Chris PeBenito 4483ee
	gen_require(`
Chris PeBenito 4483ee
		type apmd_log_t;
Chris PeBenito 4483ee
	')
Chris PeBenito 4483ee
Chris PeBenito 4483ee
	logging_search_logs($1)
Chris PeBenito 4483ee
	allow $1 apmd_log_t:file append;
Chris PeBenito 4483ee
')