Fix for SELinux handling logic (#529)

* Fix for SELinux handling logic

The old procedure was crashing with signal 9 SIGKILL, this should fix that problem
This commit is contained in:
Marco Rodolfi
2023-08-26 19:00:02 +02:00
committed by GitHub
parent a43e4328df
commit caf4d75a06
2 changed files with 10 additions and 3 deletions
+7 -1
View File
@@ -43,4 +43,10 @@ def get_log_level() -> int:
]
def get_selinux() -> bool:
return os.getenv("DECKY_SELINUX", "0") == "1"
if ON_LINUX:
from subprocess import check_output
try:
if (check_output("getenforce").decode("ascii").strip("\n") == "Enforcing"): return True
except FileNotFoundError:
pass
return False