mirror of
https://gitlab.freedesktop.org/libfprint/fprintd.git
synced 2026-01-06 01:30:17 +01:00
pam: Return PAM_MAXTRIES after too many tries
This commit is contained in:
parent
6ab270fb1a
commit
affffaf134
2 changed files with 5 additions and 1 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue