diff options
| author | Party Wumpus <48649272+PartyWumpus@users.noreply.github.com> | 2023-07-21 23:00:08 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-21 23:00:08 +0100 |
| commit | 37c1a0e9648e6b84aaa996d5ecfd1d2d5d49622f (patch) | |
| tree | 4e3d71d71b1731fa6a508d7e1a9921c1b1fe2d8a /backend/localplatformlinux.py | |
| parent | 6d086fb5d52a690c6e07c49ba065f1d83a8ab1db (diff) | |
| download | decky-loader-37c1a0e9648e6b84aaa996d5ecfd1d2d5d49622f.tar.gz decky-loader-37c1a0e9648e6b84aaa996d5ecfd1d2d5d49622f.zip | |
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
Diffstat (limited to 'backend/localplatformlinux.py')
| -rw-r--r-- | backend/localplatformlinux.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/backend/localplatformlinux.py b/backend/localplatformlinux.py index da0a758f..811db8a6 100644 --- a/backend/localplatformlinux.py +++ b/backend/localplatformlinux.py @@ -60,6 +60,8 @@ def chown(path : str, user : UserType = UserType.HOST_USER, recursive : bool = return result == 0 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]) return result == 0 @@ -191,4 +193,4 @@ def get_unprivileged_user() -> str: logger.warn("Unprivileged user is not properly configured. Defaulting to 'deck'") user = 'deck' - return user
\ No newline at end of file + return user |
