2005-10-07 21:45:04 +00:00
|
|
|
## <summary>Bluetooth tools and system services.</summary>
|
2005-10-24 21:25:02 +00:00
|
|
|
|
2008-11-05 16:10:46 +00:00
|
|
|
########################################
|
2007-10-02 16:04:50 +00:00
|
|
|
## <summary>
|
2008-11-05 16:10:46 +00:00
|
|
|
## Role access for bluetooth
|
2007-10-02 16:04:50 +00:00
|
|
|
## </summary>
|
2008-11-05 16:10:46 +00:00
|
|
|
## <param name="role">
|
2007-10-02 16:04:50 +00:00
|
|
|
## <summary>
|
2008-11-05 16:10:46 +00:00
|
|
|
## Role allowed access
|
2007-10-02 16:04:50 +00:00
|
|
|
## </summary>
|
|
|
|
## </param>
|
2008-11-05 16:10:46 +00:00
|
|
|
## <param name="domain">
|
2007-10-02 16:04:50 +00:00
|
|
|
## <summary>
|
2008-11-05 16:10:46 +00:00
|
|
|
## User domain for the role
|
2007-10-02 16:04:50 +00:00
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
2008-11-05 16:10:46 +00:00
|
|
|
interface(`bluetooth_role',`
|
2007-10-02 16:04:50 +00:00
|
|
|
gen_require(`
|
2008-11-05 16:10:46 +00:00
|
|
|
type bluetooth_helper_t, bluetooth_helper_exec_t;
|
|
|
|
type bluetooth_helper_tmp_t, bluetooth_helper_tmpfs_t;
|
2007-10-02 16:04:50 +00:00
|
|
|
')
|
|
|
|
|
2008-11-05 16:10:46 +00:00
|
|
|
role $1 types bluetooth_helper_t;
|
2007-10-02 16:04:50 +00:00
|
|
|
|
2008-11-05 16:10:46 +00:00
|
|
|
domtrans_pattern($2, bluetooth_helper_exec_t, bluetooth_helper_t)
|
2007-10-02 16:04:50 +00:00
|
|
|
|
2010-01-07 16:49:32 +00:00
|
|
|
# allow ps to show cdrecord and allow the user to kill it
|
2008-11-05 16:10:46 +00:00
|
|
|
ps_process_pattern($2, bluetooth_helper_t)
|
|
|
|
allow $2 bluetooth_helper_t:process signal;
|
2007-10-02 16:04:50 +00:00
|
|
|
|
2008-11-05 16:10:46 +00:00
|
|
|
manage_dirs_pattern($2, bluetooth_helper_tmp_t, bluetooth_helper_tmp_t)
|
|
|
|
manage_files_pattern($2, bluetooth_helper_tmp_t, bluetooth_helper_tmp_t)
|
|
|
|
manage_sock_files_pattern($2, bluetooth_helper_tmp_t, bluetooth_helper_tmp_t)
|
2007-10-02 16:04:50 +00:00
|
|
|
|
2008-11-05 16:10:46 +00:00
|
|
|
manage_dirs_pattern($2, bluetooth_helper_tmpfs_t, bluetooth_helper_tmpfs_t)
|
|
|
|
manage_files_pattern($2, bluetooth_helper_tmpfs_t, bluetooth_helper_tmpfs_t)
|
2007-10-02 16:04:50 +00:00
|
|
|
')
|
|
|
|
|
2010-01-07 16:49:32 +00:00
|
|
|
#####################################
|
|
|
|
## <summary>
|
|
|
|
## Connect to bluetooth over a unix domain
|
|
|
|
## stream socket.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`bluetooth_stream_connect',`
|
|
|
|
gen_require(`
|
|
|
|
type bluetooth_t, bluetooth_var_run_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
files_search_pids($1)
|
|
|
|
allow $1 bluetooth_t:socket rw_socket_perms;
|
|
|
|
stream_connect_pattern($1, bluetooth_var_run_t, bluetooth_var_run_t, bluetooth_t)
|
|
|
|
')
|
|
|
|
|
2006-07-28 15:13:58 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Execute bluetooth in the bluetooth domain.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
2010-08-02 13:22:09 +00:00
|
|
|
## Domain allowed access.
|
2006-07-28 15:13:58 +00:00
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`bluetooth_domtrans',`
|
|
|
|
gen_require(`
|
|
|
|
type bluetooth_t, bluetooth_exec_t;
|
|
|
|
')
|
|
|
|
|
2008-07-23 21:38:39 +00:00
|
|
|
domtrans_pattern($1, bluetooth_exec_t, bluetooth_t)
|
2006-07-28 15:13:58 +00:00
|
|
|
')
|
|
|
|
|
2006-01-06 22:51:40 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Read bluetooth daemon configuration.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2006-01-06 22:51:40 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2006-01-06 22:51:40 +00:00
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`bluetooth_read_config',`
|
|
|
|
gen_require(`
|
|
|
|
type bluetooth_conf_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 bluetooth_conf_t:file { getattr read ioctl };
|
|
|
|
')
|
|
|
|
|
2005-10-27 15:16:42 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
2007-10-02 16:04:50 +00:00
|
|
|
## Send and receive messages from
|
|
|
|
## bluetooth over dbus.
|
2005-10-27 15:16:42 +00:00
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2007-10-02 16:04:50 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-10-27 15:16:42 +00:00
|
|
|
## </param>
|
|
|
|
#
|
2007-10-02 16:04:50 +00:00
|
|
|
interface(`bluetooth_dbus_chat',`
|
2005-10-27 15:16:42 +00:00
|
|
|
gen_require(`
|
2007-10-02 16:04:50 +00:00
|
|
|
type bluetooth_t;
|
|
|
|
class dbus send_msg;
|
2005-10-27 15:16:42 +00:00
|
|
|
')
|
|
|
|
|
2007-10-02 16:04:50 +00:00
|
|
|
allow $1 bluetooth_t:dbus send_msg;
|
|
|
|
allow bluetooth_t $1:dbus send_msg;
|
2005-10-27 15:16:42 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
2005-12-02 22:06:05 +00:00
|
|
|
## <summary>
|
2007-10-02 16:04:50 +00:00
|
|
|
## Execute bluetooth_helper in the bluetooth_helper domain. (Deprecated)
|
2005-12-02 22:06:05 +00:00
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2010-08-02 13:22:09 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-12-02 22:06:05 +00:00
|
|
|
## </param>
|
|
|
|
#
|
2007-10-02 16:04:50 +00:00
|
|
|
interface(`bluetooth_domtrans_helper',`
|
|
|
|
refpolicywarn(`$0($*) has been deprecated.')
|
2005-12-02 22:06:05 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
2005-10-27 15:16:42 +00:00
|
|
|
## <summary>
|
|
|
|
## Execute bluetooth_helper in the bluetooth_helper domain, and
|
2007-10-02 16:04:50 +00:00
|
|
|
## allow the specified role the bluetooth_helper domain. (Deprecated)
|
2005-10-27 15:16:42 +00:00
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2010-08-02 13:22:09 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-10-27 15:16:42 +00:00
|
|
|
## </param>
|
|
|
|
## <param name="role">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2010-08-03 13:20:22 +00:00
|
|
|
## Role allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-10-27 15:16:42 +00:00
|
|
|
## </param>
|
|
|
|
## <param name="terminal">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-10-27 15:16:42 +00:00
|
|
|
## The type of the terminal allow the bluetooth_helper domain to use.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-10-27 15:16:42 +00:00
|
|
|
## </param>
|
2006-09-06 22:07:25 +00:00
|
|
|
## <rolecap/>
|
2005-10-27 15:16:42 +00:00
|
|
|
#
|
|
|
|
interface(`bluetooth_run_helper',`
|
2007-10-02 16:04:50 +00:00
|
|
|
refpolicywarn(`$0($*) has been deprecated.')
|
2005-10-27 15:16:42 +00:00
|
|
|
')
|
|
|
|
|
2005-10-24 21:25:02 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
2008-11-05 16:10:46 +00:00
|
|
|
## Read bluetooth helper state files.
|
2005-10-24 21:25:02 +00:00
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-10-24 21:25:02 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-10-24 21:25:02 +00:00
|
|
|
## </param>
|
|
|
|
#
|
2008-11-05 16:10:46 +00:00
|
|
|
interface(`bluetooth_dontaudit_read_helper_state',`
|
2005-10-24 21:25:02 +00:00
|
|
|
gen_require(`
|
2008-11-05 16:10:46 +00:00
|
|
|
type bluetooth_helper_t;
|
2005-10-24 21:25:02 +00:00
|
|
|
')
|
|
|
|
|
2008-11-05 16:10:46 +00:00
|
|
|
dontaudit $1 bluetooth_helper_t:dir search;
|
|
|
|
dontaudit $1 bluetooth_helper_t:file { read getattr };
|
2005-10-24 21:25:02 +00:00
|
|
|
')
|
2008-11-19 15:24:10 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
2010-01-07 16:49:32 +00:00
|
|
|
## All of the rules required to administrate
|
2008-11-19 15:24:10 +00:00
|
|
|
## an bluetooth environment
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
## <param name="role">
|
|
|
|
## <summary>
|
|
|
|
## The role to be allowed to manage the bluetooth domain.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
## <rolecap/>
|
|
|
|
#
|
|
|
|
interface(`bluetooth_admin',`
|
|
|
|
gen_require(`
|
|
|
|
type bluetooth_t, bluetooth_tmp_t, bluetooth_lock_t;
|
2009-03-23 14:56:43 +00:00
|
|
|
type bluetooth_spool_t, bluetooth_var_lib_t, bluetooth_var_run_t;
|
2008-11-19 15:24:10 +00:00
|
|
|
type bluetooth_conf_t, bluetooth_conf_rw_t;
|
|
|
|
type bluetooth_initrc_exec_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 bluetooth_t:process { ptrace signal_perms };
|
|
|
|
ps_process_pattern($1, bluetooth_t)
|
|
|
|
|
|
|
|
init_labeled_script_domtrans($1, bluetooth_initrc_exec_t)
|
|
|
|
domain_system_change_exemption($1)
|
|
|
|
role_transition $2 bluetooth_initrc_exec_t system_r;
|
|
|
|
allow $2 system_r;
|
|
|
|
|
|
|
|
files_list_tmp($1)
|
|
|
|
admin_pattern($1, bluetooth_tmp_t)
|
|
|
|
|
|
|
|
files_list_var($1)
|
|
|
|
admin_pattern($1, bluetooth_lock_t)
|
|
|
|
|
|
|
|
files_list_etc($1)
|
|
|
|
admin_pattern($1, bluetooth_conf_t)
|
|
|
|
admin_pattern($1, bluetooth_conf_rw_t)
|
|
|
|
|
2009-03-23 14:56:43 +00:00
|
|
|
files_list_spool($1)
|
|
|
|
admin_pattern($1, bluetooth_spool_t)
|
|
|
|
|
2008-11-19 15:24:10 +00:00
|
|
|
files_list_var_lib($1)
|
|
|
|
admin_pattern($1, bluetooth_var_lib_t)
|
|
|
|
|
|
|
|
files_list_pids($1)
|
|
|
|
admin_pattern($1, bluetooth_var_run_t)
|
|
|
|
')
|