mirror of
https://github.com/SELinuxProject/setools
synced 2025-04-01 00:06:19 +00:00
SELinuxPolicy: Make sure internal methods have underscore prefix.
This commit is contained in:
parent
47f2f59dbc
commit
ce1f6ecc9f
@ -101,25 +101,25 @@ cdef class SELinuxPolicy:
|
|||||||
@property
|
@property
|
||||||
def allow_count(self):
|
def allow_count(self):
|
||||||
"""The number of (type) allow rules."""
|
"""The number of (type) allow rules."""
|
||||||
self.cache_terule_counts()
|
self._cache_terule_counts()
|
||||||
return self.terule_counts[TERuletype.allow.value]
|
return self.terule_counts[TERuletype.allow.value]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def allowxperm_count(self):
|
def allowxperm_count(self):
|
||||||
"""The number of allowxperm rules."""
|
"""The number of allowxperm rules."""
|
||||||
self.cache_terule_counts()
|
self._cache_terule_counts()
|
||||||
return self.terule_counts[TERuletype.allowxperm.value]
|
return self.terule_counts[TERuletype.allowxperm.value]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def auditallow_count(self):
|
def auditallow_count(self):
|
||||||
"""The number of auditallow rules."""
|
"""The number of auditallow rules."""
|
||||||
self.cache_terule_counts()
|
self._cache_terule_counts()
|
||||||
return self.terule_counts[TERuletype.auditallow.value]
|
return self.terule_counts[TERuletype.auditallow.value]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def auditallowxperm_count(self):
|
def auditallowxperm_count(self):
|
||||||
"""The number of auditallowxperm rules."""
|
"""The number of auditallowxperm rules."""
|
||||||
self.cache_terule_counts()
|
self._cache_terule_counts()
|
||||||
return self.terule_counts[TERuletype.auditallowxperm.value]
|
return self.terule_counts[TERuletype.auditallowxperm.value]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -150,7 +150,7 @@ cdef class SELinuxPolicy:
|
|||||||
@property
|
@property
|
||||||
def constraint_count(self):
|
def constraint_count(self):
|
||||||
"""The number of standard constraints."""
|
"""The number of standard constraints."""
|
||||||
self.cache_constraint_counts()
|
self._cache_constraint_counts()
|
||||||
return self.constraint_counts[ConstraintRuletype.constrain]
|
return self.constraint_counts[ConstraintRuletype.constrain]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -166,13 +166,13 @@ cdef class SELinuxPolicy:
|
|||||||
@property
|
@property
|
||||||
def dontaudit_count(self):
|
def dontaudit_count(self):
|
||||||
"""The number of dontaudit rules."""
|
"""The number of dontaudit rules."""
|
||||||
self.cache_terule_counts()
|
self._cache_terule_counts()
|
||||||
return self.terule_counts[TERuletype.dontaudit.value]
|
return self.terule_counts[TERuletype.dontaudit.value]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def dontauditxperm_count(self):
|
def dontauditxperm_count(self):
|
||||||
"""The number of dontauditxperm rules."""
|
"""The number of dontauditxperm rules."""
|
||||||
self.cache_terule_counts()
|
self._cache_terule_counts()
|
||||||
return self.terule_counts[TERuletype.dontauditxperm.value]
|
return self.terule_counts[TERuletype.dontauditxperm.value]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -208,13 +208,13 @@ cdef class SELinuxPolicy:
|
|||||||
@property
|
@property
|
||||||
def mlsconstraint_count(self):
|
def mlsconstraint_count(self):
|
||||||
"""The number of MLS constraints."""
|
"""The number of MLS constraints."""
|
||||||
self.cache_constraint_counts()
|
self._cache_constraint_counts()
|
||||||
return self.constraint_counts[ConstraintRuletype.mlsconstrain]
|
return self.constraint_counts[ConstraintRuletype.mlsconstrain]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def mlsvalidatetrans_count(self):
|
def mlsvalidatetrans_count(self):
|
||||||
"""The number of MLS validatetrans."""
|
"""The number of MLS validatetrans."""
|
||||||
self.cache_constraint_counts()
|
self._cache_constraint_counts()
|
||||||
return self.constraint_counts[ConstraintRuletype.mlsvalidatetrans]
|
return self.constraint_counts[ConstraintRuletype.mlsvalidatetrans]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -225,13 +225,13 @@ cdef class SELinuxPolicy:
|
|||||||
@property
|
@property
|
||||||
def neverallow_count(self):
|
def neverallow_count(self):
|
||||||
"""The number of neverallow rules."""
|
"""The number of neverallow rules."""
|
||||||
self.cache_terule_counts()
|
self._cache_terule_counts()
|
||||||
return self.terule_counts[TERuletype.neverallow.value]
|
return self.terule_counts[TERuletype.neverallow.value]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def neverallowxperm_count(self):
|
def neverallowxperm_count(self):
|
||||||
"""The number of neverallowxperm rules."""
|
"""The number of neverallowxperm rules."""
|
||||||
self.cache_terule_counts()
|
self._cache_terule_counts()
|
||||||
return self.terule_counts[TERuletype.neverallowxperm.value]
|
return self.terule_counts[TERuletype.neverallowxperm.value]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -297,7 +297,7 @@ cdef class SELinuxPolicy:
|
|||||||
@property
|
@property
|
||||||
def type_change_count(self):
|
def type_change_count(self):
|
||||||
"""The number of type_change rules."""
|
"""The number of type_change rules."""
|
||||||
self.cache_terule_counts()
|
self._cache_terule_counts()
|
||||||
return self.terule_counts[TERuletype.type_change.value]
|
return self.terule_counts[TERuletype.type_change.value]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -308,13 +308,13 @@ cdef class SELinuxPolicy:
|
|||||||
@property
|
@property
|
||||||
def type_member_count(self):
|
def type_member_count(self):
|
||||||
"""The number of type_member rules."""
|
"""The number of type_member rules."""
|
||||||
self.cache_terule_counts()
|
self._cache_terule_counts()
|
||||||
return self.terule_counts[TERuletype.type_member.value]
|
return self.terule_counts[TERuletype.type_member.value]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def type_transition_count(self):
|
def type_transition_count(self):
|
||||||
"""The number of type_transition rules."""
|
"""The number of type_transition rules."""
|
||||||
self.cache_terule_counts()
|
self._cache_terule_counts()
|
||||||
return self.terule_counts[TERuletype.type_transition.value]
|
return self.terule_counts[TERuletype.type_transition.value]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -329,7 +329,7 @@ cdef class SELinuxPolicy:
|
|||||||
@property
|
@property
|
||||||
def validatetrans_count(self):
|
def validatetrans_count(self):
|
||||||
"""The number of validatetrans."""
|
"""The number of validatetrans."""
|
||||||
self.cache_constraint_counts()
|
self._cache_constraint_counts()
|
||||||
return self.constraint_counts[ConstraintRuletype.validatetrans]
|
return self.constraint_counts[ConstraintRuletype.validatetrans]
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -973,12 +973,12 @@ cdef class SELinuxPolicy:
|
|||||||
tmp_name = NULL
|
tmp_name = NULL
|
||||||
tmp_type = NULL
|
tmp_type = NULL
|
||||||
|
|
||||||
cdef cache_constraint_counts(self):
|
cdef _cache_constraint_counts(self):
|
||||||
"""Count all constraints in one iteration."""
|
"""Count all constraints in one iteration."""
|
||||||
if not self.constraint_counts:
|
if not self.constraint_counts:
|
||||||
self.constraint_counts = collections.Counter(r.ruletype for r in self.constraints())
|
self.constraint_counts = collections.Counter(r.ruletype for r in self.constraints())
|
||||||
|
|
||||||
cdef cache_terule_counts(self):
|
cdef _cache_terule_counts(self):
|
||||||
"""Count all TE rules in one iteration."""
|
"""Count all TE rules in one iteration."""
|
||||||
if not self.terule_counts:
|
if not self.terule_counts:
|
||||||
self.terule_counts = TERuleIterator.factory(self, &self.handle.p.te_avtab).ruletype_count()
|
self.terule_counts = TERuleIterator.factory(self, &self.handle.p.te_avtab).ruletype_count()
|
||||||
|
Loading…
Reference in New Issue
Block a user