From b5f3e791c34206befe0355e2fb71e954cbcea4e8 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 11 Jul 2024 14:32:09 +0200 Subject: [PATCH] import-creds: when we hit ENOENT on SMBIOS 11 do not even debug log We'll *always* hit ENEOENT when iterating through SMBIOS type #11 fields, on the last one. it's very confusing to debug log about that, let's just not do it. (cherry picked from commit 5202ee42d5da0ae3a6655d2bc959a19d8c347e9d) (cherry picked from commit 995c702a347d16cfad4605f3982d5278616ea1f8) (cherry picked from commit f084959002e9efc2c4dccf410fa745b57f51f512) --- src/core/import-creds.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/import-creds.c b/src/core/import-creds.c index 12248ddb28..8e2c4ef9cd 100644 --- a/src/core/import-creds.c +++ b/src/core/import-creds.c @@ -595,9 +595,11 @@ static int import_credentials_smbios(ImportCredentialContext *c) { return log_oom(); r = read_virtual_file(p, sizeof(dmi_field_header) + CREDENTIALS_TOTAL_SIZE_MAX, (char**) &data, &size); + if (r == -ENOENT) /* Once we reach ENOENT there are no more DMI Type 11 fields around. */ + break; if (r < 0) { /* Once we reach ENOENT there are no more DMI Type 11 fields around. */ - log_full_errno(r == -ENOENT ? LOG_DEBUG : LOG_WARNING, r, "Failed to open '%s', ignoring: %m", p); + log_warning_errno(r, "Failed to open '%s', ignoring: %m", p); break; }