Skip to content

Fix non-root user startup and config fallback - #297

Draft
mister-teddy wants to merge 1 commit into
mainfrom
codex/non-root-user-config-fallback
Draft

Fix non-root user startup and config fallback#297
mister-teddy wants to merge 1 commit into
mainfrom
codex/non-root-user-config-fallback

Conversation

@mister-teddy

Copy link
Copy Markdown
Contributor

Summary

  • add a shared guest-account resolver that reads /etc/passwd, uses the account's actual home directory, and falls back to root when a configured user cannot be resolved
  • restore 0644 permissions on /etc/passwd and /etc/group before PRoot commands so non-root processes can resolve users and groups
  • preserve unrelated TOML sections after a one-shot try_username is consumed, and accept the reported [users] section spelling
  • migrate XFCE setup and PRoot launch to the shared account helper, removing the old hard-coded home-directory helper
  • update the non-root setup guide to test with try_username first and document recovery
  • scope the bundled Android native-library search path to Android builds so host unit tests link against host libraries

Root cause

Account database files modified inside PRoot can retain modes that make passwd and group unreadable after dropping privileges. The launcher also trusted the configured username and assumed every non-root home was /home/<username>, so a missing account or nonstandard home could leave the desktop on a black or red screen.

Separately, once try_username was commented out, an otherwise empty [user] table had no field-level default. That caused the entire TOML document to fall back to defaults and discarded valid command settings.

Impact

Non-root sessions now start with a resolvable identity and the account's configured home. Invalid or missing account settings recover to a root desktop instead of trapping the user behind a blank screen, while one-shot config trials retain their documented fallback behavior.

Validation

  • cargo test --lib (9 passed)
  • cargo clippy --lib -- -D warnings
  • cargo check --lib --target aarch64-linux-android
  • git diff --check

The Android target check reports only existing warnings in unrelated Smithay, webview, PulseAudio, and Wayland code.

Source issues

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.

1 participant