• Alan Stern's avatar
    [SCSI] SCSI: sanitize INQUIRY strings · e5b3cd42
    Alan Stern authored
    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: default avatarAlan Stern <stern@rowland.harvard.edu>
    Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>