Repository navigation
Conversation
|
Converting to draft: the native-mode procedure in this PR is wrong and is being rewritten around On a Linux-native machine, the troubleshooting steps added here ( The native path for account-generation drift is Next: point native first-run's error and the docs at |
The account generation includes the passwd database epoch, so a package installation whose sysusers hook adds system users changes it. Linux-native first run then said "explicit disabled rebinding and live reconciliation are required", naming the user-map rebind-disabled and enable-reconciled path. That path republishes users.json, while the native provisioning and activation journals pin its generation, so following it leaves first run failing with "protected Linux-native replacement authority does not reconcile", and t2-native-authority-rebind then refuses because the mapping already carries the current generation. Name t2-native-authority-rebind in the first-run error instead. It keeps the mapping and its history intact and records the prior account generation as an alias. Document the native procedure, the warning against the user-map path, and the current limit: one rebind record covers one account change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
d70b367 to
86f7962
Compare
A native account rebind record covers one account change. After a second passwd rewrite (for example another package adding a system user) resolve() raised because the recorded current generation no longer matched, so every Linux account assertion failed with "native account migration binding is invalid", and publish() refused because a record already existed. There was no supported recovery. Validate the record's structure in one helper. A well-formed record whose current generation no longer matches now grants no alias, so the account reads as changed and first run names the rebind again. publish() replaces such a stale record, but only when its prior and mapping generations still match the validated authority. It writes under a unique temporary name, rechecks the record before the atomic rename, and keeps the protected readback. A record that is still current, malformed, or foreign is refused. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks for tracking this down, and for the clear account of why the user-map path can't restore a native authority. We're closing this as superseded, revised version included. T2Touch is moving its Touch ID support into Omarchy itself, and the native first-run, enrollment and user-map tools this PR changes are being replaced there. That's also why we're not taking up your two review questions, on whether The new design doesn't use |
What changed
On a Linux-native installation, an account-generation change led users into a path that permanently broke the native authority. This PR points them at the right command instead.
The account generation includes the passwd database epoch. Any rewrite of
/etc/passwdor/etc/shadowchanges it, and a package installation whosesystemd-sysusershook adds system users is enough. Native first run then stopped with "selected Linux account generation changed; explicit disabled rebinding and live reconciliation are required". That message, and the README, name the user-map path:t2-touchid-user-map rebind-disabledfollowed byenable-reconciled.That path cannot work for a Linux-native authority:
users.jsongeneration._load_provisioned_authorityrequiresactivation.enabled_mapping_generation == mapping_set.generation.t2-native-authority-rebindthen refuses too, because the mapping already carries the current generation.The intended native tool is
t2-native-authority-rebind(t2_native_account_rebind). It leavesusers.jsonand its history byte-for-byte intact, and records the prior account generation as an alias thatt2_linux_account.collectaccepts.Changes:
src/t2-native-enroll.py: the first-run account-generation error now says "confirm the account, then run t2-native-authority-rebind". A comment explains why the user-map rebind cannot apply.src/t2_native_account_rebind.py: a stale rebind record no longer blocks recovery after a second account change (see "Stale rebind records" below).docs/TROUBLESHOOTING.md: a new section with the native procedure. It also explains why the acknowledgement holds on the same installation, warns against the user-map path for native authorities, and explains how a later account change is handled.README.md: the upgrade note sends native authorities tot2-native-authority-rebind. It keeps the existing disabled-rebind wording for other mappings, which this PR does not evaluate.src/README.mdandCHANGELOG.md: matching notes.Behavior changes: the first-run error text, and the stale-record handling in
t2_native_account_rebind.An earlier revision of this PR changed
enable-reconciledto accept a pending adaptive user Catacomb (state 7). That change is withdrawn. It only addressed a symptom of following the user-map path, which cannot restore a native authority anyway.Hardware evidence
MacBookPro16,1,
linux-nativeauthority. A desktop package installation rewrote the passwd database, and first run failed with the old message. Following it (rebind-disabled, thenenable-reconciled) produced exactly the failure above.Recovery on that machine:
users.jsonfrom a filesystem snapshot taken before the package installation, keeping the rewritten file as a backup.t2-native-authority-rebind --linux-uid 1000 --acknowledge-complete-native-authority-migrationreportedcomplete_authority_validated: true.t2-native-first-run,t2-biometric-ready,t2-touchid-post-rebootandfprintdall started.t2-touchid-doctorpassed every check except the existing suspend-mode warning.A second package installation later added another system user on the same machine. With
main's module, first run failed with "native account migration binding is invalid",t2-touchid-user-map statusfailed with "live Linux account assertion failed", and the rebind refused because a record existed. With this branch's two files installed:statusreportedaccount-generation-changedagain.t2-native-authority-rebindvalidated the complete authority and replaced its own stale record.users.jsonwas byte-identical before and after.Stale rebind records
A rebind record covers one account change. On
main, a later passwd rewrite made the record a dead end:resolve()raised because the recorded current generation no longer matched.t2_linux_account.collectthen failed with "native account migration binding is invalid", so even the account assertion thatpublish()needs could not run.publish()refused because a record already existed.Every later package installation that adds a system user hit this. The fix:
_manifest(). Malformed, foreign or wrong-UID records still fail closed.resolve()returnsNonefor a well-formed record whose current generation no longer matches. A stale record grants no alias, so the account reads as changed and first run names the rebind again.publish()replaces a stale record, but only when its prior generation and mapping generation still match the validated authority.--acknowledge-complete-native-authority-migrationflag. It states the same complete-authority condition as the first rebind.Review notes
t2-touchid-user-maprefuserebind-disabledandenable-reconciledfor a Linux-native authority, instead of only documenting the hazard?Tests
test_account_generation_change_names_the_native_rebindintests/test_native_enrollment_authority.py. It fails againstmainand passes here.tests/test_native_account_rebind.py:None), and still raises for a changed authority.main(replace, abort, stale-no-alias, other authority); the still-current and malformed guards pass on both.python -m unittest discover -s tests, 1656 tests OK (1 skipped).py_compile,tools/privacy-check.shandenrollment_research/scripts/check-public-tree.shpass.🤖 Generated with Claude Code