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 89F2315808B for ; Thu, 31 Mar 2022 03:31:33 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B16B4E0802; Thu, 31 Mar 2022 03:31: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 94785E07D4 for ; Thu, 31 Mar 2022 03:31:27 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (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 3D97C3414D5 for ; Thu, 31 Mar 2022 03:31:25 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 8C53335F for ; Thu, 31 Mar 2022 03:31:23 +0000 (UTC) From: "Jason Zaman" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Jason Zaman" Message-ID: <1648694453.3f7c372e6212f0ab402c6bbd833dd80d1fb50e22.perfinion@gentoo> Subject: [gentoo-commits] proj/hardened-refpolicy:master commit in: / X-VCS-Repository: proj/hardened-refpolicy X-VCS-Files: Rules.monolithic X-VCS-Directories: / X-VCS-Committer: perfinion X-VCS-Committer-Name: Jason Zaman X-VCS-Revision: 3f7c372e6212f0ab402c6bbd833dd80d1fb50e22 X-VCS-Branch: master Date: Thu, 31 Mar 2022 03:31:23 +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: 36f8ac17-5a85-46d6-bd4a-5352e10335ab X-Archives-Hash: a2cfc97434872c5623ef70d770d59e6a commit: 3f7c372e6212f0ab402c6bbd833dd80d1fb50e22 Author: Christian Göttsche googlemail com> AuthorDate: Tue Mar 22 17:10:11 2022 +0000 Commit: Jason Zaman gentoo org> CommitDate: Thu Mar 31 02:40:53 2022 +0000 URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=3f7c372e Rules.monolithic: add target to generate CIL policy Add a Makefile target to generate a CIL policy, useful for debugging, introspection or testing. Signed-off-by: Christian Göttsche googlemail.com> Signed-off-by: Jason Zaman gentoo.org> Rules.monolithic | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Rules.monolithic b/Rules.monolithic index e369f8f3..d6d0e6f2 100644 --- a/Rules.monolithic +++ b/Rules.monolithic @@ -25,6 +25,7 @@ endif polbinpath := $(shell $(binary_policy_path)) policy_conf = $(builddir)policy.conf +policy_cil = $(builddir)policy.cil fc = $(builddir)file_contexts polver = $(builddir)policy.$(pv) homedir_template = $(builddir)homedir_template @@ -83,6 +84,19 @@ ifneq ($(pv),$(kv)) endif $(verbose) $(CHECKPOLICY) -U $(UNK_PERMS) -S -O -E $^ -o $@ +######################################## +# +# Build a CIL policy locally +# +$(policy_cil): $(policy_conf) + @echo "Compiling $(NAME) $(policy_cil)" +ifneq ($(pv),$(kv)) + @echo + @echo "WARNING: Policy version mismatch (policy:$(pv) kernel:$(kv))! Is your OUTPUT_POLICY set correctly?" + @echo +endif + $(verbose) $(CHECKPOLICY) -C -U $(UNK_PERMS) -S -O -E $^ -o $@ + ######################################## # # Install a binary policy @@ -261,6 +275,7 @@ $(installdir)/seusers: $(seusers) clean: $(verbose) rm -f $(policy_conf) $(verbose) rm -f $(polver) + $(verbose) rm -f $(policy_cil) $(verbose) rm -f $(fc) $(verbose) rm -f $(homedir_template) $(verbose) rm -f $(net_contexts) $(net_contexts_nft)