diff options
author | Oleksii Miroshko <oleksii.miroshko@bmw.de> | 2022-12-15 09:05:28 +0100 |
---|---|---|
committer | Kenton Groombridge <concord@gentoo.org> | 2023-02-13 10:19:26 -0500 |
commit | 5f5e11b22bbcecf05ef2f4b6d1aac6c624f6584e (patch) | |
tree | e7a1fbe4b97260dd7a054f824ac1f2084fdc854b /support | |
parent | Update generated policy and doc files (diff) | |
download | hardened-refpolicy-5f5e11b22bbcecf05ef2f4b6d1aac6c624f6584e.tar.gz hardened-refpolicy-5f5e11b22bbcecf05ef2f4b6d1aac6c624f6584e.tar.bz2 hardened-refpolicy-5f5e11b22bbcecf05ef2f4b6d1aac6c624f6584e.zip |
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>
Signed-off-by: Kenton Groombridge <concord@gentoo.org>
Diffstat (limited to 'support')
-rwxr-xr-x | support/gentemplates.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/support/gentemplates.sh b/support/gentemplates.sh index 7f20505e..f28debd3 100755 --- a/support/gentemplates.sh +++ b/support/gentemplates.sh @@ -57,6 +57,6 @@ fi for ifile in $(find ${SOURCEDIR} -type f -name '*.if'); do for interface in $(grep -E '^template\(' ${ifile} | sed -e 's:^template(`\([^'\'']*\)'\''\s*,\s*`:\1:g'); do # Generate the interface - sed -n "/^template(\`${interface}',\`/,/^')/p" ${ifile} | grep -v "^template" | grep -v "^')" > ${TARGETDIR}/${interface}.iftemplate; + sed -n "/^template(\`${interface}',\s*\`/,/^')/p" ${ifile} | grep -v "^template" | grep -v "^')" > ${TARGETDIR}/${interface}.iftemplate; done done |