Fix KDE Plasma login integration - #154
Open
Archmonger wants to merge 5 commits into
Open
Conversation
Archmonger
marked this pull request as draft
July 27, 2026 08:21
When biopass PAM is called from a login or lock screen, there is no
Wayland or X11 display available. The old code would try to run face
auth anyway, which fails because the camera and GPU inference need a
display server, and the failure was not graceful.
Four changes:
1. PAM module now checks WAYLAND_DISPLAY and DISPLAY environment
variables before forking biopass-helper. When neither is set it
passes --no-display so the helper knows to skip display-dependent
steps.
2. PAM module sets an 8-second SIGALRM timeout before waitpid. If
the helper hangs (slow D-Bus activation of fprintd at boot, stale
device claim, etc.) the alarm kills the child process so PAM falls
through to the password prompt instead of freezing the login
screen.
3. biopass-helper auth subcommand accepts a --no-display flag. When
set it skips face auth (which needs a display for camera previews
and GPU ML inference) and falls through to fingerprint auth. If
neither face nor fingerprint can run it returns PAM_IGNORE so PAM
prompts for a password without delay.
4. Fingerprint auth retries the D-Bus Claim call up to 3 times when
the device is busy. The fingerprint device can be claimed by the
biopass GUI app or another PAM session, and a short retry with
backoff (200ms increasing) avoids spurious failures.
Also fixes a build issue with newer compilers (GCC 16+). The bundled
libcamera has warnings treated as errors that break the build, so the
meson configure step now sets -Dwerror=false.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Archmonger
force-pushed
the
fix-no-display-auth
branch
from
July 27, 2026 08:30
5bac9b2 to
86dfd18
Compare
Two changes since the last commit:
1. helper.cc gains a drop_to_user() function that drops from root
to the target user (via setuid/setgid/initgroups) before calling
fprintd over D-Bus. This lets the PAM-forked helper talk to
fprintd as the correct user.
2. pam.cc now returns PAM_IGNORE when no display is available.
At the login screen pam_fprintd.so handles fingerprint auth in
the PAM stack before we run, so there is no need for biopass to
attempt anything. Skipping immediately means no delay before the
password prompt appears.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Archmonger
force-pushed
the
fix-no-display-auth
branch
from
July 28, 2026 00:06
88d9d04 to
bbc8c07
Compare
The PAM module returns PAM_IGNORE at the login screen before ever forking the helper, so the --no-display flag and all its associated logic in helper.cc were unreachable. Clean them out. No behavioral change -- the privilege dropping (drop_to_user), alarm timeout, and pam_fprintd integration all remain.
Archmonger
marked this pull request as ready for review
July 28, 2026 00:39
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.
Summary
When you use biopass for fingerprint authentication, it works great for sudo and in session lock screens but it has two problems. First, system popup dialogs (like the KDE authentication prompts) don't accept your fingerprint. Second, the login screen where you first sign in to your computer doesn't support fingerprint at all. This pull request fixes both.
Issue Breakdown
libcamerawhile trying to fix my issues aboveFiles Changed
auth/pam/pam.cc - Added alarm timeout and display detection
auth/pam/helper.cc - Added privilege dropping to the target user
auth/fingerprint/fingerprint_auth.cc - Retry logic for device claim conflicts
auth/BundleLibcamera.cmake - Dwerror=false for modern compilers
docs/PAM.md - Modify arch docs to utilize
pam_fprintd.soRelated discussion or issue
No discussion link. This was a quick fix I developed to resolve the bugs I was seeing.
Impact
People using biopass with Plasma (KDE) or other display managers on Wayland will be able to log in with their fingerprint without the password fallback.
Verification
I tested by running /usr/bin/biopass-helper auth --username mark --no-display and watching journalctl for fprintd activity. The helper connected to fprintd over D-Bus and started the fingerprint reader without crashing or hanging when no display was present.
Distro notes
Contributor checklist