From 0168b13fb3000f19e6574bf9593aa81348ed26f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C6=B0=C6=A1ng=20Vi=E1=BB=87t=20Ho=C3=A0ng?= Date: Tue, 7 Jul 2026 13:38:13 +0700 Subject: [PATCH] creds-util: log when we remove a secret from a different machine --- src/shared/creds-util.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/shared/creds-util.c b/src/shared/creds-util.c index e1bf71bc37..eaee54ee57 100644 --- a/src/shared/creds-util.c +++ b/src/shared/creds-util.c @@ -610,6 +610,8 @@ int get_credential_host_secret(CredentialSecretFlags flags, struct iovec *ret) { /* Hmm, this secret is from somewhere else. Let's delete the file. Let's first acquire a lock * to ensure we are the only ones accessing the file while we delete it. */ + log_notice("'%s/%s' comes from a different machine ID, deleting.", dirname, filename); + if (flock(fd, LOCK_EX) < 0) return log_debug_errno(errno, "Failed to flock %s/%s: %m", dirname, filename);