Skip to content

Commit 995c702

Browse files
poetteringkeszybz
authored andcommitted
import-creds: when we hit ENOENT on SMBIOS 11 do not even debug log
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 5202ee4)
1 parent 6a3cb4c commit 995c702

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/core/import-creds.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,9 +595,11 @@ static int import_credentials_smbios(ImportCredentialContext *c) {
595595
return log_oom();
596596

597597
r = read_virtual_file(p, sizeof(dmi_field_header) + CREDENTIALS_TOTAL_SIZE_MAX, (char**) &data, &size);
598+
if (r == -ENOENT) /* Once we reach ENOENT there are no more DMI Type 11 fields around. */
599+
break;
598600
if (r < 0) {
599601
/* Once we reach ENOENT there are no more DMI Type 11 fields around. */
600-
log_full_errno(r == -ENOENT ? LOG_DEBUG : LOG_WARNING, r, "Failed to open '%s', ignoring: %m", p);
602+
log_warning_errno(r, "Failed to open '%s', ignoring: %m", p);
601603
break;
602604
}
603605

0 commit comments

Comments
 (0)