]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
homework: fix return codes when using fido2/pkcs11 cached passwords
authorLennart Poettering <lennart@poettering.net>
Mon, 31 May 2021 20:15:48 +0000 (22:15 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 1 Jun 2021 11:32:36 +0000 (13:32 +0200)
Otherwise we'll accidently report a record we can safely decrypt as not
decrypted.

src/home/homework.c

index a6e663503bd62c0c493756b252e2e9ec9c5d88f7..ed6fc2c3449f8e0d96f73fe134f0c86f0976e590 100644 (file)
@@ -127,7 +127,7 @@ int user_record_authenticate(
                                 return log_error_errno(r, "Failed to check supplied FIDO2 password: %m");
                         if (r > 0) {
                                 log_info("Previously acquired FIDO2 password unlocks user record.");
-                                return 0;
+                                return 1;
                         }
                 }
         }
@@ -180,7 +180,7 @@ int user_record_authenticate(
                         if (r < 0)
                                 return log_oom();
 
-                        return 0;
+                        return 1;
                 }
 #else
                 need_token = true;