aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2024-02-22 17:27:36 +0100
committerKenton Groombridge <concord@gentoo.org>2024-03-01 12:05:35 -0500
commit35167ff4b12c7285fcfed384d4a3bac2ca6eed85 (patch)
tree663fb61e4a8adb7b4375619e6ffcb3f01b950381
parentfix misc typos (diff)
downloadhardened-refpolicy-35167ff4b12c7285fcfed384d4a3bac2ca6eed85.tar.gz
hardened-refpolicy-35167ff4b12c7285fcfed384d4a3bac2ca6eed85.tar.bz2
hardened-refpolicy-35167ff4b12c7285fcfed384d4a3bac2ca6eed85.zip
Support multi-line interface calls
Support splitting the call of an interface over multiple lines, e.g. for interfaces with a long list as argument: term_control_unallocated_ttys(udev_t, { ioctl_kdgkbtype ioctl_kdgetmode ioctl_pio_unimap ioctl_pio_unimapclr ioctl_kdfontop ioctl_tcgets }) Signed-off-by: Christian Göttsche <cgzones@googlemail.com> Signed-off-by: Kenton Groombridge <concord@gentoo.org>
-rw-r--r--policy/support/loadable_module.spt13
1 files changed, 9 insertions, 4 deletions
diff --git a/policy/support/loadable_module.spt b/policy/support/loadable_module.spt
index 1f616305..93e79396 100644
--- a/policy/support/loadable_module.spt
+++ b/policy/support/loadable_module.spt
@@ -53,6 +53,11 @@ define(`policy_m4_comment',`
##### $2 depth: $1
')dnl
+define(NL,`
+')dnl
+
+define(`chomp', `translit(`$1',NL,` ')')dnl
+
##############################
#
# In the future interfaces should be in loadable modules
@@ -63,10 +68,10 @@ define(`template',` dnl
ifdef(`$1',`refpolicyerr(`duplicate definition of $1(). Original definition on '$1.) define(`__if_error')',`define(`$1',__file__:__line__)') dnl
`define(`$1',` dnl
pushdef(`policy_call_depth',incr(policy_call_depth)) dnl
- policy_m4_comment(policy_call_depth,begin `$1'(dollarsstar)) dnl
+ policy_m4_comment(policy_call_depth,begin `$1'(chomp(dollarsstar))) dnl
$2 dnl
popdef(`policy_call_depth') dnl
- policy_m4_comment(policy_call_depth,end `$1'(dollarsstar)) dnl
+ policy_m4_comment(policy_call_depth,end `$1'(chomp(dollarsstar))) dnl
'')
')
@@ -80,10 +85,10 @@ define(`interface',` dnl
ifdef(`$1',`refpolicyerr(`duplicate definition of $1(). Original definition on '$1.) define(`__if_error')',`define(`$1',__file__:__line__)') dnl
`define(`$1',` dnl
pushdef(`policy_call_depth',incr(policy_call_depth)) dnl
- policy_m4_comment(policy_call_depth,begin `$1'(dollarsstar)) dnl
+ policy_m4_comment(policy_call_depth,begin `$1'(chomp(dollarsstar))) dnl
$2 dnl
popdef(`policy_call_depth') dnl
- policy_m4_comment(policy_call_depth,end `$1'(dollarsstar)) dnl
+ policy_m4_comment(policy_call_depth,end `$1'(chomp(dollarsstar))) dnl
'')
')