-
Notifications
You must be signed in to change notification settings - Fork 31
profiles: fprint: Fix fingerprint sudo integration #245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,15 +24,13 @@ priority = 5 | |
| packages = "fprintd" | ||
| post_install = """ | ||
| systemctl enable fprintd.service | ||
| mkdir -p /etc/pam.d/sudo.d | ||
| cat > /etc/pam.d/sudo.d/50-fprintd.conf <<'EOF' | ||
| # Managed by chwd - DO NOT EDIT | ||
| auth sufficient pam_fprintd.so | ||
| EOF | ||
| if [ -f /etc/pam.d/sudo ] && ! grep -q 'chwd-fprintd' /etc/pam.d/sudo; then | ||
| sed -i '0,/^auth/{s//auth sufficient pam_fprintd.so # chwd-fprintd\n&/}' /etc/pam.d/sudo | ||
| fi | ||
| """ | ||
| post_remove = """ | ||
| if grep -q 'Managed by chwd' /etc/pam.d/sudo.d/50-fprintd.conf 2>/dev/null; then | ||
| rm -f /etc/pam.d/sudo.d/50-fprintd.conf | ||
| if [ -f /etc/pam.d/sudo ]; then | ||
| sed -i '/# chwd-fprintd/d' /etc/pam.d/sudo | ||
| fi | ||
|
Comment on lines
31
to
34
|
||
| if ! systemctl list-dependencies --reverse fprintd.service 2>/dev/null | grep -q .; then | ||
| systemctl disable fprintd.service | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The guard only checks for the marker string (
chwd-fprintd). If a user/system already has anauth ... pam_fprintd.soline (without this marker), this will insert a secondpam_fprintdentry, which can lead to multiple fingerprint prompts and a confusing PAM stack. Consider also checking for an existingpam_fprintd.soauth line (or otherwise detecting an existing fprint configuration) before inserting.