summaryrefslogtreecommitdiffstats
path: root/lib/python2.7/site-packages/setools/initsidquery.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python2.7/site-packages/setools/initsidquery.py')
-rwxr-xr-x[-rw-r--r--]lib/python2.7/site-packages/setools/initsidquery.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/python2.7/site-packages/setools/initsidquery.py b/lib/python2.7/site-packages/setools/initsidquery.py
index 1eb3790..aa62edb 100644..100755
--- a/lib/python2.7/site-packages/setools/initsidquery.py
+++ b/lib/python2.7/site-packages/setools/initsidquery.py
@@ -18,11 +18,11 @@
#
import logging
-from . import compquery
-from . import contextquery
+from .mixins import MatchContext, MatchName
+from .query import PolicyQuery
-class InitialSIDQuery(compquery.ComponentQuery, contextquery.ContextQuery):
+class InitialSIDQuery(MatchName, MatchContext, PolicyQuery):
"""
Initial SID (Initial context) query.
@@ -54,15 +54,15 @@ class InitialSIDQuery(compquery.ComponentQuery, contextquery.ContextQuery):
No effect if not using set operations.
"""
+ def __init__(self, policy, **kwargs):
+ super(InitialSIDQuery, self).__init__(policy, **kwargs)
+ self.log = logging.getLogger(__name__)
+
def results(self):
"""Generator which yields all matching initial SIDs."""
- self.log.info("Generating results from {0.policy}".format(self))
- self.log.debug("Name: {0.name!r}, regex: {0.name_regex}".format(self))
- self.log.debug("User: {0.user!r}, regex: {0.user_regex}".format(self))
- self.log.debug("Role: {0.role!r}, regex: {0.role_regex}".format(self))
- self.log.debug("Type: {0.type_!r}, regex: {0.type_regex}".format(self))
- self.log.debug("Range: {0.range_!r}, subset: {0.range_subset}, overlap: {0.range_overlap}, "
- "superset: {0.range_superset}, proper: {0.range_proper}".format(self))
+ self.log.info("Generating initial SID results from {0.policy}".format(self))
+ self._match_name_debug(self.log)
+ self._match_context_debug(self.log)
for i in self.policy.initialsids():
if not self._match_name(i):