mirror of
https://github.com/SELinuxProject/setools
synced 2025-04-01 14:48:07 +00:00
InitialSID: Refactor to load attributes on construction.
This commit is contained in:
parent
f1d8e4aef6
commit
bfdb1e66d8
@ -39,14 +39,15 @@ cdef class InitialSID(Ocontext):
|
|||||||
|
|
||||||
"""An initial SID statement."""
|
"""An initial SID statement."""
|
||||||
|
|
||||||
cdef str name
|
cdef readonly str name
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
cdef factory(SELinuxPolicy policy, sepol.ocontext *symbol):
|
cdef inline InitialSID factory(SELinuxPolicy policy, sepol.ocontext *symbol):
|
||||||
"""Factory function for creating InitialSID objects."""
|
"""Factory function for creating InitialSID objects."""
|
||||||
i = InitialSID()
|
cdef InitialSID i = InitialSID.__new__(InitialSID)
|
||||||
i.policy = policy
|
i.policy = policy
|
||||||
i.handle = symbol
|
i.key = <uintptr_t>symbol
|
||||||
|
i.context = Context.factory(policy, symbol.context)
|
||||||
|
|
||||||
if symbol.u.name:
|
if symbol.u.name:
|
||||||
i.name = intern(symbol.u.name)
|
i.name = intern(symbol.u.name)
|
||||||
|
Loading…
Reference in New Issue
Block a user