BlueSCSI / BlueSCSI-v2

Open source, open hardware, SCSI emulator using the Pi Pico PR2040 and Pico 2 RP2350
https://bluescsi.com
GNU General Public License v3.0
259 stars 29 forks source link

scsi: fix mac vendor page #134

Closed erichelgeson closed 8 months ago

erichelgeson commented 8 months ago

In SCSI2SD 4.1.1 circa 2015 c09e15bac64b996d09174a3670773c1c48b6458e there was a bug introduced that incorrectly checked the allocation length of the Apple Vendor page. This worked as it was silently truncating the response. But did cause the vendor string to always be sent even if Apple Quirks was disabled.

In upstream 0abf488eeb6037adb0e367964f3024b8733a5433 an attempt was made to fix this, but it was not tested with Apple’s formatting utilities as it does not work.

After validating with multiple real apple firmware drives the correct behavior is to truncate the page. This is the same behavior as every other page being sent. Note newer drives page code is actually this longer variant but older ones have a shorter length. The Apple formatting tools ignore the page length field when doing their checks so was left as the longer variant, truncated.