Chris PeBenito ab58ad
# macros for the cdrecord domain
Chris PeBenito ab58ad
# Author: Thomas Bleher <ThomasBleher@gmx.de>
Chris PeBenito ab58ad
Chris PeBenito ab58ad
define(`cdrecord_domain', `
Chris PeBenito ab58ad
type $1_cdrecord_t, domain, privlog;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
domain_auto_trans($1_t, cdrecord_exec_t, $1_cdrecord_t)
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# The user role is authorized for this domain.
Chris PeBenito ab58ad
role $1_r types $1_cdrecord_t;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
uses_shlib($1_cdrecord_t)
Chris PeBenito ab58ad
read_locale($1_cdrecord_t)
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# allow ps to show cdrecord and allow the user to kill it 
Chris PeBenito ab58ad
can_ps($1_t, $1_cdrecord_t)
Chris PeBenito ab58ad
allow $1_t $1_cdrecord_t:process signal;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# write to the user domain tty.
Chris PeBenito ab58ad
access_terminal($1_cdrecord_t, $1)
Chris PeBenito ab58ad
allow $1_cdrecord_t privfd:fd use;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
allow $1_cdrecord_t $1_t:unix_stream_socket { getattr read write ioctl };
Chris PeBenito ab58ad
Chris PeBenito ab58ad
allow $1_cdrecord_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito ab58ad
allow $1_cdrecord_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
can_resmgrd_connect($1_cdrecord_t)
Chris PeBenito ab58ad
Chris PeBenito ab58ad
read_content($1_cdrecord_t, $1, cdrecord) 
Chris PeBenito ab58ad
Chris PeBenito ab58ad
allow $1_cdrecord_t etc_t:file { getattr read };
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# allow searching for cdrom-drive
Chris PeBenito ab58ad
allow $1_cdrecord_t device_t:dir r_dir_perms;
Chris PeBenito ab58ad
allow $1_cdrecord_t device_t:lnk_file { getattr read };
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# allow cdrecord to write the CD
Chris PeBenito ab58ad
allow $1_cdrecord_t removable_device_t:blk_file { getattr read write ioctl };
Chris PeBenito ab58ad
allow $1_cdrecord_t scsi_generic_device_t:chr_file { getattr read write ioctl };
Chris PeBenito ab58ad
Chris PeBenito ab58ad
allow $1_cdrecord_t self:capability { ipc_lock sys_nice setuid dac_override sys_rawio };
Chris PeBenito ab58ad
allow $1_cdrecord_t self:process { getsched setsched fork sigchld sigkill };
Chris PeBenito ab58ad
can_access_pty($1_cdrecord_t, $1)
Chris PeBenito ab58ad
allow $1_cdrecord_t $1_home_t:dir search;
Chris PeBenito ab58ad
allow $1_cdrecord_t $1_home_dir_t:dir r_dir_perms;
Chris PeBenito ab58ad
allow $1_cdrecord_t $1_home_t:file r_file_perms;
Chris PeBenito 8967bf
if (use_nfs_home_dirs) {
Chris PeBenito 8967bf
allow $1_cdrecord_t mnt_t:dir search;
Chris PeBenito 8967bf
r_dir_file($1_cdrecord_t, nfs_t)
Chris PeBenito 8967bf
}
Chris PeBenito ab58ad
')
Chris PeBenito ab58ad