sepolicy: info() should provide attributes for a TYPE

"attributes" used to be there when sepolicy.info() used setools3

Signed-off-by: Petr Lautrbach <plautrba@redhat.com>
This commit is contained in:
Petr Lautrbach 2017-05-03 12:30:35 +02:00 committed by Stephen Smalley
parent 89399a9c8e
commit 11e9676ce1
2 changed files with 3 additions and 2 deletions

View File

@ -171,6 +171,7 @@ def info(setype, name=None):
'aliases': map(str, x.aliases()),
'name': str(x),
'permissive': bool(x.ispermissive),
'attributes': map(str, x.attributes())
} for x in q.results())
elif setype == ROLE:

View File

@ -494,7 +494,7 @@ class ManPage:
self.desc = "%s user role" % self.domainname
if self.domainname in self.all_users:
self.attributes = sepolicy.info(sepolicy.TYPE, (self.type))[0]["attributes"]
self.attributes = next(sepolicy.info(sepolicy.TYPE, (self.type)))["attributes"]
self._user_header()
self._user_attribute()
self._can_sudo()
@ -539,7 +539,7 @@ class ManPage:
self.man_page_path = man_page_path
except KeyError:
continue;
self.attributes[domain_type] = sepolicy.info(sepolicy.TYPE, ("%s") % domain_type)[0]["attributes"]
self.attributes[domain_type] = next(sepolicy.info(sepolicy.TYPE, ("%s") % domain_type))["attributes"]
self._header()
self._entrypoints()