SHA256
1
0
forked from pool/dmidecode
dmidecode/dmidecode-06-hide-irrelevant-fixup-message.patch
Jean Delvare 925fc78f0a - dmidecode-01-add-no-sysfs-option-description-to-h-output.patch:
Add "--no-sysfs" option description to -h output.
- dmidecode-02-fix-no-smbios-nor-dmi-entry-point-found-on-smbios3.patch:
  Fix 'No SMBIOS nor DMI entry point found' on SMBIOS3.
- dmidecode-03-let-read_file-return-the-actual-data-size.patch:
  Let read_file return the actual data size.
- dmidecode-04-use-read_file-to-read-the-dmi-table-from-sysfs.patch:
  Use read_file() to read the DMI table from sysfs.
  https://savannah.nongnu.org/bugs/?46176
- dmidecode-05-use-dword-for-structure-table-maximum-size-in-smbios3.patch:
  Use DWORD for Structure table maximum size in SMBIOS3.
- dmidecode-06-hide-irrelevant-fixup-message.patch:
  Hide irrelevant fixup message.
  http://savannah.nongnu.org/support/?109024

OBS-URL: https://build.opensuse.org/package/show/Base:System/dmidecode?expand=0&rev=35
2016-05-03 14:15:10 +00:00

50 lines
1.6 KiB
Diff

From: Jean Delvare <jdelvare@suse.de>
Date: Tue, 3 May 2016 15:32:21 +0200
Subject: dmidecode: Hide irrelevant fixup message
Git-commit: cff11afa886a0147d734b650755d232b5e7f2099
References: http://savannah.nongnu.org/support/?109024
Only display the message about type 34 length fixup if the entry in
question is going to be displayed. Otherwise it's only confusing.
This fixes bug #109024:
http://savannah.nongnu.org/support/?109024
Fixes: 3f70b3515d91 ("dmidecode: Fix up invalid DMI type 34 structure length")
---
dmidecode.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
--- dmidecode-3.0.orig/dmidecode.c 2016-05-03 16:05:11.533919057 +0200
+++ dmidecode-3.0/dmidecode.c 2016-05-03 16:05:13.223934786 +0200
@@ -2946,7 +2946,7 @@ static void dmi_64bit_memory_error_addre
* first 5 characters of the device name to be trimmed. It's easy to
* check and fix, so do it, but warn.
*/
-static void dmi_fixup_type_34(struct dmi_header *h)
+static void dmi_fixup_type_34(struct dmi_header *h, int display)
{
u8 *p = h->data;
@@ -2954,7 +2954,9 @@ static void dmi_fixup_type_34(struct dmi
if (h->length == 0x10
&& is_printable(p + 0x0B, 0x10 - 0x0B))
{
- printf("Invalid entry length (%u). Fixed up to %u.\n", 0x10, 0x0B);
+ if (!(opt.flags & FLAG_QUIET) && display)
+ printf("Invalid entry length (%u). Fixed up to %u.\n",
+ 0x10, 0x0B);
h->length = 0x0B;
}
}
@@ -4443,7 +4445,7 @@ static void dmi_table_decode(u8 *buf, u3
/* Fixup a common mistake */
if (h.type == 34)
- dmi_fixup_type_34(&h);
+ dmi_fixup_type_34(&h, display);
/* look for the next handle */
next = data + h.length;