Chris PeBenito 17de1b
## <summary>Bluetooth tools and system services.</summary>
Chris PeBenito 17de1b
Chris PeBenito 350b6a
#######################################
Chris PeBenito 350b6a
## <summary>
Chris PeBenito 350b6a
##	The per role template for the bluetooth module.
Chris PeBenito 350b6a
## </summary>
Chris PeBenito 350b6a
## <desc>
Chris PeBenito 350b6a
##	

Chris PeBenito 350b6a
##	This template creates derived domains which are used
Chris PeBenito 350b6a
##	for bluetooth.
Chris PeBenito 350b6a
##	

Chris PeBenito 350b6a
##	

Chris PeBenito 350b6a
##	This template is invoked automatically for each user, and
Chris PeBenito 350b6a
##	generally does not need to be invoked directly
Chris PeBenito 350b6a
##	by policy writers.
Chris PeBenito 350b6a
##	

Chris PeBenito 350b6a
## </desc>
Chris PeBenito 350b6a
## <param name="userdomain_prefix">
Chris PeBenito 350b6a
##	<summary>
Chris PeBenito 350b6a
##	The prefix of the user domain (e.g., user
Chris PeBenito 350b6a
##	is the prefix for user_t).
Chris PeBenito 350b6a
##	</summary>
Chris PeBenito 350b6a
## </param>
Chris PeBenito 350b6a
## <param name="user_domain">
Chris PeBenito 350b6a
##	<summary>
Chris PeBenito 350b6a
##	The type of the user domain.
Chris PeBenito 350b6a
##	</summary>
Chris PeBenito 350b6a
## </param>
Chris PeBenito 350b6a
## <param name="user_role">
Chris PeBenito 350b6a
##	<summary>
Chris PeBenito 350b6a
##	The role associated with the user domain.
Chris PeBenito 350b6a
##	</summary>
Chris PeBenito 350b6a
## </param>
Chris PeBenito 350b6a
#
Chris PeBenito 350b6a
template(`bluetooth_per_role_template',`
Chris PeBenito 350b6a
	gen_require(`
Chris PeBenito 350b6a
		attribute bluetooth_helper_domain;
Chris PeBenito 0bfccd
		type bluetooth_helper_exec_t, bluetooth_t;
Chris PeBenito 350b6a
	')
Chris PeBenito 350b6a
Chris PeBenito 350b6a
	type $1_bluetooth_t, bluetooth_helper_domain;
Chris PeBenito 350b6a
	application_domain($1_bluetooth_t, bluetooth_helper_exec_t)
Chris PeBenito 350b6a
	role $3 types $1_bluetooth_t;
Chris PeBenito 350b6a
	
Chris PeBenito 350b6a
	type $1_bluetooth_tmp_t;
Chris PeBenito 350b6a
	files_tmp_file($1_bluetooth_tmp_t)
Chris PeBenito 350b6a
Chris PeBenito 350b6a
	type $1_bluetooth_tmpfs_t;
Chris PeBenito 350b6a
	files_tmpfs_file($1_bluetooth_tmpfs_t)
Chris PeBenito 350b6a
Chris PeBenito 350b6a
	allow $1_bluetooth_t self:capability sys_nice;
Chris PeBenito 350b6a
	allow $1_bluetooth_t self:process getsched;
Chris PeBenito 350b6a
	allow $1_bluetooth_t self:fifo_file rw_fifo_file_perms;
Chris PeBenito 350b6a
	allow $1_bluetooth_t self:shm create_shm_perms;
Chris PeBenito 350b6a
	allow $1_bluetooth_t self:unix_stream_socket { create_stream_socket_perms connectto };
Chris PeBenito 350b6a
	allow $1_bluetooth_t self:tcp_socket create_socket_perms;
Chris PeBenito 350b6a
	allow $1_bluetooth_t self:netlink_route_socket r_netlink_socket_perms;
Chris PeBenito 350b6a
Chris PeBenito 350b6a
	allow $1_bluetooth_t bluetooth_t:socket { read write };
Chris PeBenito 350b6a
Chris PeBenito 350b6a
	manage_dirs_pattern($1_bluetooth_t, $1_bluetooth_tmp_t, $1_bluetooth_tmp_t)
Chris PeBenito 350b6a
	manage_files_pattern($1_bluetooth_t, $1_bluetooth_tmp_t, $1_bluetooth_tmp_t)
Chris PeBenito 350b6a
	manage_sock_files_pattern($1_bluetooth_t, $1_bluetooth_tmp_t, $1_bluetooth_tmp_t)
Chris PeBenito 350b6a
	files_tmp_filetrans($1_bluetooth_t, $1_bluetooth_tmp_t, { file dir sock_file })
Chris PeBenito 350b6a
Chris PeBenito 350b6a
	manage_dirs_pattern($1_bluetooth_t, $1_bluetooth_tmpfs_t, $1_bluetooth_tmpfs_t)
Chris PeBenito 350b6a
	manage_files_pattern($1_bluetooth_t, $1_bluetooth_tmpfs_t, $1_bluetooth_tmpfs_t)
Chris PeBenito 350b6a
	fs_tmpfs_filetrans($1_bluetooth_t, $1_bluetooth_tmpfs_t, { dir file })
Chris PeBenito 350b6a
Chris PeBenito 350b6a
	kernel_read_system_state($1_bluetooth_t)
Chris PeBenito 350b6a
	kernel_read_kernel_sysctls($1_bluetooth_t)
Chris PeBenito 350b6a
Chris PeBenito 350b6a
	dev_read_urand($1_bluetooth_t)
Chris PeBenito 350b6a
Chris PeBenito 350b6a
	term_dontaudit_use_all_user_ttys($1_bluetooth_t)
Chris PeBenito 350b6a
Chris PeBenito 350b6a
	corecmd_exec_bin($1_bluetooth_t)
Chris PeBenito 350b6a
	corecmd_exec_shell($1_bluetooth_t)
Chris PeBenito 350b6a
Chris PeBenito 350b6a
	domain_read_all_domains_state($1_bluetooth_t)
Chris PeBenito 350b6a
Chris PeBenito 350b6a
	files_read_etc_files($1_bluetooth_t)
Chris PeBenito 350b6a
	files_read_etc_runtime_files($1_bluetooth_t)
Chris PeBenito 350b6a
	files_read_usr_files($1_bluetooth_t)
Chris PeBenito 350b6a
	files_dontaudit_list_default($1_bluetooth_t)
Chris PeBenito 350b6a
Chris PeBenito 350b6a
	libs_use_ld_so($1_bluetooth_t)
Chris PeBenito 350b6a
	libs_use_shared_libs($1_bluetooth_t)
Chris PeBenito 350b6a
Chris PeBenito 350b6a
	locallogin_dontaudit_use_fds($1_bluetooth_t)
Chris PeBenito 350b6a
Chris PeBenito 350b6a
	logging_send_syslog_msg($1_bluetooth_t)
Chris PeBenito 350b6a
Chris PeBenito 350b6a
	miscfiles_read_localization($1_bluetooth_t) 
Chris PeBenito 350b6a
Chris PeBenito 350b6a
	sysnet_read_config($1_bluetooth_t)
Chris PeBenito 350b6a
Chris PeBenito 350b6a
	optional_policy(`
Chris PeBenito 350b6a
		bluetooth_dbus_chat($1_bluetooth_t)
Chris PeBenito bd973e
Chris PeBenito 350b6a
		dbus_system_bus_client_template($1_bluetooth, $1_bluetooth_t)
Chris PeBenito 350b6a
		dbus_connect_system_bus($1_bluetooth_t)
Chris PeBenito 350b6a
	')
Chris PeBenito 350b6a
Chris PeBenito 350b6a
	optional_policy(`
Chris PeBenito 350b6a
		nscd_socket_use($1_bluetooth_t)
Chris PeBenito 350b6a
	')
Chris PeBenito 350b6a
Chris PeBenito 350b6a
	optional_policy(`
Chris PeBenito 2c12b4
		xserver_user_x_domain_template($1, $1_bluetooth, $1_bluetooth_t, $1_bluetooth_tmpfs_t)
Chris PeBenito 350b6a
	')
Chris PeBenito 350b6a
')
Chris PeBenito 350b6a
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 465510
##	Execute bluetooth in the bluetooth domain.
Chris PeBenito 465510
## </summary>
Chris PeBenito 465510
## <param name="domain">
Chris PeBenito 465510
##	<summary>
Chris PeBenito 465510
##	The type of the process performing this action.
Chris PeBenito 465510
##	</summary>
Chris PeBenito 465510
## </param>
Chris PeBenito 465510
#
Chris PeBenito 465510
interface(`bluetooth_domtrans',`
Chris PeBenito 465510
	gen_require(`
Chris PeBenito 465510
		type bluetooth_t, bluetooth_exec_t;
Chris PeBenito 465510
	')
Chris PeBenito 465510
Chris PeBenito 0bfccd
	domtrans_pattern($1, bluetooth_exec_t, bluetooth_t)
Chris PeBenito 465510
')
Chris PeBenito 465510
Chris PeBenito 465510
########################################
Chris PeBenito 465510
## <summary>
Chris PeBenito 17de1b
##	Read bluetooth daemon configuration.
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(`bluetooth_read_config',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type bluetooth_conf_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $1 bluetooth_conf_t:file { getattr read ioctl };
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 350b6a
##	Send and receive messages from
Chris PeBenito 350b6a
##	bluetooth over dbus.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 350b6a
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 350b6a
interface(`bluetooth_dbus_chat',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 350b6a
		type bluetooth_t;
Chris PeBenito 350b6a
		class dbus send_msg;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 350b6a
	allow $1 bluetooth_t:dbus send_msg;
Chris PeBenito 350b6a
	allow bluetooth_t $1:dbus send_msg;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 350b6a
##	Execute bluetooth_helper in the bluetooth_helper domain.  (Deprecated)
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 350b6a
##	The type of the process performing this action.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 350b6a
interface(`bluetooth_domtrans_helper',`
Chris PeBenito 350b6a
	refpolicywarn(`$0($*) has been deprecated.')
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Execute bluetooth_helper in the bluetooth_helper domain, and
Chris PeBenito 350b6a
##	allow the specified role the bluetooth_helper domain.  (Deprecated)
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The type of the process performing this action.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
## <param name="role">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The role to be allowed the bluetooth_helper domain.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
## <param name="terminal">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The type of the terminal allow the bluetooth_helper domain to use.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito bbcd3c
## <rolecap/>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`bluetooth_run_helper',`
Chris PeBenito 350b6a
	refpolicywarn(`$0($*) has been deprecated.')
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Read bluetooth helper 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(`bluetooth_dontaudit_read_helper_files',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 350b6a
		attribute bluetooth_helper_domain;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 350b6a
	dontaudit $1 bluetooth_helper_domain:dir search;
Chris PeBenito 350b6a
	dontaudit $1 bluetooth_helper_domain:file { read getattr };
Chris PeBenito 17de1b
')