Re: [PATCH] SCSI: sanitize INQUIRY strings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 21 Aug 2006, Philip R. Auld wrote:

> > Let's take the case of a fictional device that has a vendor string
> > 
> > TJD\0Hje9
> > 
> > I say that should be printed as "TJD     ".  You say that should be
> > printed as "TJD Hje9".
> 
> Sure, but what if the Hje9 is not garbage. It's still available in the
> proposed patch. It's lost if you overwrite it with spaces. Maybe the
> TJD Hje9 requires special handling :)
> 
> If it turns out to be garbage couldn't the blacklist entry be set to TJD
> and only match the first 3 characters? (I haven't looked at how the
> comparison is made).
> 
> Indeed it may look better treating the NUL as the end, but I'm arguing
> that assuming anything about the intent of the engineer who wrote the
> out of spec code is probably a mistake.

In cases like this, I tend to think it's hopeless to guess at what the 
original engineer had in mind.  The best course is to minimize 
user-visible changes, which means interpreting the NUL the same as we have 
all along -- as a terminator.

Alan Stern

-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux