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.