Chris PeBenito 17de1b
## <summary>Common UNIX printing system</summary>
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 8f3bdd
##	Setup cups to transtion to the cups backend domain
Chris PeBenito 8f3bdd
## </summary>
Chris PeBenito 8f3bdd
## <param name="domain">
Chris PeBenito 8f3bdd
##	<summary>
Chris PeBenito a72e42
##	Domain allowed access.
Chris PeBenito 8f3bdd
##	</summary>
Chris PeBenito 8f3bdd
## </param>
Chris PeBenito 8f3bdd
#
Chris PeBenito 8f3bdd
interface(`cups_backend',`
Chris PeBenito 8f3bdd
	gen_require(`
Chris PeBenito 8f3bdd
		type cupsd_t;
Chris PeBenito 8f3bdd
	')
Chris PeBenito 8f3bdd
Chris PeBenito 8f3bdd
	domain_type($1)
Chris PeBenito 8f3bdd
	domain_entry_file($1, $2)
Chris PeBenito 8f3bdd
	role system_r types $1;
Chris PeBenito 8f3bdd
Chris PeBenito 8f3bdd
	domtrans_pattern(cupsd_t, $2, $1)
Chris PeBenito 8f3bdd
	allow cupsd_t $1:process signal;
Chris PeBenito 8f3bdd
	allow $1 cupsd_t:unix_stream_socket connected_stream_socket_perms;
Chris PeBenito 8f3bdd
Chris PeBenito 8f3bdd
	cups_read_config($1)
Chris PeBenito 8f3bdd
	cups_append_log($1)
Chris PeBenito 8f3bdd
')
Chris PeBenito 8f3bdd
Chris PeBenito 8f3bdd
########################################
Chris PeBenito 8f3bdd
## <summary>
Chris PeBenito 17de1b
##	Execute cups in the cups domain.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Dominick Grift 288845
##	Domain allowed to transition.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`cups_domtrans',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type cupsd_t, cupsd_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 0bfccd
	domtrans_pattern($1, cupsd_exec_t, cupsd_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Connect to cupsd over an unix domain stream socket.
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(`cups_stream_connect',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type cupsd_t, cupsd_var_run_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_pids($1)
Chris PeBenito 0bfccd
	stream_connect_pattern($1, cupsd_var_run_t, cupsd_var_run_t, cupsd_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 33c7e6
##	Connect to cups over TCP.  (Deprecated)
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(`cups_tcp_connect',`
Chris PeBenito 33c7e6
	refpolicywarn(`$0($*) has been deprecated.')
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Send and receive messages from
Chris PeBenito 17de1b
##	cups over dbus.
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(`cups_dbus_chat',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type cupsd_t;
Chris PeBenito 17de1b
		class dbus send_msg;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $1 cupsd_t:dbus send_msg;
Chris PeBenito 17de1b
	allow cupsd_t $1:dbus send_msg;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito d9845a
##	Read cups PID files.
Chris PeBenito d9845a
## </summary>
Chris PeBenito d9845a
## <param name="domain">
Chris PeBenito d9845a
##	<summary>
Chris PeBenito d9845a
##	Domain allowed access.
Chris PeBenito d9845a
##	</summary>
Chris PeBenito d9845a
## </param>
Chris PeBenito d9845a
#
Chris PeBenito d9845a
interface(`cups_read_pid_files',`
Chris PeBenito d9845a
	gen_require(`
Chris PeBenito d9845a
		type cupsd_var_run_t;
Chris PeBenito d9845a
	')
Chris PeBenito d9845a
Chris PeBenito d9845a
	files_search_pids($1)
Chris PeBenito c0868a
	allow $1 cupsd_var_run_t:file read_file_perms;
Chris PeBenito d9845a
')
Chris PeBenito d9845a
Chris PeBenito d9845a
########################################
Chris PeBenito d9845a
## <summary>
Chris PeBenito 17de1b
##	Execute cups_config in the cups_config domain.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Dominick Grift 288845
##	Domain allowed to transition.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`cups_domtrans_config',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type cupsd_config_t, cupsd_config_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 0bfccd
	domtrans_pattern($1, cupsd_config_exec_t, cupsd_config_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Send generic signals to the cups
Chris PeBenito 17de1b
##	configuration daemon.
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(`cups_signal_config',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type cupsd_config_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $1 cupsd_config_t:process signal;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Send and receive messages from
Chris PeBenito 17de1b
##	cupsd_config over dbus.
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(`cups_dbus_chat_config',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type cupsd_config_t;
Chris PeBenito 17de1b
		class dbus send_msg;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $1 cupsd_config_t:dbus send_msg;
Chris PeBenito 17de1b
	allow cupsd_config_t $1:dbus send_msg;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Read cups configuration 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 bbcd3c
## <rolecap/>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`cups_read_config',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type cupsd_etc_t, cupsd_rw_etc_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_etc($1)
Chris PeBenito 0bfccd
	read_files_pattern($1, cupsd_etc_t, cupsd_etc_t)
Chris PeBenito 0bfccd
	read_files_pattern($1, cupsd_etc_t, cupsd_rw_etc_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Read cups-writable configuration 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 bbcd3c
## <rolecap/>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`cups_read_rw_config',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type cupsd_etc_t, cupsd_rw_etc_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_etc($1)
Chris PeBenito 0bfccd
	read_files_pattern($1, cupsd_etc_t, cupsd_rw_etc_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Read cups log 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 bbcd3c
## <rolecap/>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`cups_read_log',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type cupsd_log_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	logging_search_logs($1)
Chris PeBenito 82d277
	allow $1 cupsd_log_t:file read_file_perms;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 8f3bdd
##	Append cups log files.
Chris PeBenito 8f3bdd
## </summary>
Chris PeBenito 8f3bdd
## <param name="domain">
Chris PeBenito 8f3bdd
##	<summary>
Chris PeBenito 8f3bdd
##	Domain allowed access.
Chris PeBenito 8f3bdd
##	</summary>
Chris PeBenito 8f3bdd
## </param>
Chris PeBenito 8f3bdd
#
Chris PeBenito 8f3bdd
interface(`cups_append_log',`
Chris PeBenito 8f3bdd
	gen_require(`
Chris PeBenito 8f3bdd
		type cupsd_log_t;
Chris PeBenito 8f3bdd
	')
Chris PeBenito 8f3bdd
Chris PeBenito 8f3bdd
	logging_search_logs($1)
Chris PeBenito 8f3bdd
	append_files_pattern($1, cupsd_log_t, cupsd_log_t)
Chris PeBenito 8f3bdd
')
Chris PeBenito 8f3bdd
Chris PeBenito 8f3bdd
########################################
Chris PeBenito 8f3bdd
## <summary>
Chris PeBenito 17de1b
##	Write cups log 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(`cups_write_log',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type cupsd_log_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	logging_search_logs($1)
Chris PeBenito 82d277
	allow $1 cupsd_log_t:file write_file_perms;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Connect to ptal over an unix domain stream socket.
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(`cups_stream_connect_ptal',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type ptal_t, ptal_var_run_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_pids($1)
Chris PeBenito 0bfccd
	stream_connect_pattern($1, ptal_var_run_t, ptal_var_run_t, ptal_t)
Chris PeBenito 17de1b
')
Chris PeBenito 8f3bdd
Chris PeBenito 8f3bdd
########################################
Chris PeBenito 8f3bdd
## <summary>
Chris PeBenito 8f3bdd
##	All of the rules required to administrate 
Chris PeBenito 8f3bdd
##	an cups environment
Chris PeBenito 8f3bdd
## </summary>
Chris PeBenito 8f3bdd
## <param name="domain">
Chris PeBenito 8f3bdd
##	<summary>
Chris PeBenito 8f3bdd
##	Domain allowed access.
Chris PeBenito 8f3bdd
##	</summary>
Chris PeBenito 8f3bdd
## </param>
Chris PeBenito 8f3bdd
## <param name="role">
Chris PeBenito 8f3bdd
##	<summary>
Chris PeBenito 8f3bdd
##	The role to be allowed to manage the cups domain.
Chris PeBenito 8f3bdd
##	</summary>
Chris PeBenito 8f3bdd
## </param>
Chris PeBenito 8f3bdd
## <rolecap/>
Chris PeBenito 8f3bdd
#
Chris PeBenito 8f3bdd
interface(`cups_admin',`
Chris PeBenito 8f3bdd
	gen_require(`
Chris PeBenito 8f3bdd
		type cupsd_t, cupsd_tmp_t, cupsd_lpd_tmp_t;
Dan Walsh 3eaa99
		type cupsd_etc_t, cupsd_log_t;
Chris PeBenito 8f3bdd
		type cupsd_config_var_run_t, cupsd_lpd_var_run_t;
Chris PeBenito 8f3bdd
		type cupsd_var_run_t, ptal_etc_t;
Chris PeBenito 8f3bdd
		type ptal_var_run_t, hplip_var_run_t;
Chris PeBenito 8f3bdd
		type cupsd_initrc_exec_t;
Chris PeBenito 8f3bdd
	')
Chris PeBenito 8f3bdd
Chris PeBenito 8f3bdd
	allow $1 cupsd_t:process { ptrace signal_perms };
Chris PeBenito 8f3bdd
	ps_process_pattern($1, cupsd_t)
Chris PeBenito 8f3bdd
Chris PeBenito 8f3bdd
	init_labeled_script_domtrans($1, cupsd_initrc_exec_t)
Chris PeBenito 8f3bdd
	domain_system_change_exemption($1)
Chris PeBenito 8f3bdd
	role_transition $2 cupsd_initrc_exec_t system_r;
Chris PeBenito 8f3bdd
	allow $2 system_r;
Chris PeBenito 8f3bdd
Chris PeBenito 8f3bdd
	admin_pattern($1, cupsd_etc_t)
Chris PeBenito 8f3bdd
	files_list_etc($1)
Chris PeBenito 8f3bdd
Chris PeBenito 8f3bdd
	admin_pattern($1, cupsd_config_var_run_t)
Chris PeBenito 8f3bdd
Chris PeBenito 8f3bdd
	admin_pattern($1, cupsd_log_t)
Chris PeBenito 8f3bdd
	logging_list_logs($1)
Chris PeBenito 8f3bdd
Chris PeBenito 8f3bdd
	admin_pattern($1, cupsd_lpd_tmp_t)
Chris PeBenito 8f3bdd
Chris PeBenito 8f3bdd
	admin_pattern($1, cupsd_lpd_var_run_t)
Chris PeBenito 8f3bdd
Chris PeBenito 8f3bdd
	admin_pattern($1, cupsd_tmp_t)
Chris PeBenito 8f3bdd
	files_list_tmp($1)
Chris PeBenito 8f3bdd
Chris PeBenito 8f3bdd
	admin_pattern($1, cupsd_var_run_t)
Chris PeBenito 8f3bdd
	files_list_pids($1)
Chris PeBenito 8f3bdd
Chris PeBenito 8f3bdd
	admin_pattern($1, hplip_var_run_t)
Chris PeBenito 8f3bdd
Chris PeBenito 8f3bdd
	admin_pattern($1, ptal_etc_t)
Chris PeBenito 8f3bdd
Chris PeBenito 8f3bdd
	admin_pattern($1, ptal_var_run_t)
Chris PeBenito 8f3bdd
')