exec-credential: Log if we skip duplicate credential
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 31 Jul 2024 13:01:40 +0000 (15:01 +0200)
committerLuca Boccassi <bluca@debian.org>
Thu, 15 Aug 2024 13:04:41 +0000 (14:04 +0100)
(cherry picked from commit 590348e2bf8415053487324d47d0083b49dfdeb0)

src/core/exec-credential.c

index fcb5df8a37b4cf4bf67d218abe874d7bc7a0c786..8ed5b8a9893194034f06163e4257da6ed803b5f8 100644 (file)
@@ -715,8 +715,10 @@ static int acquire_credentials(
                  * EEXIST if the credential already exists. That's because the TPM2-based decryption is kinda
                  * slow and involved, hence it's nice to be able to skip that if the credential already
                  * exists anyway. */
-                if (faccessat(dfd, sc->id, F_OK, AT_SYMLINK_NOFOLLOW) >= 0)
+                if (faccessat(dfd, sc->id, F_OK, AT_SYMLINK_NOFOLLOW) >= 0) {
+                        log_debug("Skipping credential with duplicated ID %s", sc->id);
                         continue;
+                }
                 if (errno != ENOENT)
                         return log_debug_errno(errno, "Failed to test if credential %s exists: %m", sc->id);