mirror of
https://github.com/SELinuxProject/setools
synced 2025-05-08 03:06:15 +00:00
sedta: Update for revised DomainTransitionAnalysis API.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
This commit is contained in:
parent
6b9986ca34
commit
1cd039d5ef
21
sedta
21
sedta
@ -111,16 +111,20 @@ else:
|
||||
|
||||
try:
|
||||
p = setools.SELinuxPolicy(args.policy)
|
||||
g = setools.DomainTransitionAnalysis(p, reverse=args.reverse, exclude=args.exclude)
|
||||
g = setools.DomainTransitionAnalysis(p, exclude=args.exclude)
|
||||
|
||||
if args.shortest_path or args.all_paths:
|
||||
g.source = args.source
|
||||
g.target = args.target
|
||||
g.reverse = args.reverse
|
||||
if args.shortest_path:
|
||||
paths = g.all_shortest_paths(args.source, args.target)
|
||||
g.mode = setools.DomainTransitionAnalysis.Mode.ShortestPaths
|
||||
else:
|
||||
paths = g.all_paths(args.source, args.target, args.all_paths)
|
||||
g.mode = setools.DomainTransitionAnalysis.Mode.AllPaths
|
||||
g.all_paths_max_steps = args.all_paths
|
||||
|
||||
i = 0
|
||||
for i, path in enumerate(paths, start=1):
|
||||
for i, path in enumerate(g.results(), start=1):
|
||||
print("Domain transition path {0}:".format(i))
|
||||
|
||||
for stepnum, step in enumerate(path, start=1):
|
||||
@ -138,7 +142,14 @@ try:
|
||||
print("\n{} domain transition path(s) found.".format(i))
|
||||
|
||||
else: # single transition
|
||||
transitions = g.transitions(args.source)
|
||||
if args.reverse:
|
||||
g.mode = setools.DomainTransitionAnalysis.Mode.TransitionsIn
|
||||
g.target = args.source
|
||||
else:
|
||||
g.mode = setools.DomainTransitionAnalysis.Mode.TransitionsOut
|
||||
g.source = args.source
|
||||
|
||||
transitions = g.results()
|
||||
|
||||
i = 0
|
||||
for i, step in enumerate(transitions, start=1):
|
||||
|
Loading…
Reference in New Issue
Block a user