From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 991CC15800F for ; Mon, 13 Feb 2023 15:35:30 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C6ECDE0798; Mon, 13 Feb 2023 15:35:29 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id ADF58E0798 for ; Mon, 13 Feb 2023 15:35:29 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 96388335D3B for ; Mon, 13 Feb 2023 15:35:28 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id B7BC88AA for ; Mon, 13 Feb 2023 15:35:26 +0000 (UTC) From: "Kenton Groombridge" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Kenton Groombridge" Message-ID: <1676301566.5f5e11b22bbcecf05ef2f4b6d1aac6c624f6584e.concord@gentoo> Subject: [gentoo-commits] proj/hardened-refpolicy:master commit in: support/ X-VCS-Repository: proj/hardened-refpolicy X-VCS-Files: support/gentemplates.sh X-VCS-Directories: support/ X-VCS-Committer: concord X-VCS-Committer-Name: Kenton Groombridge X-VCS-Revision: 5f5e11b22bbcecf05ef2f4b6d1aac6c624f6584e X-VCS-Branch: master Date: Mon, 13 Feb 2023 15:35:26 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: eaf5799c-fc56-42f9-8931-a7f06401da70 X-Archives-Hash: c06d13f0599fee6ef070b54816fcdae1 commit: 5f5e11b22bbcecf05ef2f4b6d1aac6c624f6584e Author: Oleksii Miroshko bmw de> AuthorDate: Thu Dec 15 08:05:28 2022 +0000 Commit: Kenton Groombridge gentoo org> CommitDate: Mon Feb 13 15:19:26 2023 +0000 URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=5f5e11b2 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 bmw.de> Signed-off-by: Kenton Groombridge gentoo.org> support/gentemplates.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/support/gentemplates.sh b/support/gentemplates.sh index 7f20505ee..f28debd3d 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