Repository navigation
Verify enrollment and management sleep inhibitors through logind - #28
Open
denisvmedia wants to merge 1 commit into
Open
denisvmedia wants to merge 1 commit into
denisvmedia wants to merge 1 commit into
Conversation
On Ubuntu, systemd-inhibit --list rejects --json=short, so the registration check always failed. Native enrollment stopped before capture and identity management refused to run. Ask logind directly with busctl ListInhibitors. Validate the a(ssssuu) reply and require the same live child PID, the exact operation label, the sleep scope and block mode. Acquisition and lifetime handling are unchanged, and an unverified inhibitor still blocks the operation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On Ubuntu,
systemd-inhibit --list --json=shortfails because the command does not support that JSON option. Native enrollment stops before capture (the desktop shows only "Enrollment stopped"), and identity-management operations such as rollback fail with "sleep inhibitor could not be established".This change queries logind's structured
ListInhibitorsmethod throughbusctl --system --json=shortinstead. The reply must have thea(ssssuu)shape with well-typed rows, and a row must match the same live child PID, the exact operation label, thesleepscope andblockmode. The child must still be alive after the query. Inhibitor acquisition, the parent pipe and lifetime handling are unchanged, and a missing or malformed reply still blocks the operation.Scope: this serves the enrollment and management safety requirement that a biometric mutation only runs under a verified sleep inhibitor. It changes only two installed Python commands and adds tests. It creates no persistent state or machine configuration. Upgrade replaces the two commands; reverting the change restores the previous check and its refusal on affected systems. The query itself performs no biometric mutation.
Hardware risk: low. The change only affects a read-only precondition check.
Tested:
T2_TOUCHID_USER=test python -m unittest discover -s testson Linux (Python 3.14.4), as an unprivileged user: 1682 tests passed, 2 skipped. This includes 16 new tests that cover both callers, mismatched inhibitors, a dead or exiting child process, query failure, and malformed replies.py_compileforsrc/*.pyandtests/*.py,git diff --check, ShellCheck 0.11.0 on the CI file set,tools/privacy-check.sh, andenrollment_research/scripts/check-public-tree.sh.Not tested: the Python 3.12 CI job and the userspace C build (no C changes here). This PR does not qualify suspend/resume or graphical unlock.
Kernel selection, GRUB configuration, the account-generation recovery, experimental creation version 3, and the persistence-recovery changes stay out of this PR.
Related to #27 (inhibitor portion only).