]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
ask-password-api: Add more debug logging
authorDaanDeMeyer <daan.j.demeyer@gmail.com>
Sat, 5 Jul 2025 09:19:59 +0000 (11:19 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 5 Jul 2025 11:16:01 +0000 (20:16 +0900)
src/shared/ask-password-api.c

index d8a0a88b43aa09ee54f5ac0159eed1bdc18e8dce..256605ac8a0bfb120c5dad8eb3aa2ae8d047176f 100644 (file)
@@ -241,14 +241,14 @@ static int ask_password_keyring(const AskPasswordRequest *req, AskPasswordFlags
                 return -EUNATCH;
 
         r = lookup_key(req->keyring, &serial);
-        if (ERRNO_IS_NEG_NOT_SUPPORTED(r) || r == -EPERM)
+        if (ERRNO_IS_NEG_NOT_SUPPORTED(r) || IN_SET(r, -EPERM, -ENOKEY))
                 /* When retrieving, the distinction between "kernel or container manager don't support or
                  * allow this" and "no matching key known" doesn't matter. Note that we propagate EACCESS
                  * here (even if EPERM not) since that is used if the keyring is available, but we lack
                  * access to the key. */
                 return -ENOKEY;
         if (r < 0)
-                return r;
+                return log_debug_errno(r, "Failed to look up key %s in keyring: %m", req->keyring);
 
         _cleanup_strv_free_erase_ char **l = NULL;
         r = retrieve_key(serial, &l);