From: deraadt Date: Thu, 14 Dec 1995 05:51:38 +0000 (+0000) Subject: from netbsd: X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=76426f632d8c46da37d21957dc9491334f39fe1f;p=openbsd from netbsd: add a bunch of rogues Trim NULs, in addition to spaces, in scsi_strvis(). --- diff --git a/sys/scsi/scsiconf.c b/sys/scsi/scsiconf.c index 39e5fc060a0..81f4623694c 100644 --- a/sys/scsi/scsiconf.c +++ b/sys/scsi/scsiconf.c @@ -1,4 +1,4 @@ -/* $NetBSD: scsiconf.c,v 1.43 1995/10/13 20:01:03 gwr Exp $ */ +/* $NetBSD: scsiconf.c,v 1.45 1995/12/11 04:43:01 mycroft Exp $ */ /* * Copyright (c) 1994 Charles Hannum. All rights reserved. @@ -224,10 +224,10 @@ scsi_strvis(dst, src, len) int len; { - /* Trim leading and trailing blanks. */ - while (len > 0 && src[0] == ' ') + /* Trim leading and trailing blanks and NULs. */ + while (len > 0 && (src[0] == ' ' || src[0] == '\0')) ++src, --len; - while (len > 0 && src[len-1] == ' ') + while (len > 0 && (src[len-1] == ' ' || src[len-1] == '\0')) --len; while (len > 0) { @@ -314,6 +314,8 @@ struct scsi_quirk_inquiry_pattern scsi_quirk_patterns[] = { "QUANTUM ", "P105S 910-10-94x", "", SDEV_NOLUNS}, {T_DIRECT, T_FIXED, "QUANTUM ", "PD1225S ", "", SDEV_NOLUNS}, + {T_DIRECT, T_FIXED, + "QUANTUM ", "PD210S SUN0207", "", SDEV_NOLUNS}, {T_DIRECT, T_FIXED, "RODIME ", "RO3000S ", "", SDEV_NOLUNS}, {T_DIRECT, T_FIXED, @@ -328,12 +330,16 @@ struct scsi_quirk_inquiry_pattern scsi_quirk_patterns[] = { /* XXX: QIC-36 tape behind Emulex adapter. Very broken. */ {T_SEQUENTIAL, T_REMOV, " ", " ", " ", SDEV_NOLUNS}, + {T_SEQUENTIAL, T_REMOV, + "CALIPER ", "CP150 ", "", SDEV_NOLUNS}, {T_SEQUENTIAL, T_REMOV, "EXABYTE ", "EXB-8200 ", "", SDEV_NOLUNS}, {T_SEQUENTIAL, T_REMOV, "SONY ", "SDT-2000 ", "2.09", SDEV_NOLUNS}, {T_SEQUENTIAL, T_REMOV, - "SONY ", "SDT-5000 ", "3.17", SDEV_NOSYNCWIDE}, + "SONY ", "SDT-5000 ", "3.", SDEV_NOSYNCWIDE}, + {T_SEQUENTIAL, T_REMOV, + "SONY ", "SDT-5200 ", "3.", SDEV_NOLUNS}, {T_SEQUENTIAL, T_REMOV, "TANDBERG", " TDC 3600 ", "", SDEV_NOLUNS}, {T_SEQUENTIAL, T_REMOV, @@ -561,7 +567,7 @@ scsi_inqmatch(inqbuf, base, nmatches, matchsize, bestpriority) continue; priority += len; -#if 0 +#if SCSIDEBUG printf("scsi_inqmatch: %d/%d/%d <%s, %s, %s>\n", priority, match->type, match->removable, match->vendor, match->product, match->revision);