diff --git a/pam/pam_fprintd.c b/pam/pam_fprintd.c index d6313c5..20e7975 100644 --- a/pam/pam_fprintd.c +++ b/pam/pam_fprintd.c @@ -433,6 +433,9 @@ do_verify (pam_handle_t *pamh, data->max_tries--; } + if (data->max_tries == 0) + ret = PAM_MAXTRIES; + sd_bus_slot_unref (verify_status_slot); sd_bus_slot_unref (verify_finger_selected_slot); diff --git a/tests/pam/test_pam_fprintd.py b/tests/pam/test_pam_fprintd.py index 8022190..def88b2 100755 --- a/tests/pam/test_pam_fprintd.py +++ b/tests/pam/test_pam_fprintd.py @@ -29,6 +29,7 @@ PAM_SUCCESS = 0 PAM_AUTH_ERR = 7 PAM_AUTHINFO_UNAVAIL = 9 PAM_USER_UNKNOWN = 10 +PAM_MAXTRIES = 11 class TestPamFprintd(dbusmock.DBusTestCase): '''Test pam_fprintd''' @@ -127,7 +128,7 @@ class TestPamFprintd(dbusmock.DBusTestCase): ] self.device_mock.SetVerifyScript(script) - tc = pypamtest.TestCase(pypamtest.PAMTEST_AUTHENTICATE, expected_rv=PAM_AUTH_ERR) + tc = pypamtest.TestCase(pypamtest.PAMTEST_AUTHENTICATE, expected_rv=PAM_MAXTRIES) res = pypamtest.run_pamtest("toto", "fprintd-pam-test", [tc], [ 'unused' ]) self.assertRegex(res.info[0], r'Swipe your left little finger across the fingerprint reader')