Repository navigation
Conversation
|
| actual=$(cat "$marker" 2>/dev/null) || return 1 | ||
| [[ $actual == $expected ]] |
There was a problem hiding this comment.
Replay overwrites later user choices
Rejecting every empty marker replays completed migrations on existing installs. That can undo later user choices:
migrations/1790457067.shchanges any exact Node version back to"latest".migrations/1791376887.shrestores overlay scrollbars after a user removes them.
Fresh installs are also affected because omarchy-provision-user still seeds empty markers with touch. Audit historical migrations before forcing this replay, and update the install-time marker writer to match the new format.
| expected=$(sha256sum "$file" 2>/dev/null | cut -d' ' -f1) || return 1 | ||
| [[ -n $expected ]] || return 1 | ||
| actual=$(cat "$marker" 2>/dev/null) || return 1 | ||
| [[ $actual == $expected ]] |
There was a problem hiding this comment.
Planted hashes still skip repairs
A process running as the user can still suppress a security migration without running it. It can read the migration file, calculate its hash, and write that hash into the user-owned marker. migration_completed then accepts the marker and skips the script, including the repair that restores polkit brute-force protection.
This rejects empty or damaged markers, but does not establish that a migration ran. To meet the stated security goal, use a completion record the attacking process cannot write, or check the protected state before skipping security repairs.
How this was verified: The runner accepts a matching hash from a marker under the user's home directory and skips the polkit repair without checking whether brute-force protection was restored.
|
Thanks for digging into this. I think there are two problems that block it as written:
If the goal is to detect corrupted or partial markers, a lighter option is to write the hash on completion going forward and treat only a marker whose content is non-empty and wrong as pending, leaving empty legacy markers as completed: migration_completed() {
local file=$1 marker=$2 actual
[[ -f $marker ]] || return 1
actual=$(<"$marker")
[[ -z $actual ]] && return 0 # legacy / provisioned marker
[[ $actual == "$(sha256sum "$file" | cut -d' ' -f1)" ]]
}
|
Problem
omarchy-migratedecided whether a migration had run with a single[[ ! -f $marker ]]test on~/.local/state/omarchy/migrations/<filename>.Markers were empty files, so any process running as the user could
touchamarker for a migration that never ran — including security-hardening ones like
the sshd/FIDO2/udev/polkit repairs — and it would be skipped forever, silently.
Fix
Markers now record the sha256 hash of the migration file that wrote them.
omarchy-migratetreats a marker with missing or unexpected content aspending, so the (idempotent) migration runs instead of being silently skipped.
A planted empty marker no longer suppresses anything.
Existing empty markers from before this change will cause their migrations to
run once more on the next
omarchy-migrate— safe, because migrations arerequired to be idempotent.
Changes
bin/omarchy-migrate: newmigration_completed()(marker exists AND contentmatches sha256 of the migration file); both
--pendingand the run loop useit; completion writes the hash instead of
touchtest/shell.d/migrate-marker-test.sh: new — planted/forged markers don'tsuppress, genuine runs record the hash and skip on re-run
agents/skills/migrations.md: documented the marker content formatTesting
migrate-marker-test.sh: 5/5 passmigrate-wrapper-test.sh,migrate-notify-test.sh,migrate-scope-test.sh: all pass