mirror of
https://github.com/SELinuxProject/selinux
synced 2025-02-20 03:26:53 +00:00
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:
parent
89399a9c8e
commit
11e9676ce1
@ -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:
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user