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

 
 

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

Submitter:  None
Submitted:  Fri 26 Feb 2016 02:01:18 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  khali
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 22 Jul 2016 08:50:23 AM UTC, comment #4: 
Jean Delvare <khali>
Group administrator
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>
Group administrator
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>
Group administrator
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 Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-07-22 khali StatusWorks For Me Fixed
    2016-03-04 khali StatusNeed Info Works For Me
        Open/ClosedOpen Closed
    2016-02-26 khali StatusNone Need Info
        Assigned toNone khali

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code