Skip to content

Commit

Permalink
scsi: fix mac vendor page
Browse files Browse the repository at this point in the history
In SCSI2SD 4.1.1 circa 2015 c09e15b 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 0abf488 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.
  • Loading branch information
erichelgeson committed Apr 2, 2024
1 parent c882b69 commit 6c8a264
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion lib/SCSI2SD/src/firmware/mode.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,6 @@ static void doModeSense(
idx += modeSenseCDCapabilitiesPage(pc, idx, pageCode, &pageFound);

if ((scsiDev.target->cfg->quirks == S2S_CFG_QUIRKS_APPLE) &&
(idx + sizeof(AppleVendorPage) <= allocLength) &&
(pageCode == 0x30 || pageCode == 0x3F))
{
pageFound = 1;
Expand Down

0 comments on commit 6c8a264

Please sign in to comment.