From ea5333d1f9b8fb65313b13e4c1018b159fa08057 Mon Sep 17 00:00:00 2001 From: Chris PeBenito Date: Tue, 2 May 2006 20:14:41 +0000 Subject: [PATCH] add target for validating module linking, bug 1276 --- refpolicy/Changelog | 1 + refpolicy/Makefile | 2 ++ refpolicy/README | 3 +++ refpolicy/Rules.modular | 12 +++++++++++- 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/refpolicy/Changelog b/refpolicy/Changelog index 21350484..1fdb9841 100644 --- a/refpolicy/Changelog +++ b/refpolicy/Changelog @@ -1,3 +1,4 @@ +- Add Make target to validate module linking. - Make duplicate template and interface declarations a fatal error. - Patch to stabilize modules.conf `make conf` output, from Erich Schubert. - Move xconsole_device_t from devices to xserver since it is diff --git a/refpolicy/Makefile b/refpolicy/Makefile index 74331cc1..cb9c184e 100644 --- a/refpolicy/Makefile +++ b/refpolicy/Makefile @@ -50,6 +50,8 @@ CHECKPOLICY := $(BINDIR)/checkpolicy CHECKMODULE := $(BINDIR)/checkmodule SEMODULE := $(SBINDIR)/semodule SEMOD_PKG := $(BINDIR)/semodule_package +SEMOD_LNK := $(BINDIR)/semodule_link +SEMOD_EXP := $(BINDIR)/semodule_expand LOADPOLICY := $(SBINDIR)/load_policy SETFILES := $(SBINDIR)/setfiles GENHOMEDIRCON := $(SBINDIR)/genhomedircon diff --git a/refpolicy/README b/refpolicy/README index db9e3d15..3bf21ffc 100644 --- a/refpolicy/README +++ b/refpolicy/README @@ -50,6 +50,9 @@ load Compile, package, and install the base module and loadable modules, then insert them into the module store. +validate Validate if the configured modules can successfully + link and expand. + Make targets specific to monolithic policies: policy Compile a policy locally for development and testing. diff --git a/refpolicy/Rules.modular b/refpolicy/Rules.modular index 7fd21a83..d877c361 100644 --- a/refpolicy/Rules.modular +++ b/refpolicy/Rules.modular @@ -213,6 +213,16 @@ $(APPDIR)/customizable_types: $(BASE_CONF) $(verbose) $(GREP) '^[[:blank:]]*type .*customizable' $< | cut -d';' -f1 | cut -d',' -f1 | cut -d' ' -f2 | $(SORT) -u > $(TMPDIR)/customizable_types $(verbose) install -m 644 $(TMPDIR)/customizable_types $@ +######################################## +# +# Validate linking and expanding of modules +# +validate: $(BASE_PKG) $(MOD_PKGS) + @echo "Validating policy linking." + $(verbose) $(SEMOD_LNK) -o $(TMPDIR)/test.lnk $^ + $(verbose) $(SEMOD_EXP) $(TMPDIR)/test.lnk $(TMPDIR)/policy.bin + @echo "Success." + ######################################## # # Clean the sources @@ -223,4 +233,4 @@ clean: rm -f $(BUILDDIR)*.pp rm -fR $(TMPDIR) -.PHONY: default all policy base modules install load clean +.PHONY: default all policy base modules install load clean validate