aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2024-02-22 17:32:50 +0100
committerKenton Groombridge <concord@gentoo.org>2024-03-01 12:05:38 -0500
commit70c06276d352e4513bd68ca085b07e5e2d8e6205 (patch)
tree8779a368a2cfb9692f39655f356a3497891ad796
parentpolicy_capabilities: remove estimated from released versions (diff)
downloadhardened-refpolicy-70c06276d352e4513bd68ca085b07e5e2d8e6205.tar.gz
hardened-refpolicy-70c06276d352e4513bd68ca085b07e5e2d8e6205.tar.bz2
hardened-refpolicy-70c06276d352e4513bd68ca085b07e5e2d8e6205.zip
Rules.monolithic: pre-compile fcontexts on install
On install pre-compile the file contexts. Signed-off-by: Christian Göttsche <cgzones@googlemail.com> Signed-off-by: Kenton Groombridge <concord@gentoo.org>
-rw-r--r--Makefile1
-rw-r--r--Rules.monolithic6
2 files changed, 7 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index b93e133b..3f1d3060 100644
--- a/Makefile
+++ b/Makefile
@@ -64,6 +64,7 @@ SEMOD_EXP ?= $(tc_usrbindir)/semodule_expand
LOADPOLICY ?= $(tc_usrsbindir)/load_policy
SEPOLGEN_IFGEN ?= $(tc_usrbindir)/sepolgen-ifgen
SETFILES ?= $(tc_sbindir)/setfiles
+SEFCONTEXT_COMPILE ?= $(tc_usrsbindir)/sefcontext_compile
XMLLINT ?= $(BINDIR)/xmllint
SECHECK ?= $(BINDIR)/sechecker
diff --git a/Rules.monolithic b/Rules.monolithic
index d6d0e6f2..d6e20a37 100644
--- a/Rules.monolithic
+++ b/Rules.monolithic
@@ -232,6 +232,12 @@ $(fcpath): $(fc) $(loadpath) $(userpath)/system.users
$(verbose) $(INSTALL) -m 0644 $(fc) $(fcpath)
$(verbose) $(INSTALL) -m 0644 $(homedir_template) $(homedirpath)
$(verbose) $(UMASK) 022 ; $(genhomedircon) -d $(topdir) -t $(NAME)
+ $(verbose) if $(SEFCONTEXT_COMPILE) -i > /dev/null 2>&1 ; then \
+ $(SEFCONTEXT_COMPILE) $(fcpath) ;\
+ $(SEFCONTEXT_COMPILE) $(fcpath).homedirs ;\
+ else \
+ echo "$@ Pre-compiled file context not generated! Please install the sefcontext_compile tool (commonly part of libselinux-utils)." ;\
+ fi
########################################
#