mirror of
https://github.com/SteamDeckHomebrew/decky-loader.git
synced 2026-07-11 20:01:57 +00:00
Ignore chmod if decky is not run as root (#510)
* Ignore chmod if decky is not run as root * I can't read * i managed to make a mistake on 2/3 lines i edited.... * add warning on startup * logger.warn is depreciated * Update localplatformlinux.py
This commit is contained in:
@@ -60,6 +60,8 @@ def chown(path : str, user : UserType = UserType.HOST_USER, recursive : bool =
|
|||||||
return result == 0
|
return result == 0
|
||||||
|
|
||||||
def chmod(path : str, permissions : int, recursive : bool = True) -> bool:
|
def chmod(path : str, permissions : int, recursive : bool = True) -> bool:
|
||||||
|
if _get_effective_user_id() != 0:
|
||||||
|
return True
|
||||||
result = call(["chmod", "-R", str(permissions), path] if recursive else ["chmod", str(permissions), path])
|
result = call(["chmod", "-R", str(permissions), path] if recursive else ["chmod", str(permissions), path])
|
||||||
return result == 0
|
return result == 0
|
||||||
|
|
||||||
|
|||||||
+4
-1
@@ -24,7 +24,7 @@ from aiohttp_jinja2 import setup as jinja_setup
|
|||||||
# local modules
|
# local modules
|
||||||
from browser import PluginBrowser
|
from browser import PluginBrowser
|
||||||
from helpers import (REMOTE_DEBUGGER_UNIT, csrf_middleware, get_csrf_token,
|
from helpers import (REMOTE_DEBUGGER_UNIT, csrf_middleware, get_csrf_token,
|
||||||
mkdir_as_user, get_system_pythonpaths)
|
mkdir_as_user, get_system_pythonpaths, get_effective_user_id)
|
||||||
|
|
||||||
from injector import get_gamepadui_tab, Tab, get_tabs, close_old_tabs
|
from injector import get_gamepadui_tab, Tab, get_tabs, close_old_tabs
|
||||||
from loader import Loader
|
from loader import Loader
|
||||||
@@ -178,6 +178,9 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
# Required for multiprocessing support in frozen files
|
# Required for multiprocessing support in frozen files
|
||||||
multiprocessing.freeze_support()
|
multiprocessing.freeze_support()
|
||||||
|
else:
|
||||||
|
if get_effective_user_id() != 0:
|
||||||
|
logger.warning(f"decky is running as an unprivileged user, this is not officially supported and may cause issues")
|
||||||
|
|
||||||
# Append the loader's plugin path to the recognized python paths
|
# Append the loader's plugin path to the recognized python paths
|
||||||
sys.path.append(path.join(path.dirname(__file__), "plugin"))
|
sys.path.append(path.join(path.dirname(__file__), "plugin"))
|
||||||
|
|||||||
Reference in New Issue
Block a user