Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore chmod if decky is not run as root #510

Merged
merged 6 commits into from Jul 21, 2023
Merged

Conversation

PartyWumpus
Copy link
Member

@PartyWumpus PartyWumpus commented Jul 21, 2023

Please tick as appropriate:

  • I have tested this code on a steam deck or on a PC
  • My changes generate no new errors/warnings
  • This is a bugfix/hotfix
  • This is a new feature

If you're wanting to update a translation or add a new one, please use the weblate page: https://weblate.werwolv.net/projects/decky/

Description

This fixes the issue issue mentioned here Jovian-Experiments/Jovian-NixOS#111 and here #446 (comment)

While decky doesn't really support running as the user, as it breaks some of its features, we might as well make it functional where possible. This has not been tested, i'll test it in a moment and then merge it myself, so I don't really know who I'm writing this for or why I'm making it a PR instead of just commiting to main...

@@ -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 os.geteuid != 0:
Copy link

@samueldr samueldr Jul 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You probably also want to log a warning for future support issues, allowing the project support peeps to understand that it's not running as root, I'd assume.

E.g. [WARNING] decky-loader running as unprivileged user $username.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably best to just show this once on startup, but yes that is a good idea, will do

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I'm about 0% familiar with the codebase, the overall important thing is to ensure you all in support position can identify the situation, now that it can happen.

@PartyWumpus PartyWumpus merged commit 37c1a0e into main Jul 21, 2023
10 checks passed
@PartyWumpus PartyWumpus deleted the PartyWumpus-patch-1 branch July 25, 2023 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants