Bug 949036 - python-dmidecode produces invalid XML data on some hardware
Summary: python-dmidecode produces invalid XML data on some hardware
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: python-dmidecode
Version: 6.4
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: ---
Assignee: Ales Ledvinka
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks: 883504 975059
TreeView+ depends on / blocked
 
Reported: 2013-04-05 16:56 UTC by David Sommerseth
Modified: 2016-09-20 04:33 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
On some hardware, the DMI tables contain data which makes python-dmidecode generate XML tags with duplicated "dmispec" attributes. In some cases, when running the XML data through xmllint or other XML libraries, it failed to parse the data. This update corrects the duplicate "installed" and "dmispec" attributes, and data parsing no longer fails in the described scenario.
Clone Of:
Environment:
Last Closed: 2013-11-14 10:35:40 UTC
Target Upstream Version:


Attachments (Terms of Use)
Do not add explictly 'dmispec' attributes inside switch() in dmi_decode() (1.59 KB, patch)
2013-04-05 16:56 UTC, David Sommerseth
no flags Details | Diff

Description David Sommerseth 2013-04-05 16:56:24 UTC
Created attachment 731964 [details]
Do not add explictly 'dmispec' attributes inside switch() in dmi_decode()

On some hardware, the DMI tables contains data which makes python-dmidecode generate XML tags with duplicated 'dmispec' attributes.

In the case of libxml2, it handles this without any errors.  But running the XML data through xmllint or other XML libraries which are more picky (such as python-lxml), it will fail to parse the data.

The attached patch resolves this issue.

Comment 6 David Sommerseth 2013-05-13 12:02:31 UTC
Just to clarify the XML error in this bug.  What happens is that python-dmidecode in some DMI tables decodes sections not often found.  Inside these sections, an additional XML attribute was added, such as dmispec="3.3.41" or dmispec="3.3.42".

The problem is that python-dmidecode had already added the dmispec attribute.  So there output libxml2 allows is:

   <tag dmispec="3.3.41" dmispec="3.3.41"/>

This is an invalid XML, as attributes are not allowed to be duplicates.  And this is what python-lxml reacts to.  What the fix does is to remove the duplication of the dmispec attributes.  Those two places it was found should never have been there.  The reason this was not discovered earlier was that these DMI table sections are seldom found.

Comment 13 Ales Ledvinka 2013-06-20 12:23:07 UTC
was "dmispec", reopened for "installed".


Note You need to log in before you can comment on or make changes to this bug.