mirror of
https://github.com/SELinuxProject/setools
synced 2025-03-25 04:26:28 +00:00
Leverage new libqpol function for getting object class from role trans.
This commit is contained in:
parent
3f90e48677
commit
10e07c472a
@ -30,9 +30,7 @@ class RBACRule(rule.PolicyRule):
|
|||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
try:
|
try:
|
||||||
# qpol doesnt currently support role transitons
|
return "role_transition {0.source} {0.target}:{0.tclass} {0.default};".format(self)
|
||||||
# with an object class specified (v26+)
|
|
||||||
return "role_transition {0.source} {0.target} {0.default};".format(self)
|
|
||||||
except rule.InvalidRuleUse:
|
except rule.InvalidRuleUse:
|
||||||
return "allow {0.source} {0.target};".format(self)
|
return "allow {0.source} {0.target};".format(self)
|
||||||
|
|
||||||
@ -63,12 +61,8 @@ class RBACRule(rule.PolicyRule):
|
|||||||
@property
|
@property
|
||||||
def tclass(self):
|
def tclass(self):
|
||||||
"""The rule's object class."""
|
"""The rule's object class."""
|
||||||
# qpol doesnt currently support role transitions
|
|
||||||
# with an object class specified (v26+)
|
|
||||||
raise NotImplementedError
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return objclass.ObjClass(self.policy, self.qpol_symbol.get_target_class(self.policy))
|
return objclass.ObjClass(self.policy, self.qpol_symbol.get_object_class(self.policy))
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
raise rule.InvalidRuleUse(
|
raise rule.InvalidRuleUse(
|
||||||
"Role allow rules do not have an object class.")
|
"Role allow rules do not have an object class.")
|
||||||
|
Loading…
Reference in New Issue
Block a user