[SCSI] SCSI: sanitize INQUIRY strings
authorAlan Stern <stern@rowland.harvard.edu>
Mon, 21 Aug 2006 19:53:25 +0000 (15:53 -0400)
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>
Sat, 2 Sep 2006 18:36:59 +0000 (13:36 -0500)
commite5b3cd42960a10c1bc3701d4f00767463c88ec9d
treef8e54261c465f51fe1ebc67facf9074f0744e385
parent85b6c720b0931101c8bcc3a5abdc2b8514b0fb4b
[SCSI] SCSI: sanitize INQUIRY strings

Sanitize the Vendor, Product, and Revision strings contained in an
INQUIRY result by setting all non-graphic or non-ASCII characters to ' '.
Since the standard disallows such characters, this will affect
only non-compliant devices.

To help maintain backward compatibility, NUL characters are treated
specially.  They are taken as string terminators; they and all the
following characters are set to ' '.  If some valid characters get
erased as a result... well, we weren't seeing them before so we haven't
lost anything.

The primary purpose of this change is to allow blacklist entries to
match devices with illegal Vendor or Product strings.

In addition, the patch updates a couple of function prototypes, giving
inq_result its correct type (unsigned char *).

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
drivers/scsi/scsi_scan.c