Repository navigation
Conversation
…rolled OMARCHY_PATH
|
|
Thanks for this. Two notes:
|
copy_boundary_file splices fixture paths into the copied script text, quoted or not, so a runner TMPDIR with whitespace broke the sudo stand-in before any assertion ran. Fall back to /tmp for the fixture root in that case. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…pper The other privileged entrypoints authorize once and then run behind the sudo-no-update wrapper with a fixed PATH. Do the same here so sudo does not resolve from the caller's PATH and no step refreshes the cached credential. The test now expects the single authorization followed by -N invocations. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Thanks for taking the time to look at this, and for the #9317 context. On the double prompt: you're right, and I've added it to the PR description. While going through this I also pushed two small commits. The first fixes the test fixture, which broke when the runner's TMPDIR contained a space (the second Greptile note). The second brings the limine script closer to the rest of the family: it authorizes once, then runs the remaining steps through the sudo-no-update wrapper with a fixed PATH, the same way On #9317: agreed. Someone who can poison |
|
Thanks, re-checked: the double prompt is documented, the TMPDIR fixture is fixed, and the sudo steps now go through the fixed-PATH wrapper. Looks good to me. Whether to adopt it is up to the maintainers. |
What
Applies the privileged-startup validation chain already used by
omarchy-refresh-pacman(andomarchy-update,omarchy-channel-set,omarchy-update-stay-awake) toomarchy-refresh-limine:-pstartup check,environment sanitization,
OMARCHY_PATHsource-root validation, and sudotimestamp revocation on exit.
Why
omarchy-refresh-liminecopies$OMARCHY_PATH/default/limine/limine.confinto
/bootas root and then rebuilds the bootloader.omarchy-refresh-pacmanperforms the equivalent privileged copy out of the same tree and validates the
source root first;
omarchy-refresh-limineis the one privileged refresh thatstill trusts the caller's environment for that read.
Every current caller is interactive (
omarchy-reinstall-configs, the menu),so this is consistency and defense-in-depth rather than a fix to an
exploitable path.
Behavior notes
set -e; the backupmvis now guarded by an existence check so thefresh-install path (no
/boot/limine.confyet) behaves as before./usr/bin/sudo /usr/bin/true)and runs the remaining steps behind the command-scoped sudo wrapper
(
omarchy_security_enable_no_update_sudo), likeomarchy-update. sudo nolonger resolves from the caller's PATH.
omarchy-reinstall-configstherefore asks for the sudo password twice now:it runs
omarchy-refresh-limineand thenomarchy-refresh-plymouth, andomarchy-plymouth-set's sudo re-authenticates after limine's exitrevocation. The family already re-authorizes between chained privileged
steps (
omarchy-channel-setrunsomarchy-refresh-pacman,omarchy-update-pacman, andomarchy-update, each starting cold), andavoiding the second prompt would mean dropping one of the revocations. With
the opt-in
omarchy-sudo-passwordlessmode active there is no prompt at all.Test
Extends the protected-entrypoint loop in
test/shell.d/security-source-root-test.shto cover
omarchy-refresh-limine.Adds a fixture-backed success-path test for existing and missing boot configs,
checking backup, copy, rebuild commands, and sudo timestamp cleanup.
The sudo boundary fixture now falls back to
/tmpwhen the runner'sTMPDIRcontains whitespace, since it splices fixture paths into script text.
Follow-up (not here)
Other privileged commands read
$OMARCHY_PATHwithout the source-root check(
omarchy-apply-hardware,omarchy-apply-system,omarchy-reinstall-pkgs,omarchy-voxtype-install, ...). Happy to migrate those in separate PRs ifthis pattern is wanted there too.