mirror of
https://github.com/SELinuxProject/setools
synced 2025-04-01 00:06:19 +00:00
DTA/InfoFlow: change exclude to handle None
This is a little clearer than having an empty list, from the caller side.
This commit is contained in:
parent
ec9de08ac6
commit
84217f0d73
@ -27,7 +27,7 @@ class DomainTransitionAnalysis(object):
|
||||
|
||||
"""Domain transition analysis."""
|
||||
|
||||
def __init__(self, policy, reverse=False, exclude=[]):
|
||||
def __init__(self, policy, reverse=False, exclude=None):
|
||||
"""
|
||||
Parameter:
|
||||
policy The policy to analyze.
|
||||
@ -128,7 +128,11 @@ class DomainTransitionAnalysis(object):
|
||||
exclude A list of types.
|
||||
"""
|
||||
|
||||
self.exclude = [self.policy.lookup_type(t) for t in exclude]
|
||||
if exclude:
|
||||
self.exclude = [self.policy.lookup_type(t) for t in exclude]
|
||||
else:
|
||||
self.exclude = []
|
||||
|
||||
self.rebuildsubgraph = True
|
||||
|
||||
def shortest_path(self, source, target):
|
||||
|
@ -30,7 +30,7 @@ class InfoFlowAnalysis(object):
|
||||
|
||||
"""Information flow analysis."""
|
||||
|
||||
def __init__(self, policy, perm_map, minweight=1, exclude=[]):
|
||||
def __init__(self, policy, perm_map, minweight=1, exclude=None):
|
||||
"""
|
||||
Parameters:
|
||||
policy The policy to analyze.
|
||||
@ -92,7 +92,10 @@ class InfoFlowAnalysis(object):
|
||||
exclude A list of types.
|
||||
"""
|
||||
|
||||
self.exclude = [self.policy.lookup_type(t) for t in exclude]
|
||||
if exclude:
|
||||
self.exclude = [self.policy.lookup_type(t) for t in exclude]
|
||||
else:
|
||||
self.exclude = []
|
||||
|
||||
self.rebuildsubgraph = True
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user