]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/exec-credential: drop misleading comment regarding EEXIST
authorMike Yuan <me@yhndnzj.com>
Wed, 31 Jul 2024 17:03:44 +0000 (19:03 +0200)
committerMike Yuan <me@yhndnzj.com>
Sun, 4 Aug 2024 04:51:28 +0000 (06:51 +0200)
Follow-up for 2c2ed3272b992b6eb13864e49847c943e42be00f

As explained in the referenced commit, we shall never get EEXIST
in the first place.

src/core/exec-credential.c

index 9a0a4f91987ac4ed2cb06f47e75b8cf95337ecbd..b9c1fcdf16d816970311e7a38a6db711d0bf3e02 100644 (file)
@@ -868,10 +868,6 @@ static int acquire_credentials(
                 const char *data;
                 size_t size, add;
 
-                /* Note that we check ahead of time here instead of relying on O_EXCL|O_CREAT later to return
-                 * 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) {
                         log_debug("Skipping credential with duplicated ID %s", sc->id);
                         continue;