Skip to content

Commit

Permalink
import-creds: when we hit ENOENT on SMBIOS 11 do not even debug log
Browse files Browse the repository at this point in the history
We'll *always* hit ENEOENT when iterating through SMBIOS type systemd#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 f084959)
  • Loading branch information
poettering authored and bluca committed Jul 24, 2024
1 parent 8e8efdd commit 342938b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/import-creds.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 342938b

Please sign in to comment.