bugdmidecode - Bugs: bug #47274, Print version-warning of SMBIOS to...

 
 

bug #47274: Print version-warning of SMBIOS to stderr

Submitted by:  None
Submitted on:  Fri 26 Feb 2016 02:01:18 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: Jean Delvare <khali>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 22 Jul 2016 08:50:23 AM UTC, comment #4:

Fix committed:

http://git.savannah.gnu.org/cgit/dmidecode.git/commit/?id=74614633b31a2ac01240c72890722a86a3f3fc97

Jean Delvare <khali>
Project AdministratorIn charge of this item.
Fri 04 Mar 2016 10:00:28 AM UTC, comment #3:

Note that -s implies -q, so if the 3rd party application is using -s then with the upstream fix the warning won't be printed. This warning is not so relevant when printing strings anyway, as string decoding generally doesn't depend a specific version of the SMBIOS specification (although there are a few exceptions.)

It was discussed before whether the warning should go to stdout or stderr. I settled for stdout because it's only a warning, not an error, and it helps the user interpret the output. My fear was that people redirecting the output of dmidecode to a file would miss the warning.

Jean Delvare <khali>
Project AdministratorIn charge of this item.
Fri 04 Mar 2016 08:21:17 AM UTC, comment #2:

I am not sure that would have helped in my exact case, as the application was a closed source, and did not seem to use the "-q" flag when reading dmidecode output.

But after I reported the issue to the 3. party application developer, it was fixed so they now ignore the warning. So for my case, the problem is solved.

Still not sure whether the warning should have been printed to stderr or not, but that is more of a design question that I will leave to you...

Anyway. My issue has been solved in the other end. And you have fixed it in a way you think is better, so I am happy.

Rgds.

/Ola (T)

Anonymous
Fri 26 Feb 2016 03:26:03 PM UTC, comment #1:

The problem was already fixed differently:

http://git.savannah.gnu.org/cgit/dmidecode.git/commit/?id=4e803ff51ce7d9a5b8a361d06acc56bf17a238bf

Does it work for you?

Jean Delvare <khali>
Project AdministratorIn charge of this item.
Fri 26 Feb 2016 02:01:18 PM UTC, original submission:

Lots of people have had issues with trying to parse the output of dmidecode when it issues a warning about the version of SMBIOS.

This is a small patch that will print the warning to stderr instead of stdout, to allow scripts to read the values without having to parse out the warning text:

Patched version is 2.12 as that was what affected me at the moment.

--- dmidecode.c.orig 2016-02-26 14:36:59.074461389 +0100
+++ dmidecode.c 2016-02-26 14:51:28.228558667 +0100
@@ -4330,7 +4330,7 @@

if (ver > SUPPORTED_SMBIOS_VER)
{
- printf("# SMBIOS implementations newer than version %u.%u are not\n"
+ fprintf(stderr, "# SMBIOS implementations newer than version %u.%u are not\n"
"# fully supported by this version of dmidecode.\n",
SUPPORTED_SMBIOS_VER >> 8, SUPPORTED_SMBIOS_VER & 0xFF);
}

The difference is subtle but important...

root@localhost:~# X=$(/usr/sbin/dmidecode.orig -s system-uuid)

root@localhost:~# echo $X
# SMBIOS implementations newer than version 2.7 are not # fully supported by this version of dmidecode. 60AD2F7C-FB44-400F-BDBC-1D6A66BE3C80

VS

root@localhost:~# X=$(/usr/sbin/dmidecode -s system-uuid)
# SMBIOS implementations newer than version 2.7 are not
# fully supported by this version of dmidecode.

root@localhost:~# echo $X
60AD2F7C-FB44-400F-BDBC-1D6A66BE3C80

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by khali (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 22 Jul 2016 08:50:23 AM UTCkhaliStatusWorks For Me=>Fixed
    Fri 04 Mar 2016 10:00:28 AM UTCkhaliStatusNeed Info=>Works For Me
      Open/ClosedOpen=>Closed
    Fri 26 Feb 2016 03:26:03 PM UTCkhaliStatusNone=>Need Info
      Assigned toNone=>khali

    Back to the top


    Powered by Savane 3.1-cleanup1