pam_fprintd: Just return a PAM_AUTH_ERROR on unknown errors

If something under the hood failed with a generic device error we'd just
mark the PAM module not available, this is probably too much as it may
just be due to a device temporary error.

So make it stop but allow the loading system to retry with it
This commit is contained in:
Marco Trevisan (Treviño)
2021-03-02 15:10:33 +01:00
parent df6ebefef7
commit ecf6b7c323
2 changed files with 2 additions and 2 deletions

View File

@ -565,7 +565,7 @@ do_verify (sd_bus *bus,
} }
else if (str_equal (data->result, "verify-unknown-error")) else if (str_equal (data->result, "verify-unknown-error"))
{ {
return PAM_AUTHINFO_UNAVAIL; return PAM_AUTH_ERR;
} }
else if (str_equal (data->result, "verify-disconnected")) else if (str_equal (data->result, "verify-disconnected"))
{ {

View File

@ -97,7 +97,7 @@ class TestPamFprintd(dbusmock.DBusTestCase):
] ]
self.device_mock.SetVerifyScript(script) self.device_mock.SetVerifyScript(script)
tc = pypamtest.TestCase(pypamtest.PAMTEST_AUTHENTICATE, expected_rv=PAM_AUTHINFO_UNAVAIL) tc = pypamtest.TestCase(pypamtest.PAMTEST_AUTHENTICATE, expected_rv=PAM_AUTH_ERR)
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')