Chris PeBenito 31b7c0
#DESC Quota - File system quota management utilities
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
# Author:  Russell Coker <russell@coker.com.au>
Chris PeBenito 31b7c0
# X-Debian-Packages: quota quotatool
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
#################################
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
# Rules for the quota_t domain.
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
# needs auth attribute because it has read access to shadow_t because checkquota
Chris PeBenito 31b7c0
# is buggy
Chris PeBenito 31b7c0
daemon_base_domain(quota, `, auth, fs_domain')
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# so the administrator can run quotacheck
Chris PeBenito 31b7c0
domain_auto_trans(sysadm_t, quota_exec_t, quota_t)
Chris PeBenito 31b7c0
role sysadm_r types quota_t;
Chris PeBenito 31b7c0
allow quota_t admin_tty_type:chr_file { read write };
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
type quota_flag_t, file_type, sysadmfile;
Chris PeBenito 31b7c0
type quota_db_t, file_type, sysadmfile;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
rw_dir_create_file(initrc_t, quota_flag_t)
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
allow quota_t fs_t:filesystem { getattr quotaget quotamod remount };
Chris PeBenito 31b7c0
# quotacheck creates new quota_db_t files
Chris PeBenito 31b7c0
file_type_auto_trans(quota_t, { root_t home_root_t var_t usr_t src_t var_spool_t }, quota_db_t, file)
Chris PeBenito 31b7c0
# for some reason it wants dac_override not dac_read_search
Chris PeBenito 31b7c0
allow quota_t self:capability { sys_admin dac_override };
Chris PeBenito 31b7c0
allow quota_t file_type:{ fifo_file sock_file } getattr;
Chris PeBenito 31b7c0
allow quota_t file_t:file quotaon;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# for quotacheck
Chris PeBenito 31b7c0
allow quota_t file_type:dir r_dir_perms;
Chris PeBenito 31b7c0
# The following line is apparently necessary, although read and
Chris PeBenito 31b7c0
# ioctl seem to be more than should be required.
Chris PeBenito 31b7c0
allow quota_t file_type:file { getattr read ioctl };
Chris PeBenito 31b7c0
allow quota_t file_type:{ fifo_file sock_file } getattr;
Chris PeBenito 31b7c0
allow quota_t file_type:lnk_file { read getattr };
Chris PeBenito 31b7c0
allow quota_t device_type:{ chr_file blk_file } getattr;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
allow quota_t fixed_disk_device_t:blk_file { getattr read };
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# for /quota.*
Chris PeBenito 31b7c0
allow quota_t quota_db_t:file { read write };
Chris PeBenito 31b7c0
dontaudit unpriv_userdomain quota_db_t:file getattr;
Chris PeBenito 31b7c0
allow quota_t quota_db_t:file quotaon;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# Read /etc/mtab.
Chris PeBenito 31b7c0
allow quota_t etc_runtime_t:file { read getattr };
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
allow quota_t device_t:dir r_dir_perms;
Chris PeBenito 31b7c0
allow quota_t fixed_disk_device_t:blk_file getattr;
Chris PeBenito 31b7c0
allow quota_t boot_t:dir r_dir_perms;
Chris PeBenito 31b7c0
allow quota_t sysctl_t:dir { getattr search };
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
allow quota_t initrc_devpts_t:chr_file rw_file_perms;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
allow quota_t proc_t:file getattr;