selinux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Serge E. Hallyn" <serue@us.ibm.com>
To: Daniel J Walsh <dwalsh@redhat.com>
Cc: "Christopher J. PeBenito" <cpebenito@tresys.com>,
	SELinux Mail List <selinux@tycho.nsa.gov>
Subject: [PATCH] Re: ANN: Reference Policy Release
Date: Wed, 21 Dec 2005 19:25:51 -0600	[thread overview]
Message-ID: <20051222012551.GA7585@sergelap.austin.ibm.com> (raw)
In-Reply-To: <43A30097.2020701@redhat.com>

Quoting Daniel J Walsh (dwalsh@redhat.com):
> Serge E. Hallyn wrote:
> >Hmm, I'm trying to compile this as a modular policy.  I've selected
> >"nis = off" in my modules.conf.  But I get
> >
> >	policy/modules/admin/netutils.te:88:ERROR 'syntax error' at token
> >	'nis_use_ypbind' on line 33005:
> >	#line 88
> >		nis_use_ypbind(netutils_t)
> >
> >when I try 'make load'.
> >
> >Is this me misunderstanding how I can use modules.conf, or is
> >the module policy mostly unsupported?  (I'm happy to help get it
> >working, just am not sure how it's supposed to work now :)  My first
> >instinct of course is that the "optional_policy" macro in
> >policy/support/loadable_module.spt would need to be more complicated
> >to handle using modules.conf...  But man that's one ugly macro.
> >  
> Looks like this should be optional.

Right :)  I just had no idea how it was meant to be implemented.

The following patch is one way of implementing the optional_policy
macro for policy modules.  Likely not the best, but I can now
do a full 'make modules'.

thanks,
-serge

Index: refpolicy/Rules.modular
===================================================================
--- refpolicy.orig/Rules.modular	2005-12-21 17:15:50.000000000 -0600
+++ refpolicy/Rules.modular	2005-12-21 18:48:49.000000000 -0600
@@ -37,7 +37,12 @@ all: base modules
 
 base: $(BASE_PKG)
 
-modules: $(MOD_PKGS)
+active_modules: $(MOD_CONF)
+	echo $(MOD_MODS) | sed -e 's/ /\n/g' \
+		| sed -e 's/^\(.*\)$$/define(`\1\x27,1)/' \
+		> active_modules
+
+modules: active_modules $(MOD_PKGS)
 
 install: $(INSTPKG) $(APPFILES)
 
@@ -62,7 +67,7 @@ $(MODPKGDIR)/%.pp: %.pp
 #
 # Build module packages
 #
-tmp/%.mod: $(M4SUPPORT) tmp/generated_definitions.conf tmp/all_interfaces.conf %.te
+tmp/%.mod: active_modules $(M4SUPPORT) tmp/generated_definitions.conf tmp/all_interfaces.conf %.te
 	@echo "Compliling $(NAME) $(@F) module"
 	$(QUIET) m4 $(M4PARAM) -s $^ > $(@:.mod=.tmp)
 	$(QUIET) $(CHECKMODULE) -m $(@:.mod=.tmp) -o $@
@@ -186,5 +191,6 @@ clean:
 	rm -f *.pp
 	rm -f $(BASE_FC)
 	rm -fR tmp
+	rm -f active_modules
 
 .PHONY: default all base modules install load clean
Index: refpolicy/policy/support/loadable_module.spt
===================================================================
--- refpolicy.orig/policy/support/loadable_module.spt	2005-12-21 17:15:59.000000000 -0600
+++ refpolicy/policy/support/loadable_module.spt	2005-12-21 18:45:56.000000000 -0600
@@ -86,17 +86,7 @@ define(`policy_call_depth',0)
 # Optional policy handling
 #
 define(`optional_policy',`
-	ifdef(`self_contained_policy',`
-		ifdef(`$1.te',`$2',`$3')
-	',`
-		optional {
-			$2
-		ifelse(`$3',`',`',`
-		} else {
-			$3
-		')
-		}
-	')
+	ifdef(`$1.te',`$2',`$3')
 ')
 
 ##############################

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

  reply	other threads:[~2005-12-22  1:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-07 16:40 ANN: Reference Policy Release Christopher J. PeBenito
2005-12-15 22:28 ` Serge E. Hallyn
2005-12-16 17:59   ` Daniel J Walsh
2005-12-22  1:25     ` Serge E. Hallyn [this message]
2005-12-18 23:20   ` Serge E. Hallyn
2006-01-03 15:48   ` Christopher J. PeBenito

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20051222012551.GA7585@sergelap.austin.ibm.com \
    --to=serue@us.ibm.com \
    --cc=cpebenito@tresys.com \
    --cc=dwalsh@redhat.com \
    --cc=selinux@tycho.nsa.gov \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).