Chris PeBenito f862c3
Chris PeBenito f862c3
policy_module(gpm,1.0)
Chris PeBenito f862c3
Chris PeBenito f862c3
########################################
Chris PeBenito f862c3
#
Chris PeBenito f862c3
# Declarations
Chris PeBenito f862c3
#
Chris PeBenito f862c3
Chris PeBenito f862c3
type gpm_t;
Chris PeBenito f862c3
type gpm_exec_t;
Chris PeBenito f862c3
init_daemon_domain(gpm_t,gpm_exec_t)
Chris PeBenito f862c3
Chris PeBenito f862c3
type gpm_conf_t;
Chris PeBenito f862c3
files_type(gpm_conf_t)
Chris PeBenito f862c3
Chris PeBenito f862c3
type gpm_tmp_t;
Chris PeBenito f862c3
files_tmp_file(gpm_tmp_t)
Chris PeBenito f862c3
Chris PeBenito f862c3
type gpm_var_run_t;
Chris PeBenito f862c3
files_pid_file(gpm_var_run_t)
Chris PeBenito f862c3
Chris PeBenito f862c3
type gpmctl_t;
Chris PeBenito f862c3
files_type(gpmctl_t)
Chris PeBenito f862c3
Chris PeBenito f862c3
########################################
Chris PeBenito f862c3
#
Chris PeBenito f862c3
# Local policy
Chris PeBenito f862c3
#
Chris PeBenito f862c3
Chris PeBenito f862c3
allow gpm_t self:capability { setuid dac_override sys_admin sys_tty_config };
Chris PeBenito f862c3
Chris PeBenito f862c3
allow gpm_t gpm_conf_t:dir r_dir_perms;
Chris PeBenito f862c3
allow gpm_t gpm_conf_t:file r_file_perms;
Chris PeBenito f862c3
allow gpm_t gpm_conf_t:lnk_file { getattr read };
Chris PeBenito f862c3
Chris PeBenito f862c3
allow gpm_t gpm_tmp_t:dir create_dir_perms;
Chris PeBenito f862c3
allow gpm_t gpm_tmp_t:file create_file_perms;
Chris PeBenito f862c3
files_create_tmp_files(gpm_t, gpm_tmp_t, { file dir })
Chris PeBenito f862c3
Chris PeBenito f862c3
allow gpm_t gpm_var_run_t:file create_file_perms;
Chris PeBenito f862c3
files_create_pid(gpm_t,gpm_var_run_t)
Chris PeBenito f862c3
Chris PeBenito f862c3
allow gpm_t gpmctl_t:sock_file create_file_perms;
Chris PeBenito f862c3
allow gpm_t gpmctl_t:fifo_file create_file_perms;
Chris PeBenito f862c3
dev_create_dev_node(gpm_t,gpmctl_t,{ sock_file fifo_file })
Chris PeBenito f862c3
Chris PeBenito f862c3
# cjp: this has no effect
Chris PeBenito f862c3
allow gpm_t gpmctl_t:unix_stream_socket name_bind;
Chris PeBenito f862c3
Chris PeBenito f862c3
kernel_read_kernel_sysctl(gpm_t)
Chris PeBenito f862c3
kernel_list_proc(gpm_t)
Chris PeBenito f862c3
kernel_read_proc_symlinks(gpm_t)
Chris PeBenito f862c3
Chris PeBenito f862c3
dev_read_sysfs(gpm_t)
Chris PeBenito f862c3
# Access the mouse.
Chris PeBenito f862c3
dev_read_input(gpm_t)
Chris PeBenito f862c3
dev_read_mouse(gpm_t)
Chris PeBenito f862c3
Chris PeBenito f862c3
fs_getattr_all_fs(gpm_t)
Chris PeBenito f862c3
fs_search_auto_mountpoints(gpm_t)
Chris PeBenito f862c3
Chris PeBenito f862c3
term_use_unallocated_tty(gpm_t)
Chris PeBenito f862c3
term_dontaudit_use_console(gpm_t)
Chris PeBenito f862c3
Chris PeBenito f862c3
domain_use_wide_inherit_fd(gpm_t)
Chris PeBenito f862c3
Chris PeBenito f862c3
init_use_fd(gpm_t)
Chris PeBenito f862c3
init_use_script_pty(gpm_t)
Chris PeBenito f862c3
Chris PeBenito f862c3
libs_use_ld_so(gpm_t)
Chris PeBenito f862c3
libs_use_shared_libs(gpm_t)
Chris PeBenito f862c3
Chris PeBenito f862c3
logging_send_syslog_msg(gpm_t)
Chris PeBenito f862c3
Chris PeBenito f862c3
miscfiles_read_localization(gpm_t)
Chris PeBenito f862c3
Chris PeBenito f862c3
userdom_dontaudit_use_unpriv_user_fd(gpm_t)
Chris PeBenito f862c3
userdom_dontaudit_search_sysadm_home_dir(gpm_t)
Chris PeBenito f862c3
Chris PeBenito f862c3
ifdef(`targeted_policy', `
Chris PeBenito f862c3
	term_dontaudit_use_unallocated_tty(gpm_t)
Chris PeBenito f862c3
	term_dontaudit_use_generic_pty(gpm_t)
Chris PeBenito f862c3
	files_dontaudit_read_root_file(gpm_t)
Chris PeBenito f862c3
')
Chris PeBenito f862c3
Chris PeBenito f862c3
optional_policy(`selinuxutil.te',`
Chris PeBenito f862c3
	seutil_sigchld_newrole(gpm_t)
Chris PeBenito f862c3
')
Chris PeBenito f862c3
Chris PeBenito f862c3
optional_policy(`udev.te', `
Chris PeBenito f862c3
	udev_read_db(gpm_t)
Chris PeBenito f862c3
')
Chris PeBenito f862c3
Chris PeBenito f862c3
ifdef(`TODO',`
Chris PeBenito f862c3
# Access the mouse.
Chris PeBenito f862c3
# cjp: why write?
Chris PeBenito f862c3
allow gpm_t { event_device_t mouse_device_t }:chr_file rw_file_perms;
Chris PeBenito c0d156
optional_policy(`rhgb.te',`
Chris PeBenito c0d156
	rhgb_domain(gpm_t)
Chris PeBenito c0d156
')
Chris PeBenito f862c3
')