[selinux-policy: 471/3172] support for global booleans

Daniel J Walsh dwalsh at fedoraproject.org
Thu Oct 7 19:45:23 UTC 2010


commit c11958bd0f239e42a0bdc835f3b734521e35bc1d
Author: Chris PeBenito <cpebenito at tresys.com>
Date:   Fri Jul 8 14:22:17 2005 +0000

    support for global booleans

 refpolicy/doc/policy.dtd      |    6 +++++-
 refpolicy/support/segenxml.py |    8 +++++---
 2 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/refpolicy/doc/policy.dtd b/refpolicy/doc/policy.dtd
index b415fd4..4cffe9f 100644
--- a/refpolicy/doc/policy.dtd
+++ b/refpolicy/doc/policy.dtd
@@ -1,6 +1,6 @@
 <!ENTITY  % inline.class  "pre|p|ul|li">
 
-<!ELEMENT policy (layer+,tunable*)>
+<!ELEMENT policy (layer+,(tunable|boolean)*)>
 <!ELEMENT layer (summary,module+)>
 <!ATTLIST layer
       name CDATA #REQUIRED>
@@ -14,6 +14,10 @@
 <!ATTLIST tunable
       name CDATA #REQUIRED
       dftval CDATA #REQUIRED>
+<!ELEMENT boolean (#PCDATA)>
+<!ATTLIST boolean
+      name CDATA #REQUIRED
+      dftval CDATA #REQUIRED>
 <!ELEMENT summary (#PCDATA)>
 <!ELEMENT interface (summary?,desc?,secdesc?,param+,infoflow?)>
 <!ATTLIST interface name CDATA #REQUIRED>
diff --git a/refpolicy/support/segenxml.py b/refpolicy/support/segenxml.py
index 407dae6..7222249 100755
--- a/refpolicy/support/segenxml.py
+++ b/refpolicy/support/segenxml.py
@@ -279,20 +279,22 @@ def getTunableXML(file_name):
 
 		# Get the parameters of a TUNABLE style line.
 		params = getParams(line,TUNABLE)
+		tag = "tunable"
 
 		# If the line is not a TUNABLE style declaration, try BOOLEAN.
 		if not params:
 			params = getParams(line,BOOLEAN)
+			tag = "boolean"
 
 		# If the line is one of the two styles above, add a tunable tag
 		# and give it the data from the temprorary buffer.
 		if params:
 			tunable_buf.append\
-				("<tunable name=\"%s\" dftval=\"%s\">\n"
-				% (params[0], params[1]))
+				("<%s name=\"%s\" dftval=\"%s\">\n"
+				% (tag, params[0], params[1]))
 			tunable_buf += temp_buf
 			temp_buf = []
-			tunable_buf.append("</tunable>\n")
+			tunable_buf.append("</%s>\n" % tag)
 
 	# If there are XML comments at the end of the file, they arn't
 	# attributed to anything. These are ignored.


More information about the scm-commits mailing list