Commit Graph

2 Commits

Author SHA1 Message Date
Oleksii Miroshko
43f3608f0e Fix templates parsing in gentemplates.sh
Template definitions might have a whitespace after
the comma, e.g. su_restricted_domain_template
in /policy/modules/admin/su.if

template(`su_restricted_domain_template', `
  ...
')

gentemplates.sh silently fails to parse it. This works
unless 'set -e' is set, in which case the script fails
non-silently.

This commit adds support of whitespace after comma, which
is a valid syntax.

Signed-off-by: Oleksii Miroshko <oleksii.miroshko@bmw.de>
2022-12-15 14:47:46 +01:00
Sven Vermeulen
9d8bb4eb93 Add gentemplates.sh to extract template content
Some of the templates in the reference policy generate new booleans and
tunables, based on the $1, $2, ... parameters passed on. To allow
segenxml, which generates the necessary documentation on booleans, to
keep track of template-generated booleans as well, we need to allow it
to substitute template calls with the actual template content.

The gentemplates.sh script is a helper script that will extract template
code and store it as files (one file per template). These files are then
later on used by the segenxml tool.

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2018-06-10 13:23:01 -04:00