From ecf6b7c323fd5dd419f869c278e14f48f90e9952 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Tue, 2 Mar 2021 15:10:33 +0100 Subject: [PATCH] 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 --- pam/pam_fprintd.c | 2 +- tests/pam/test_pam_fprintd.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pam/pam_fprintd.c b/pam/pam_fprintd.c index 8cbd01c..64263b8 100644 --- a/pam/pam_fprintd.c +++ b/pam/pam_fprintd.c @@ -565,7 +565,7 @@ do_verify (sd_bus *bus, } 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")) { diff --git a/tests/pam/test_pam_fprintd.py b/tests/pam/test_pam_fprintd.py index be66818..a874b64 100644 --- a/tests/pam/test_pam_fprintd.py +++ b/tests/pam/test_pam_fprintd.py @@ -97,7 +97,7 @@ class TestPamFprintd(dbusmock.DBusTestCase): ] 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' ]) self.assertRegex(res.info[0], r'Swipe your left little finger across the fingerprint reader')