mirror of
https://gitlab.com/mishakmak/pam-fprint-grosshack.git
synced 2026-04-08 20:03:34 +02:00
pam: Return PAM_MAXTRIES after too many tries
This commit is contained in:
@ -433,6 +433,9 @@ do_verify (pam_handle_t *pamh,
|
|||||||
data->max_tries--;
|
data->max_tries--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (data->max_tries == 0)
|
||||||
|
ret = PAM_MAXTRIES;
|
||||||
|
|
||||||
sd_bus_slot_unref (verify_status_slot);
|
sd_bus_slot_unref (verify_status_slot);
|
||||||
sd_bus_slot_unref (verify_finger_selected_slot);
|
sd_bus_slot_unref (verify_finger_selected_slot);
|
||||||
|
|
||||||
|
|||||||
@ -29,6 +29,7 @@ PAM_SUCCESS = 0
|
|||||||
PAM_AUTH_ERR = 7
|
PAM_AUTH_ERR = 7
|
||||||
PAM_AUTHINFO_UNAVAIL = 9
|
PAM_AUTHINFO_UNAVAIL = 9
|
||||||
PAM_USER_UNKNOWN = 10
|
PAM_USER_UNKNOWN = 10
|
||||||
|
PAM_MAXTRIES = 11
|
||||||
|
|
||||||
class TestPamFprintd(dbusmock.DBusTestCase):
|
class TestPamFprintd(dbusmock.DBusTestCase):
|
||||||
'''Test pam_fprintd'''
|
'''Test pam_fprintd'''
|
||||||
@ -127,7 +128,7 @@ class TestPamFprintd(dbusmock.DBusTestCase):
|
|||||||
]
|
]
|
||||||
self.device_mock.SetVerifyScript(script)
|
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' ])
|
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')
|
self.assertRegex(res.info[0], r'Swipe your left little finger across the fingerprint reader')
|
||||||
|
|||||||
Reference in New Issue
Block a user