Chris PeBenito 17de1b
Chris PeBenito 17de1b
policy_module(timidity,1.1.1)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# Note: You only need this policy if you want to run timidity as a server
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Declarations
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type timidity_t;
Chris PeBenito 17de1b
type timidity_exec_t;
Chris PeBenito 17de1b
init_daemon_domain(timidity_t,timidity_exec_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type timidity_tmpfs_t;
Chris PeBenito 17de1b
files_tmpfs_file(timidity_tmpfs_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Local policy
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow timidity_t self:capability { dac_override dac_read_search };
Chris PeBenito 17de1b
dontaudit timidity_t self:capability sys_tty_config;
Chris PeBenito 17de1b
allow timidity_t self:process { signal_perms getsched };
Chris PeBenito 17de1b
allow timidity_t self:shm create_shm_perms;
Chris PeBenito 17de1b
allow timidity_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito 17de1b
allow timidity_t self:tcp_socket create_stream_socket_perms;
Chris PeBenito 17de1b
allow timidity_t self:udp_socket create_socket_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow timidity_t timidity_tmpfs_t:dir create_dir_perms;
Chris PeBenito 17de1b
allow timidity_t timidity_tmpfs_t:file create_file_perms;
Chris PeBenito 17de1b
allow timidity_t timidity_tmpfs_t:lnk_file create_lnk_perms;
Chris PeBenito 17de1b
allow timidity_t timidity_tmpfs_t:sock_file create_file_perms;
Chris PeBenito 17de1b
allow timidity_t timidity_tmpfs_t:fifo_file create_file_perms;
Chris PeBenito 17de1b
fs_tmpfs_filetrans(timidity_t,timidity_tmpfs_t,{ dir file lnk_file sock_file fifo_file })
Chris PeBenito 17de1b
Chris PeBenito 17de1b
kernel_read_kernel_sysctls(timidity_t)
Chris PeBenito 17de1b
# read /proc/cpuinfo
Chris PeBenito 17de1b
kernel_read_system_state(timidity_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
corenet_non_ipsec_sendrecv(timidity_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_generic_if(timidity_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_generic_if(timidity_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_all_nodes(timidity_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_all_nodes(timidity_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_all_ports(timidity_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_all_ports(timidity_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
dev_read_sysfs(timidity_t)
Chris PeBenito 17de1b
dev_read_sound(timidity_t)
Chris PeBenito 17de1b
dev_write_sound(timidity_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
fs_search_auto_mountpoints(timidity_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
term_dontaudit_use_console(timidity_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
domain_use_interactive_fds(timidity_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
files_search_tmp(timidity_t)
Chris PeBenito 17de1b
# read /usr/share/alsa/alsa.conf
Chris PeBenito 17de1b
files_read_usr_files(timidity_t)
Chris PeBenito 17de1b
# read /etc/esd.conf
Chris PeBenito 17de1b
files_read_etc_files(timidity_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
init_use_fds(timidity_t)
Chris PeBenito 17de1b
init_use_script_ptys(timidity_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
libs_use_ld_so(timidity_t)
Chris PeBenito 17de1b
libs_use_shared_libs(timidity_t)
Chris PeBenito 17de1b
# read libartscbackend.la
Chris PeBenito 17de1b
libs_read_lib_files(timidity_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
logging_send_syslog_msg(timidity_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
sysnet_read_config(timidity_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
userdom_dontaudit_use_unpriv_user_fds(timidity_t)
Chris PeBenito 17de1b
# stupid timidity won't start if it can't search its current directory.
Chris PeBenito 17de1b
# allow this so /etc/init.d/alsasound start works from /root
Chris PeBenito 17de1b
# cjp: this should be fixed if possible so this rule can be removed.
Chris PeBenito 17de1b
userdom_search_sysadm_home_dirs(timidity_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
ifdef(`targeted_policy',`
Chris PeBenito 17de1b
	term_dontaudit_use_unallocated_ttys(timidity_t)
Chris PeBenito 17de1b
	term_dontaudit_use_generic_ptys(timidity_t)
Chris PeBenito 17de1b
	files_dontaudit_read_root_files(timidity_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	seutil_sigchld_newrole(timidity_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	udev_read_db(timidity_t)
Chris PeBenito 17de1b
')