]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
import-creds: when we hit ENOENT on SMBIOS 11 do not even debug log
authorLennart Poettering <lennart@poettering.net>
Thu, 11 Jul 2024 12:32:09 +0000 (14:32 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 12 Jul 2024 02:45:29 +0000 (04:45 +0200)
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.

src/core/import-creds.c

index 4008ea43e9eea5eea8928b99b6ed5e2601d309da..8cc4e19ab6dee1c3edac39891a7cc520e4b05de8 100644 (file)
@@ -583,9 +583,10 @@ static int import_credentials_smbios(ImportCredentialContext *c) {
                 size_t size;
 
                 r = read_smbios11_field(i, CREDENTIALS_TOTAL_SIZE_MAX, &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 read SMBIOS type #11 object %u, ignoring: %m", i);
+                        log_warning_errno(r, "Failed to read SMBIOS type #11 object %u, ignoring: %m", i);
                         break;
                 }