Repository navigation
Conversation
scottjones
left a comment
There was a problem hiding this comment.
The design here is good. Declaring the wiring in default/system-paths.tsv is a real improvement over ad-hoc install lines, the -T flags on install/ln and the switch to printf %q are worthwhile hardening, and the zram special case is the best thing in the PR — forcing that one row to be a copy rather than a link, because zram-generator runs as root at early boot before $HOME exists, is exactly right and shows the policy was thought through rather than applied uniformly.
bug: the hardcoded manifest digest isn't covered by any test, and it will break in the field.
local expected_manifest_sha256="a8fd68dfc45eddb3160db475874265e573b6cf0333f1e75f9fec840504144f05"
local expected_rows=19I verified both match the committed manifest today. But upgrade-to-quattro-mac-system-paths-test.sh only asserts the row count (line 109) — nothing tests the digest. So any manifest edit that preserves the row count (fixing a destination typo, repointing a source) ships with green CI and then fails on a user's machine mid-upgrade with The system path manifest does not match the canonical fixed-path contract. That's the worst possible place to find out.
And the threat model behind it doesn't hold. The comment justifies the digest as protecting a privileged write path because "the Mac checkout is user-owned by design" — but bin/omarchy-upgrade-to-quattro-mac, the file carrying the expected hash, is in that same user-owned checkout. Anyone who can edit the .tsv can edit the .sh. The digest buys no security and guarantees a future breakage.
I'd drop expected_manifest_sha256 and the expected_rows pin, and keep the per-row validation — canonical-path checks, symlink-escape checks, duplicate-destination detection, the policy whitelist. That part does real work and doesn't go stale.
suggestion: the scope expansion deserves a sentence in the summary. The base script wrote 5 system paths; the manifest declares 19. "The declared set of fixed runtime defaults that Apple Silicon checkout upgrades must mirror" reads like documenting existing behaviour, but it's a 4x expansion.
I checked ownership on an M2 Max: all 19 destinations belong to omarchy-settings 4.0.1-2, so the upgrade replaces package-owned files with copies and symlinks into $HOME, and the next pacman -Syu of omarchy-settings silently reverts them. To be fair the base already does this — /etc/profile.d/omarchy.sh, default/uwsm/env.d/10-omarchy and default/environment.d/10-omarchy-fcitx.conf are all omarchy-settings-owned today — so this widens a pattern the project already committed to rather than inventing one. Worth saying out loud though, because extending it to systemd units means a pacman revert now changes behaviour rather than just config.
nit: sudo install -d -m755 "$(dirname -- "$destination")" runs against existing system directories and resets their modes as a side effect.
nit: load_system_path_manifest is called twice — once from validate_quattro_tree, once from wire_system_paths. Validating before the first sudo is the right instinct; the second call is redundant since the arrays are still populated.
Drop the digest and this is close.
|
Please drop the hardcoded manifest digest and row count. They add no trust boundary because the script lives in the same user-owned checkout, and a legitimate manifest edit will otherwise break upgrades; keep the per-row validation. |
|
Found three blockers:
Needs work: make manifest validation ref-aware, require or repair executable command modes, and publish system files through same-filesystem temporary files with atomic replacement. |
Summary
default/system-paths.tsvas the declared set of fixed runtime defaults that Apple Silicon checkout upgrades must mirror.app.slicedrop-in and the fontconfig/notifier aliases.Testing
Fixes #310
Fixes #311