Skip to content

tools: aurora-touchid: keep the distro polkit stack; remove only our polkit-1 - #2988

Draft
Alyx-ML wants to merge 1 commit into
aurora-silicon:mainfrom
Alyx-ML:aurora/touchid-polkit
Draft

Alyx-ML wants to merge 1 commit into
aurora-silicon:mainfrom
Alyx-ML:aurora/touchid-polkit

Conversation

@Alyx-ML

@Alyx-ML Alyx-ML commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Part of the #2755 split. Draft until it has a run on a Mac (the last Evidence line says which).

Summary

 configure_pam
-  write our own /etc/pam.d/polkit-1
+  no polkit-1: write the system-auth stack;  a packaged copy: copy it once;  an admin's file: keep it
 remove_pam
+  delete polkit-1 only if it is ours

Evidence

  • Before: the setup replaced the distribution's polkit PAM stack. A host harness fails 6 of
    its 13 checks on the old script.
  • After: the harness passes 13/13. test_touchid_setup.py passes 50/50 in the fork:
    passed, Extra host tests, SEP source checks.
  • Needed before merging: on a Mac with Touch ID, the setup, a polkit prompt (for example
    pkexec true), and the removal.

Merge Danger

Door: two-way

Blast Radius: polkit sign-in prompts

…polkit-1

Without /etc/pam.d/polkit-1, aurora-touchid-setup wrote its own stack:
pam_fprintd, then bare pam_unix lines for auth, account, password and
session. That file overrides the polkit package's stack in /usr/lib/pam.d.
It dropped what system-auth adds, such as pam_faillock and the account
checks. --remove then took out only the fingerprint line, so the bare stack
stayed for good.

Now the script copies /usr/lib/pam.d/polkit-1 when there is one, and
adds only the pam_fprintd line. Otherwise it writes Arch's polkit-1
stack (include system-auth). The file starts with a marker line.
--remove deletes /etc/pam.d/polkit-1 only when it carries that marker.
An admin's own file is edited back as before and never deleted.

Verified: a host harness runs configure_pam and remove_pam in a fake root
(a GNU sed -i stand-in, sudo off) for three cases. With no polkit-1: the
system-auth stack, then deleted again. With a packaged copy: it is copied,
and a second run adds no second line. With an admin's file: it is kept.
13/13 checks pass. The same harness fails 6 checks on the old script.
shellcheck is not installed here. bash -n passes.

Signed-off-by: Alyx-ML <256263590+Alyx-ML@users.noreply.github.com>
@RyanTheTide

Copy link
Copy Markdown
Contributor

@Alyx-ML checking open drafts today. To come out of draft, this still needs:

  • A test run at the current head on a Mac with the hardware it touches, then mark it ready for review.

If it's no longer needed, say so here and we'll close it. Otherwise it stays open as a draft until these are done.

@Alyx-ML

Alyx-ML commented Nov 27, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for checking. This is still needed, and it merges cleanly with main. It stays a draft
until someone with a Mac runs the test under "Needed before merging" in the description.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor

Row at this head (ee25983b) on our M1 Pro (J316s), Fedora 45 Aurora, kernel 7.3.0-1675a623. The system has only the packaged /usr/lib/pam.d/polkit-1, no /etc copy. No finger was available, so I ran the script's configure_pam and remove_pam directly as root (the enrol and verify steps were skipped). /etc/pam.d was backed up first and restored after; it ended identical to the backup.

Step Result
configure_pam with no /etc/pam.d/polkit-1 writes it as the marker + the packaged stack + auth sufficient pam_fprintd.so
pkexec true, right password (wheel user, no prints enrolled) authenticated, rc 0
pkexec true, wrong password refused, rc 127
remove_pam deletes the marked polkit-1 and omarchy-lock-fingerprint; /etc/pam.d identical to the backup
pkexec true after removal (packaged stack) rc 0
polkit-1 written by an admin (no marker) kept; only the pam_fprintd line is added and later removed

PASS for the PAM handling. One nit, not a blocker and the same as before for sudo: sed '1i' puts the fingerprint line above the #%PAM-1.0 header. A finger-in-the-loop polkit prompt wasn't run.

@Alyx-ML that covers the setup, polkit prompt and removal from "Needed before merging" (with a password, not a finger). If you're happy with that, could you mark it ready for review? Or say if you'd like us to.

This branch has not been deployed

No deployments
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.

2 participants