Signed-off-by: Jason Zaman <ja...@perfinion.com>
---
 policycoreutils/sepolicy/sepolicy/__init__.py | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/policycoreutils/sepolicy/sepolicy/__init__.py 
b/policycoreutils/sepolicy/sepolicy/__init__.py
index 4d9d6ad..f24750a 100644
--- a/policycoreutils/sepolicy/sepolicy/__init__.py
+++ b/policycoreutils/sepolicy/sepolicy/__init__.py
@@ -2,9 +2,11 @@
 
 # Author: Dan Walsh <dwa...@redhat.com>
 # Author: Ryan Hallisey <rhall...@redhat.com>
+# Author: Jason Zaman <perfin...@gentoo.org>
 
 from . import _policy
 import selinux
+import setools
 import glob
 import sepolgen.defaults as defaults
 import sepolgen.interfaces as interfaces
@@ -31,13 +33,13 @@ except:
         import __builtin__
         __builtin__.__dict__['_'] = unicode
 
-TYPE = _policy.TYPE
-ROLE = _policy.ROLE
-ATTRIBUTE = _policy.ATTRIBUTE
-PORT = _policy.PORT
-USER = _policy.USER
-BOOLEAN = _policy.BOOLEAN
-TCLASS = _policy.CLASS
+TYPE = 1
+ROLE = 2
+ATTRIBUTE = 3
+PORT = 4
+USER = 5
+BOOLEAN = 6
+TCLASS = 7
 
 ALLOW = 'allow'
 AUDITALLOW = 'auditallow'
@@ -88,6 +90,9 @@ trans_file_type_str["-s"] = "s"
 trans_file_type_str["-l"] = "l"
 trans_file_type_str["-p"] = "p"
 
+# the setools policy handle
+_pol = None
+
 # cache the lookup results
 file_equiv_modified = None
 file_equiv = None
@@ -145,6 +150,7 @@ def policy(policy_file):
 
     try:
         _policy.policy(policy_file)
+        _pol = setools.SELinuxPolicy(policy_file)
     except:
         raise ValueError(_("Failed to read %s policy file") % policy_file)
 
-- 
2.7.3

_______________________________________________
Selinux mailing list
Selinux@tycho.nsa.gov
To unsubscribe, send email to selinux-le...@tycho.nsa.gov.
To get help, send an email containing "help" to selinux-requ...@tycho.nsa.gov.

Reply via email to