[systemd-bugs] [Bug 52474] cdrom_id probing and USB Flash Drive CDROMs

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Jul 26 16:55:04 PDT 2012


https://bugs.freedesktop.org/show_bug.cgi?id=52474

--- Comment #19 from Giuseppe Amato <gam at bit4id.com> 2012-07-26 16:55:04 PDT ---
Ok, adding following code after GET CONFIGURATION command solved the problem
completely:

----------------------------------------------------------------
        /* parse the length once more, in case the drive decided to have other
features suddenly :) */
        len = features[0] << 24 | features[1] << 16 | features[2] << 8 |
features[3];
        log_debug("GET CONFIGURATION: size of features buffer 0x%04x\n", len);
+    if (len == 0)
+    {
+        log_debug("GET CONFIGURATION: returned ZERO length feature buffer:
trying to work around the problem\n");
+        ret = cd_profiles_old_mmc(udev, fd);
+        goto out;
+    }
----------------------------------------------------------------


Now this is the output of cdrom_id with that bogus controller:

probing: '/dev/sr1'
INQUIRY: [Generic ][Autorun Disk    ][8.00]
no current profile, assuming no media
GET CONFIGURATION: size of features buffer 0x0000
GET CONFIGURATION: size of features buffer 0x0000
GET CONFIGURATION: returned ZERO length feature buffer: trying to work around
the problem
profile 0x08 media_cd_rom
READ TOC: len: 12, start track: 1, end track: 1
last track 1 starts at block 0
disk type 00
hardware reported media status: complete
ID_CDROM=1
ID_CDROM_MEDIA=1
ID_CDROM_MEDIA_CD=1
ID_CDROM_MEDIA_SESSION_COUNT=1
ID_CDROM_MEDIA_TRACK_COUNT=1


what do you think, is that patch OK?

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the systemd-bugs mailing list