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