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