Skip to content

Add luks-slots --owner, a read-only owner slot query - #659

Merged
maralcbr merged 2 commits into
quattro-upstreamfrom
mac/luks-slots-owner-query
Sep 28, 2026
Merged

maralcbr merged 2 commits into
quattro-upstreamfrom
mac/luks-slots-owner-query

Conversation

@maralcbr

Copy link
Copy Markdown
Collaborator

Agreed with the upstream runtime work (omacom#13362): omarchy-drive-password will run sudo omarchy-lifecycle-dispatch luks-slots --owner before any change and refuse a password that opens another slot, such as a recovery key an earlier Mac setup added (follows #657).

luks-slots --owner reads owner_slot from /boot/omarchy/encrypt.state, checks it is a slot number (0-31) and that the root's LUKS header holds a key there, and prints exactly that number. It writes nothing. It fails with a message on stderr when encrypt.state is missing, records no owner slot, records a non-numeric or out-of-range one, the header can't be read, or the header has no key in that slot (a keyring token with that number doesn't count). --owner takes no other arguments; owner=/recovery= recording is unchanged.

Release order: this omarchy-mac-boot must publish with or before the runtime whose omarchy-drive-password calls --owner. An older luks-slots would reject --owner as an unknown argument, so the password change would stop. Noted on omacom/omarchy-pkgs#673.

Tested in an Arch container: packages/omarchy-mac/boot/test/all passes. New cases cover a valid recorded slot, a missing file, a missing record, non-numeric and out-of-range records, a slot absent from the header, a token standing in for a slot, an unreadable header and extra arguments. Each case checks that no file under the fixture's boot, etc, var or dev trees changed. The dispatch, drive-password, re-key journal and provision-owner shell tests pass.

luks-slots --owner prints the owner slot encrypt.state records once the root's
LUKS header holds a key there, and changes nothing. omarchy-drive-password can
then refuse, before any change, a password that opens another slot, such as a
recovery key an earlier Mac setup added. A missing or invalid record fails
with a message on stderr.
@maralcbr
maralcbr merged commit ce75c6f into quattro-upstream Sep 28, 2026
5 checks passed
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