selinux-policy/refpolicy/policy/support/loadable_module.spt

61 lines
995 B
Cheetah
Raw Normal View History

########################################
#
# Macros for switching between source policy
# and loadable policy module support
#
##############################
#
# For adding the module statement
#
define(`policy_module',`
ifdef(`monolithic_policy',`',`
module $1 $2;
')
')
##############################
#
# For use in interfaces, to optionally insert a requires block
#
define(`requires_block_template',`
ifdef(`monolithic_policy',`',`
require {
$1
}
') dnl end ifdef monolithic_policy
') dnl end requires_block_template
##############################
#
# Optional policy handling
#
define(`optional_policy',`
ifdef(`monolithic_policy',`
ifdef(`$1',$2,$3)
',`
optional {
$2
} else {
$3
}
') dnl end ifdef monolithic_policy
') dnl end optional_policy
##############################
#
# Tunable policy handling
#
define(`tunable_policy',`
ifdef(`monolithic_policy',`
ifdef(`$1',$2,$3)
',`
optional {
require { $1 }
$2
} else {
$3
}
') dnl end ifdef monolithic_policy
') dnl end tunable_policy