This stage labels the target tree based on an SELinux policy already installed in the target. Signed-off-by: Tom Gundersen <teg@jklm.no>
16 lines
387 B
Python
Executable file
16 lines
387 B
Python
Executable file
#!/usr/bin/python3
|
|
|
|
import json
|
|
import os
|
|
import subprocess
|
|
import sys
|
|
|
|
def main(tree, options):
|
|
file_contexts = os.path.join(f"{tree}", options["file_contexts"])
|
|
|
|
subprocess.run(["setfiles", "-F", "-r", f"{tree}", f"{file_contexts}", f"{tree}"], check=True)
|
|
|
|
if __name__ == '__main__':
|
|
args = json.load(sys.stdin)
|
|
r = main(args["tree"], args["options"])
|
|
sys.exit(r)
|