[selinux-policy: 554/3172] fix no interface module handling in segenxml

Daniel J Walsh dwalsh at fedoraproject.org
Thu Oct 7 19:52:30 UTC 2010


commit e694b51e6b36af5e61298d0c8db30515bc57c702
Author: Chris PeBenito <cpebenito at tresys.com>
Date:   Thu Aug 11 14:55:41 2005 +0000

    fix no interface module handling in segenxml

 refpolicy/Changelog           |    1 +
 refpolicy/support/segenxml.py |    6 +++++-
 2 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/refpolicy/Changelog b/refpolicy/Changelog
index 5306a99..a78314e 100644
--- a/refpolicy/Changelog
+++ b/refpolicy/Changelog
@@ -1,3 +1,4 @@
+	* Fix segenxml to handle modules with no interfaces.
 	* Rename ipsec connect interface for consistency.
 	* Add missing parts of unix stream socket connect interface
 	  of ipsec.
diff --git a/refpolicy/support/segenxml.py b/refpolicy/support/segenxml.py
index 7222249..43a40fd 100755
--- a/refpolicy/support/segenxml.py
+++ b/refpolicy/support/segenxml.py
@@ -215,9 +215,13 @@ def getModuleXML(file_name):
 				temp_buf = []
 				module_buf.append("</template>\n")
 
+	# The file had no interfaces, just a header.
+	if phase == "get header":
+		module_buf += temp_buf
+
 	# If there are XML comments at the end of the file, they arn't
 	# attributed to anything. These are ignored.
-	if len(temp_buf):
+	elif len(temp_buf):
 		warning("orphan XML comments at bottom of file %s" % file_name)
 		
 	module_buf.append("</module>\n")


More information about the scm-commits mailing list