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 #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 5202ee4)
  • Loading branch information
poettering authored and keszybz committed Jul 22, 2024
1 parent 6a3cb4c commit 995c702
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 995c702

Please sign in to comment.