refactor/single-etc-machine-id #92

Merged
clawdie merged 3 commits from refactor/single-etc-machine-id into main 2026-11-21 14:10:42 +01:00
Owner
No description provided.
Remove the competing /var/db/clawdie/machine-id writer, legacy dashed-UUID
mirror loop, and dual-file lookup so desktop plumbing and Clawdie share one
canonical installation ID:
- clawdie-hostkey-rc: keep only dbus-uuidgen --ensure=/etc/machine-id (and
  chmod 0444); FreeBSD rc.d/hostid remains responsible for /etc/hostid.
- clawdie-password-setup: stop writing a competing /var/db/clawdie/machine-id.
- clawdie_evidence_lib.py, clawdie-system-probe, clawdie-live-selfcheck: read
  /etc/machine-id directly (rejecting symlinks and non-32-hex shapes).
- build.sh: ensure /etc/machine-id is absent in shipped images.
- firstboot/retarget-be.sh: scrub /etc/machine-id on destination install so
  the installed system mints its own distinct ID on first boot.
- Update TESTING.md and unit tests for the single-file invariant.
Address Codex review of 331f087:
- clawdie-system-probe, clawdie_evidence_lib.py, and clawdie-live-selfcheck
  now enforce the exact same live-file contract: non-symlink regular file
  matching ^[0-9a-f]{32}\n?$ (rejecting dashed UUIDs, uppercase hex,
  whitespace, malformed strings, and multiline/double-newline files).
- Add uniform 5-fixture tests (valid, dashed, malformed, multiline, symlink)
  across clawdie-system-probe-test.sh, clawdie-live-selfcheck-test.sh, and
  clawdie-birth-certificate-test.sh.
- Update docs/HANDOFF-POUDRIERE-BUILDER.md to retire the obsolete
  /var/db/clawdie/machine-id acceptance step.
fix(live): validate raw /etc/machine-id bytes across all three readers
All checks were successful
format-check / gates (pull_request) Successful in 2m55s
c6eaf160e0
Closes the byte-level reader disagreement caught during review:
- Python readers (clawdie_evidence_lib.read_machine_id and
  clawdie-live-selfcheck.check_machine_id) now use Path.read_bytes()
  with re.fullmatch(rb'([0-9a-f]{32})\n?', raw) instead of read_text(),
  so CRLF and lone CR are no longer translated to LF and accepted.
- Shell probe (clawdie-system-probe.collect_machine_id) now validates
  the raw file bytes (total byte length 32 or 33, exactly 32 ASCII
  lowercase hex bytes, and if 33 bytes then byte 33 is 0x0a LF) before
  assigning to any shell variable, so NUL-padded files cannot slip
  past POSIX command substitution NUL stripping.
- Added CRLF, lone CR, NUL+LF, and lone NUL rejection fixtures across
  all three reader test suites (238/238 checks passing on debby, and
  verified raw-byte shell validation on FreeBSD 15.1-RELEASE-p7).
clawdie deleted branch refactor/single-etc-machine-id 2026-11-21 14:10:42 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
clawdie/clawdie-iso!92
No description provided.