Repository navigation
Reject root-run updates before changing user state - #11479
yashranaway wants to merge 8 commits into
Conversation
quattro's omarchy-update now refuses anything but a privileged Bash startup from its own source root, so a sed-edited copy run with plain bash exits before reaching the EUID guard, and the test failed once merged. Drive the real script through the sudo-boundary fixture instead, and get EUID 0 from an unprivileged user namespace as the other root guards' tests do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merging quattro left the EUID guard below the checks and sudo setup quattro added since. Plain sudo resets the environment, so a stock install reaches root without OMARCHY_PATH and the source-root check exited first with "OMARCHY_PATH does not match this Omarchy command." instead of saying to run without sudo; a root run that got past it still ran the cleanup traps, `sudo -k` and the no-update wrapper check before being refused. Put the guard ahead of both, and test root arriving without OMARCHY_PATH and never reaching sudo. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com>
|
A root runner is refused by the guard under test, so the normal-user case failed there instead of being skipped, as the other root-aware tests here do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com>
|
Reviewed and tested at b230fb0. The fix is right: I pushed three commits to your branch so the fix holds on today's
What ran, on a disposable Omarchy worker:
Codex Medium reviewed this as a second opinion over three rounds. It raised the unquoted string literal and the root-runner assumption fixed above; Greptile raised the root-runner case too. Its last round, at b230fb0, found nothing open. Two other open pull requests make the same change: #13377 and #13660. Codex Medium compared all three without being given my answer and ranked this one first, though its independence from this session is not guaranteed. #13377 places its guard after the source-root check, so plain This now closes #13329. #11257 also reports that the failed migration's marker was still written, which this does not touch, so I have not linked it. This is waiting on the maintainer. |
|
Checked the pushed root guard and current privileged startup boundary; the root-update regression passes after merging quattro. |
|
The head moved from b230fb0 to c4a98a0, so the I read the new commits. c4a98a0 and e50c09f merge I did not re-run anything at this head, and its classification is unsettled. Every item needs a second opinion before it is re-verified or relabelled, and today's quota of reviewer calls is spent: Codex Medium answers, but omabot's daily cap on calls to it was reached before this item, so no second review ran. Nothing is needed from you. This waits for a run with a second opinion, which will re-verify this head on a worker. |
Catches updates run with sudo before user migrations start looking for configuration in root's home. Addresses #11257.
<<<< AI wording below >>>>
Problem
Running
sudo omarchy updategives user-scoped migration steps root's home directory. Theme handover can then look for Hermes configuration under/root, fail, and leave a partially updated user setup.Addresses the root-run update in #11257.
Fix
Reject effective UID 0 before opening the update log or running any update steps. Explain that the command must run as the desktop user and that individual steps request privileges when needed.
Verification
bash test/shell.d/update-root-test.shcovers both logged and initial root invocations and the normal-user logging path. The effective UID is substituted in a fixture copy so the test needs no root access.bash test/shell.d/update-sequence-test.shandbash test/shell.d/update-lock-test.shalso pass.git diff --checkpasses. Changed shell files passbash -n, and the command style checks pass.Fixes #13329