summaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
Diffstat (limited to 'backend')
-rw-r--r--backend/localplatform.py8
-rw-r--r--backend/updater.py5
2 files changed, 10 insertions, 3 deletions
diff --git a/backend/localplatform.py b/backend/localplatform.py
index 9b05510b..43043ad0 100644
--- a/backend/localplatform.py
+++ b/backend/localplatform.py
@@ -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
diff --git a/backend/updater.py b/backend/updater.py
index 170cfa40..6b38dd25 100644
--- a/backend/updater.py
+++ b/backend/updater.py
@@ -209,8 +209,9 @@ class Updater:
shutil.move(path.join(getcwd(), download_temp_filename), path.join(getcwd(), download_filename))
chmod(path.join(getcwd(), download_filename), 777, False)
if get_selinux():
- from subprocess import call
- call(["chcon", "-t", "bin_t", path.join(getcwd(), download_filename)])
+ from asyncio.subprocess import create_subprocess_exec
+ process = await create_subprocess_exec("chcon", "-t", "bin_t", path.join(getcwd(), download_filename))
+ logger.info(f"Setting the executable flag with chcon returned {await process.wait()}")
logger.info("Updated loader installation.")
await tab.evaluate_js("window.DeckyUpdater.finish()", False, False)