[Bug 241929] sesutil --libxo fails to sanitize garbage data from the enclosures

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Tue Nov 12 21:34:56 UTC 2019


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=241929

            Bug ID: 241929
           Summary: sesutil --libxo fails to sanitize garbage data from
                    the enclosures
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: bin
          Assignee: bugs at FreeBSD.org
          Reporter: asomers at FreeBSD.org

"sesutil --libxo" is awesome.  It's very easy to parse, but ONLY if the
enclosure's element descriptors are all valid UTF-8.  Unfortunately, we can't
rely on that.  If an element descriptor is not valid UTF-8, then the JSON or
XML output is not parseable.  Here's a real-world example:

$ sesutil map --libxo xml,pretty -u /dev/ses0
<sesutil version="1">
  <enclosures>
    <enc>ses0</enc>
    <name>SMC946 C1 0a01</name>
    ...
    <id>500304800924823f</id>
    <elements>
      <id>33</id>
      <type>Enclosure</type>
      <status>OK</status>
      <status_code>0x01 0x00 0x00 0x00</status_code>
      <description>��������������������������������</description>
    </elements>
    ...
  </enclosures>
</sesutil>

Those mystery characters are all 0xFF bytes.  sesutil needs to sanitize those
fields before it prints them.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list