Chris PeBenito 0fbfa5
#
Chris PeBenito 0fbfa5
# Macros for lockdev domains.
Chris PeBenito 0fbfa5
#
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
#
Chris PeBenito 0fbfa5
# Authors:  Daniel Walsh <dwalsh@redhat.com> 
Chris PeBenito 0fbfa5
#
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
#
Chris PeBenito 0fbfa5
# lockdev_domain(domain_prefix)
Chris PeBenito 0fbfa5
#
Chris PeBenito 0fbfa5
# Define a derived domain for the lockdev programs when executed
Chris PeBenito 0fbfa5
# by a user domain.
Chris PeBenito 0fbfa5
#
Chris PeBenito 0fbfa5
# The type declaration for the executable type for this program is
Chris PeBenito 0fbfa5
# provided separately in domains/program/lockdev.te. 
Chris PeBenito 0fbfa5
#
Chris PeBenito 0fbfa5
undefine(`lockdev_domain')
Chris PeBenito 0fbfa5
define(`lockdev_domain',`
Chris PeBenito 0fbfa5
# Derived domain based on the calling user domain and the program
Chris PeBenito 0fbfa5
type $1_lockdev_t, domain, privlog;
Chris PeBenito 0fbfa5
# Transition from the user domain to the derived domain.
Chris PeBenito 0fbfa5
domain_auto_trans($1_t, lockdev_exec_t, $1_lockdev_t)
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# The user role is authorized for this domain.
Chris PeBenito 0fbfa5
role $1_r types $1_lockdev_t;
Chris PeBenito 0fbfa5
# Use capabilities.
Chris PeBenito 0fbfa5
allow $1_lockdev_t self:capability setgid;
Chris PeBenito 0fbfa5
allow $1_lockdev_t $1_t:process signull;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
allow $1_lockdev_t var_t:dir search;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
lock_domain($1_lockdev)
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
r_dir_file($1_lockdev_t, lockfile)
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
allow $1_lockdev_t device_t:dir search;
Chris PeBenito 0fbfa5
allow $1_lockdev_t null_device_t:chr_file rw_file_perms;
Chris PeBenito 0fbfa5
access_terminal($1_lockdev_t, $1)
Chris PeBenito 0fbfa5
dontaudit $1_lockdev_t root_t:dir search;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
uses_shlib($1_lockdev_t)
Chris PeBenito 0fbfa5
allow $1_lockdev_t fs_t:filesystem getattr;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
')dnl end macro definition
Chris PeBenito 0fbfa5