Chris PeBenito 31b7c0
#DESC USBModules - List kernel modules for USB devices
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
# Author:  Russell Coker <russell@coker.com.au>
Chris PeBenito 31b7c0
# X-Debian-Packages:
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
#################################
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
# Rules for the usbmodules_t domain.
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
type usbmodules_t, domain, privlog;
Chris PeBenito 31b7c0
type usbmodules_exec_t, file_type, sysadmfile, exec_type;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
in_user_role(usbmodules_t)
Chris PeBenito 31b7c0
role sysadm_r types usbmodules_t;
Chris PeBenito 31b7c0
role system_r types usbmodules_t;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
domain_auto_trans(initrc_t, usbmodules_exec_t, usbmodules_t)
Chris PeBenito 31b7c0
ifdef(`hotplug.te',`
Chris PeBenito 31b7c0
domain_auto_trans(hotplug_t, usbmodules_exec_t, usbmodules_t)
Chris PeBenito 31b7c0
allow usbmodules_t hotplug_etc_t:file r_file_perms;
Chris PeBenito 31b7c0
allow usbmodules_t hotplug_etc_t:dir search;
Chris PeBenito 31b7c0
')
Chris PeBenito 31b7c0
allow usbmodules_t init_t:fd use;
Chris PeBenito 31b7c0
allow usbmodules_t console_device_t:chr_file { read write };
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
uses_shlib(usbmodules_t)
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# allow usb device access
Chris PeBenito 31b7c0
allow usbmodules_t usbdevfs_t:file rw_file_perms;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
allow usbmodules_t { etc_t modules_object_t proc_t usbdevfs_t }:dir r_dir_perms;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# needs etc_t read access for the hotplug config, maybe should have a new type
Chris PeBenito 31b7c0
allow usbmodules_t { etc_t modules_dep_t }:file r_file_perms;