Chris PeBenito 31b7c0
#DESC Gpm - General Purpose Mouse driver
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
# Authors:  Stephen Smalley <sds@epoch.ncsc.mil> and Timothy Fraser  
Chris PeBenito 31b7c0
# X-Debian-Packages: gpm
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
#################################
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
# Rules for the gpm_t domain.
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
# gpm_t is the domain of the console mouse server.
Chris PeBenito 31b7c0
# gpm_exec_t is the type of the console mouse server program.
Chris PeBenito 31b7c0
# gpmctl_t is the type of the Unix domain socket or pipe created
Chris PeBenito 31b7c0
# by the console mouse server.
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
daemon_domain(gpm)
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
type gpmctl_t, file_type, sysadmfile, dev_fs;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
tmp_domain(gpm)
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# Allow to read the /etc/gpm/ conf files
Chris PeBenito 31b7c0
type gpm_conf_t, file_type, sysadmfile;
Chris PeBenito 31b7c0
r_dir_file(gpm_t, gpm_conf_t)
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# Use capabilities.
Chris PeBenito 31b7c0
allow gpm_t self:capability { setuid dac_override sys_admin sys_tty_config };
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# Create and bind to /dev/gpmctl.
Chris PeBenito 31b7c0
file_type_auto_trans(gpm_t, device_t, gpmctl_t, { sock_file fifo_file })
Chris PeBenito 31b7c0
allow gpm_t gpmctl_t:unix_stream_socket name_bind;
Chris PeBenito 31b7c0
allow gpm_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito 31b7c0
allow gpm_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# Read and write ttys.
Chris PeBenito 31b7c0
allow gpm_t tty_device_t:chr_file rw_file_perms;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# Access the mouse.
Chris PeBenito 31b7c0
allow gpm_t { event_device_t mouse_device_t }:chr_file rw_file_perms;
Chris PeBenito 31b7c0
allow gpm_t device_t:lnk_file { getattr read };
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
read_locale(gpm_t)
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
allow initrc_t gpmctl_t:sock_file setattr;
Chris PeBenito 31b7c0