Skip to contentSkip to conversation

modules.conf "stability" by sorting entries in "make conf"

PATCH Erich Schubert 2 participants 2 messages Apr 17, 2006 SELinux security module

lore
Share & tools
lore
#0 lore raw

Hi,
attached is a tiny patch to refpolicy/support/segenxml.py which will sort module files before processing, so when you create a "modules.conf" file via "make conf", the entries will be sorted.

Right now, the ordering depends on your filesystem, which makes diffs (and especially merging) between modules.conf files unnecessary hard.

P.S.
Since sourceforge anon CVS is still broken, you can grab the current CVS via Debians subversion (thanks to Christopher for giving me RO access to the 'real' sourceforge.net cvs via ssh), or browse it at
http://svn.debian.org/wsvn/selinux/refpolicy/branches/upstream/
The upstream branch is the unmodified checkout from CVS; the CVS dirs are there intentionally, but not up to date (since I want to keep them pointing to SF anon cvs, so anyone can update this branch). I guess CVS will be smart enough to merge identical changes once sourceforge anon cvs is updated again; so you should be able to run "cvs up" again afterwards.

best regards,
Erich Schubert

Signature · 4 lines
   erich@(vitavonni.de|debian.org)    --    GPG Key ID: 4B3A135C    (o_
     Which is worse: ignorance or apathy? Who knows? Who cares?     //\
            Es lohnt sich nicht, die Augen aufzumachen,             V_/_
                   wenn der Kopf im Sand steckt.
segenxml.py +3 -1
Index: support/segenxml.py
===================================================================
@@ -214,7 +214,9 @@
 	
 	# For each module file in the layer, add its XML.
 	for directory in directories:
-		for module in glob.glob("%s/*.if" % directory):
+		modules = glob.glob("%s/*.if" % directory)
+		modules.sort()
+		for module in modules:
 			layer_buf += getModuleXML(module)
 
 	layer_buf.append("</layer>\n")
#1 lore raw
Quoted 7 lines · Erich Schubert

Hi,
attached is a tiny patch to refpolicy/support/segenxml.py which will sort module files before processing, so when you create a "modules.conf" file via "make conf", the entries will be sorted.

Right now, the ordering depends on your filesystem, which makes diffs (and especially merging) between modules.conf files unnecessary hard.

Merged.

Signature · 9 lines
Chris PeBenito
Tresys Technology, LLC
(410) 290-1411 x150


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.