diff options
| author | AAGaming <aagaming@riseup.net> | 2025-07-28 20:58:59 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-28 20:58:59 -0400 |
| commit | 8f41eb93ef80bfbf3851ce8a82ea0f88c87e6c68 (patch) | |
| tree | 6cbfdf1843dc0aba959e9b76201df149a71964fc /backend/decky_loader/localplatform | |
| parent | 670ae7d8a7d8fc8efc28ce403865177ebf0b715e (diff) | |
| download | decky-loader-8f41eb93ef80bfbf3851ce8a82ea0f88c87e6c68.tar.gz decky-loader-8f41eb93ef80bfbf3851ce8a82ea0f88c87e6c68.zip | |
Merge commit from forkv3.1.10
* fix incorrect permissions on plugin directories
* chown plugin dirs too
* fix the stupid
* cleanup useless comments
Diffstat (limited to 'backend/decky_loader/localplatform')
| -rw-r--r-- | backend/decky_loader/localplatform/localplatformlinux.py | 17 | ||||
| -rw-r--r-- | backend/decky_loader/localplatform/localplatformwin.py | 5 |
2 files changed, 12 insertions, 10 deletions
diff --git a/backend/decky_loader/localplatform/localplatformlinux.py b/backend/decky_loader/localplatform/localplatformlinux.py index beaa2540..1c8f2ace 100644 --- a/backend/decky_loader/localplatform/localplatformlinux.py +++ b/backend/decky_loader/localplatform/localplatformlinux.py @@ -59,8 +59,6 @@ def chown(path : str, user : UserType = UserType.HOST_USER, recursive : bool = user_str = _get_user()+":"+_get_user_group() elif user == UserType.EFFECTIVE_USER: user_str = _get_effective_user()+":"+_get_effective_user_group() - elif user == UserType.ROOT: - user_str = "root:root" else: raise Exception("Unknown User Type") @@ -87,7 +85,7 @@ def chmod(path : str, permissions : int, recursive : bool = True) -> bool: return True -def folder_owner(path : str) -> UserType|None: +def file_owner(path : str) -> UserType|None: user_owner = _get_user_owner(path) if (user_owner == _get_user()): @@ -106,13 +104,14 @@ def get_home_path(user : UserType = UserType.HOST_USER) -> str: user_name = _get_user() elif user == UserType.EFFECTIVE_USER: user_name = _get_effective_user() - elif user == UserType.ROOT: - pass else: raise Exception("Unknown User Type") return pwd.getpwnam(user_name).pw_dir +def get_effective_username() -> str: + return _get_effective_user() + def get_username() -> str: return _get_user() @@ -121,8 +120,8 @@ def setgid(user : UserType = UserType.HOST_USER): if user == UserType.HOST_USER: user_id = _get_user_group_id() - elif user == UserType.ROOT: - pass + elif user == UserType.EFFECTIVE_USER: + pass # we already are else: raise Exception("Unknown user type") @@ -133,8 +132,8 @@ def setuid(user : UserType = UserType.HOST_USER): if user == UserType.HOST_USER: user_id = _get_user_id() - elif user == UserType.ROOT: - pass + elif user == UserType.EFFECTIVE_USER: + pass # we already are else: raise Exception("Unknown user type") diff --git a/backend/decky_loader/localplatform/localplatformwin.py b/backend/decky_loader/localplatform/localplatformwin.py index 7e3bd31c..8755c943 100644 --- a/backend/decky_loader/localplatform/localplatformwin.py +++ b/backend/decky_loader/localplatform/localplatformwin.py @@ -7,7 +7,7 @@ def chown(path : str, user : UserType = UserType.HOST_USER, recursive : bool = def chmod(path : str, permissions : int, recursive : bool = True) -> bool: return True # Stubbed -def folder_owner(path : str) -> UserType|None: +def file_owner(path : str) -> UserType|None: return UserType.HOST_USER # Stubbed def get_home_path(user : UserType = UserType.HOST_USER) -> str: @@ -34,6 +34,9 @@ async def service_restart(service_name : str, block : bool = True) -> bool: return True # Stubbed +def get_effective_username() -> str: + return os.getlogin() + def get_username() -> str: return os.getlogin() |
