Face unlock: let polkit's sandboxed PAM helper open cameras
CI / test (push) Canceled after 28m1s

polkit 126+ runs the password dialog's PAM stack in polkit-agent-helper@.service,
whose PrivateDevices=yes leaves no cameras in /dev, so the dialog reported "no
camera" while sudo and enrolling worked. Install a drop-in that allows only V4L2
devices and keeps the capability and syscall limits PrivateDevices= added.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
nandiandClaude Sonnet 5.5 committed 2026-11-25 22:33:44 -08:00
1 parent 2752b81e36
commit 738928352e
3 files changed
+59

No files matched your search

+12
View File
@@ -88,6 +88,18 @@ as…", "Failure, timeout reached", "Face detection image too dark"), so if you
keep `pam_howdy.so` and the dialog shows its progress the same way; Settings says which PAM
services use Howdy. Faces you enrolled with Howdy are managed with `sudo howdy add`/`remove`.
## polkit's sandbox
Since polkit 126, the password dialog's PAM stack runs in `polkit-agent-helper@.service`, which
has `PrivateDevices=yes`: its `/dev` has no cameras. The symptom is that sudo, enrolling and
`chandra-face status` find the camera, while the dialog says "no camera at …; no camera that takes
pictures is connected". `just install` adds a drop-in
(`face/polkit-agent-helper.conf`, as
`/etc/systemd/system/polkit-agent-helper@.service.d/50-chandra-face.conf`) that turns that off and
allows only V4L2 devices (`DevicePolicy=closed`, `DeviceAllow=char-video4linux rw`), keeping the
capability and syscall restrictions `PrivateDevices=` added. The rest of the unit's sandbox stays.
It applies from the next dialog, with no restart or new login. `just uninstall` removes it.
## PAM
`chandra-face pam enable SERVICE` adds this line before the service's first `auth` (or