diff --git a/seinfoflow b/seinfoflow index 8a5ec0c..89bddf8 100755 --- a/seinfoflow +++ b/seinfoflow @@ -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: diff --git a/setools/infoflow.py b/setools/infoflow.py index c276271..4ec5a30 100644 --- a/setools/infoflow.py +++ b/setools/infoflow.py @@ -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