Repository navigation
fix(portal): accept group write access on a group only the user belongs to - #1936
Conversation
…gs to The file manager setup refused any executable path with a group-writable component, but Ubuntu and similar systems give each user a private group and a umask of 002, so the user's own ~/.local folders are group-writable and setup failed with "must not be writable by other users". Accept group write access when the group is described by /etc/passwd and /etc/group and nobody but the user belongs to it; world write access and shared or unknown groups are still refused. Also name the Settings row the installer sends users to "System file manager", as it appears in Settings.
|
Review notes ( Merged Review of the change
Unrelated fix carried along ( Local verification
CI on |
# Conflicts: # data/locales/hu.json # data/locales/messages/hu.json
|
Follow-up:
The PR is mergeable again. |
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RQ23A9GfGFakM7LCfHpGaM
Description
On elementary OS, the installer's file manager setup failed with "The Strata executable path must not be writable by other users".
secure_executablerefuses any path component whose group-write bit is set. Ubuntu-based systems give every user a private group and a umask of 002, so folders such as~/.localare0775, owned by the user and writable by a group that only the user belongs to.Group write access is now accepted when the path's group is described by
/etc/passwdand/etc/groupand nobody but the current user belongs to it: no other user has it as a primary group and no other member is listed. World write access, shared groups, and groups or users the databases do not describe are still refused, so a setup using LDAP or similar keeps today's behaviour. The check takes the group lookup as a parameter so it can be tested without depending on the machine's accounts.The installer's failure message and the README sent users to "System file chooser", which is not a Settings row; the row is "System file manager", under Desktop integration. Both now say so, and
docs/portal-file-chooser.mdstates the new rule.Not changed: the file providers'
trusted()check inservices/file_providers.rshas the same blanket group-write rule for user-created provider folders. It is a separate feature, so I left it. I did not test on Ubuntu or elementary OS; the fix follows from the reported message, so I used "Part of" below.Visual evidence
N/A: no UI change.
How to test
~/.local/binso~/.localand~/.local/binare0775.strata --install-portal, or press Complete setup under Settings → General → Desktop integration → System file manager.Expected result: setup completes. Before this change it stopped with "must not be writable by other users". Making any path component world-writable, or group-writable by a shared group, still stops it.
Covered by
group_write_access_is_accepted_only_on_a_group_nobody_else_belongs_toanda_group_is_private_when_only_the_user_has_it; putting back the old rule, or letting a private group excuse world write access, fails the first. The existing rejection tests now use a fixed group answer, or a world-writable file, so they no longer depend on the account running them.Related issue
Part of #1921