Here's a full write-up, ready to paste into a new GitHub issue on TickLabVN/biopass:
Title: sudo/PAM authentication always falls back to password — PipeWire refuses to start under root (ConditionUser=!root), camera capture silently fails
Body:
Summary
When using libbiopass_pam.so for sudo authentication (via a custom authselect profile on Fedora), face authentication never succeeds and always silently falls through to the password prompt — despite a correctly enrolled face and a working GUI-based test. The biopass-helper process does spawn and the IR strobe fires, but no successful capture ever occurs.
Root cause
sudo runs PAM (and therefore libbiopass_pam.so → biopass-helper) as root. PipeWire's systemd user units have a hard condition preventing them from running as root:
Jul 13 21:26:20 Flip13 systemd[40087]: pipewire-pulse.socket - PipeWire PulseAudio skipped, unmet condition check ConditionUser=!root
Jul 13 21:26:20 Flip13 systemd[40087]: pipewire.socket - PipeWire Multimedia System Sockets skipped, unmet condition check ConditionUser=!root
Because biopass-helper relies on GstPipeWireSrc for camera capture (per issue #49's investigation), and PipeWire never starts a session for root, the capture pipeline has no source to read from. The helper still spawns, the camera briefly activates (IR strobe fires), but no usable frame is ever captured, so recognition can never succeed — and no debug data is written, since the pipeline dies before reaching that stage.
Steps to reproduce
- Fedora (or any distro), face enrolled and working via the GUI
- Create a custom
authselect profile based on local, adding auth sufficient libbiopass_pam.so above pam_unix.so in system-auth and password-auth
sudo authselect select custom/<profile> --force
- Run
sudo -k && sudo true
- Observe: IR strobe fires,
biopass-helper process spawns (confirmed via ps aux), but authentication always falls through to password
Diagnostic evidence
journalctl -t biopass-helper — no entries, even with debug: true set in config.yaml
~/.local/share/com.ticklab.biopass/debugs/ and /root/.local/share/com.ticklab.biopass/ — both empty/nonexistent after multiple sudo attempts, meaning the helper isn't writing debug output for this path at all
journalctl -f | grep -iE "biopass|pipewire|v4l2|camera" during a sudo attempt shows only the PipeWire ConditionUser=!root skip messages — no biopass-specific output whatsoever
- SELinux confirmed disabled (
getenforce → Disabled), ruling out MAC as a factor
- Module file permissions confirmed correct (
-rwxr-xr-x, world-readable)
authselect current and cat /etc/pam.d/system-auth confirm the PAM stack is correctly wired with libbiopass_pam.so listed first as sufficient
Suggested fixes
- Have
biopass-helper detect when it's running in a root/no-session context (e.g. sudo) and fall back to direct V4L2 device access (/dev/videoN) instead of GstPipeWireSrc, since PipeWire is architecturally unavailable to root.
- Alternatively, have the helper connect to the invoking (non-root) user's existing PipeWire session/socket rather than trying to start its own as root — similar to how some audio tools bridge into a user's running PipeWire instance from a privileged context.
- At minimum, log a clear, user-facing error (both to stderr and the debug directory) when PipeWire is unavailable, rather than silently falling through to
PAM_AUTH_ERR with zero diagnostic trace — this would have saved significant debugging time.
Environment
- Distro: Fedora (authselect-based, not pam-auth-update)
- PAM integration: manual custom
authselect profile (custom/biopass, based on local)
- Auth method: Face (EdgeFace XS, gamma 0.6), enrolled and working via GUI
debug: true set in config, but no debug output produced for sudo-triggered attempts specifically
Feel free to add your actual Biopass version (biopass --version or check the package) and Fedora version before posting — I didn't have those on hand from our conversation.
Here's a full write-up, ready to paste into a new GitHub issue on
TickLabVN/biopass:Title:
sudo/PAM authentication always falls back to password — PipeWire refuses to start under root (ConditionUser=!root), camera capture silently failsBody:
Summary
When using
libbiopass_pam.soforsudoauthentication (via a customauthselectprofile on Fedora), face authentication never succeeds and always silently falls through to the password prompt — despite a correctly enrolled face and a working GUI-based test. Thebiopass-helperprocess does spawn and the IR strobe fires, but no successful capture ever occurs.Root cause
sudoruns PAM (and thereforelibbiopass_pam.so→biopass-helper) as root. PipeWire's systemd user units have a hard condition preventing them from running as root:Because
biopass-helperrelies onGstPipeWireSrcfor camera capture (per issue #49's investigation), and PipeWire never starts a session for root, the capture pipeline has no source to read from. The helper still spawns, the camera briefly activates (IR strobe fires), but no usable frame is ever captured, so recognition can never succeed — and no debug data is written, since the pipeline dies before reaching that stage.Steps to reproduce
authselectprofile based onlocal, addingauth sufficient libbiopass_pam.soabovepam_unix.soinsystem-authandpassword-authsudo authselect select custom/<profile> --forcesudo -k && sudo truebiopass-helperprocess spawns (confirmed viaps aux), but authentication always falls through to passwordDiagnostic evidence
journalctl -t biopass-helper— no entries, even withdebug: trueset inconfig.yaml~/.local/share/com.ticklab.biopass/debugs/and/root/.local/share/com.ticklab.biopass/— both empty/nonexistent after multiplesudoattempts, meaning the helper isn't writing debug output for this path at alljournalctl -f | grep -iE "biopass|pipewire|v4l2|camera"during asudoattempt shows only the PipeWireConditionUser=!rootskip messages — no biopass-specific output whatsoevergetenforce→Disabled), ruling out MAC as a factor-rwxr-xr-x, world-readable)authselect currentandcat /etc/pam.d/system-authconfirm the PAM stack is correctly wired withlibbiopass_pam.solisted first assufficientSuggested fixes
biopass-helperdetect when it's running in a root/no-session context (e.g.sudo) and fall back to direct V4L2 device access (/dev/videoN) instead ofGstPipeWireSrc, since PipeWire is architecturally unavailable to root.PAM_AUTH_ERRwith zero diagnostic trace — this would have saved significant debugging time.Environment
authselectprofile (custom/biopass, based onlocal)debug: trueset in config, but no debug output produced forsudo-triggered attempts specificallyFeel free to add your actual Biopass version (
biopass --versionor check the package) and Fedora version before posting — I didn't have those on hand from our conversation.