summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Johnson <rob@cs.stonybrook.edu>2013-06-03 08:45:11 -0400
committerRay Strode <rstrode@redhat.com>2013-06-03 08:56:22 -0400
commitb4f53045659d09499ac082f93c741cb196f5a5c1 (patch)
treeb4ff4bedb036ba9311fb9e83569c6f2b8aae1452
parent9c99e5cd59fc942ea0d5f5d1263424eaf78c27b4 (diff)
pam: return PAM_UNKNOWN_USER when user is unenrolled
This commit makes pam_fprintd return PAM_UNKNOWN_USER when the user has not enrolled a fingerprint. This lets the administrator set up pam_fprintd as a required authentication, method, but only for users that have enrolled a fingerprint, as such: auth [success=ok user_unknown=ignore default=die] pam_fprintd.so max_tries=1 timeout=-1 auth [success=1 default=ignore] pam_unix.so nullok_secure auth requisite pam_deny.so With this config, users w/o an enrolled fingerprint will just be asked for a password. Users with an enrolled fingerprint will required to login using both their fingerprint and a password. https://bugs.freedesktop.org/show_bug.cgi?id=64781
-rw-r--r--pam/pam_fprintd.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/pam/pam_fprintd.c b/pam/pam_fprintd.c
index 7e1f954..0f5e5a4 100644
--- a/pam/pam_fprintd.c
+++ b/pam/pam_fprintd.c
@@ -317,6 +317,9 @@ static int do_verify(GMainLoop *loop, pam_handle_t *pamh, DBusGProxy *dev, gbool
data->timed_out = FALSE;
if (!dbus_g_proxy_call (dev, "VerifyStart", &error, G_TYPE_STRING, "any", G_TYPE_INVALID, G_TYPE_INVALID)) {
+ if (dbus_g_error_has_name(error, "net.reactivated.Fprint.Error.NoEnrolledPrints"))
+ ret = PAM_USER_UNKNOWN;
+
D(pamh, "VerifyStart failed: %s", error->message);
g_error_free (error);