mirror of
https://github.com/SELinuxProject/setools
synced 2025-02-22 15:16:58 +00:00
InfoFlowAnalysis: change set_perm_map() to only take map objects.
Remove this handling from the analysis code. It now expects a permission map to be passed in, and won't handle a string.
This commit is contained in:
parent
c224995eeb
commit
cb18f4c21f
@ -78,8 +78,8 @@ else:
|
||||
|
||||
try:
|
||||
p = setools.SELinuxPolicy(args.policy)
|
||||
g = setools.infoflow.InfoFlowAnalysis(
|
||||
p, args.map, minweight=args.min_weight, exclude=args.exclude)
|
||||
m = setools.permmap.PermissionMap(args.map)
|
||||
g = setools.infoflow.InfoFlowAnalysis(p, m, minweight=args.min_weight, exclude=args.exclude)
|
||||
|
||||
if args.shortest_path or args.all_paths:
|
||||
try:
|
||||
|
@ -73,19 +73,12 @@ class InfoFlowAnalysis(object):
|
||||
Set the permission map used for the information flow analysis.
|
||||
|
||||
Parameter:
|
||||
perm_map The permission map or path to the permission map file.
|
||||
perm_map The permission map.
|
||||
|
||||
Exceptions:
|
||||
TypeError The map is not a file path or permission map object.
|
||||
"""
|
||||
if not isinstance(perm_map, (str, permmap.PermissionMap)):
|
||||
raise TypeError(
|
||||
"Permission map must be an object or a path to a file.")
|
||||
|
||||
if isinstance(perm_map, str):
|
||||
self.perm_map = permmap.PermissionMap(perm_map)
|
||||
else:
|
||||
self.perm_map = perm_map
|
||||
self.perm_map = perm_map
|
||||
|
||||
self.rebuildgraph = True
|
||||
self.rebuildsubgraph = True
|
||||
|
Loading…
Reference in New Issue
Block a user