freebsd-skq/sbin
Kenneth D. Merry 955f7e7474 Fix 'camcontrol inquiry'. The inquiry data structure changes (increased to
256 bytes) caused it to break on many devices.

The SCSI spec says that for commands with 8-bit length fields, a value of 0
means 256 bytes.  As it turns out, many devices don't deal with that
properly.  Some interpret the 0 as 0, and return no data.  Others return
more than 256 bytes of data, and cause an overrun.

The fix is to tell the device we've only allocated SHORT_INQUIRY_LENGTH (36
bytes) of inquiry data, instead of sizeof(struct scsi_inquiry_data).

camcontrol.c:		Change inq_len in the call to scsi_inquiry() to
			SHORT_INQUIRY_LENGTH, and add a long comment
			explaining the reason for the change.

scsi_all.h:		Add a comment above the definitinon of
			SHORT_INQUIRY_LENGTH alerting people that it is
			both the initial probe inquiry length, and the
			minimum amount of data needed for scsi_print_inquiry()
			to function.

scsi_all.c:		Add a comment about SHORT_INQUIRY_LENGTH being the
			minimum amount of data needed for
			scsi_print_inquiry() to function.

Reviewed by:	gibbs
Approved by:	jkh
Reported by:	"John W. DeBoskey" <jwd@unx.sas.com>
2000-02-20 04:42:44 +00:00
..
adjkerntz $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
atm With the kind permission of Marconi Communications (Formerly "Fore Communication" 2000-02-15 13:20:58 +00:00
badsect $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
bsdlabel Backed out removal of vendor id and gratuitous change of tmpfile prefix 2000-01-11 07:28:46 +00:00
camcontrol Fix 'camcontrol inquiry'. The inquiry data structure changes (increased to 2000-02-20 04:42:44 +00:00
ccdconfig Removal of sys/device.h 1999-10-05 21:19:41 +00:00
clri $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
comcontrol $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
cxconfig $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
dhclient $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
disklabel Backed out removal of vendor id and gratuitous change of tmpfile prefix 2000-01-11 07:28:46 +00:00
dmesg $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
dump Fix various man pages to stop abusing the .Bx macro to generate 2000-01-23 01:30:05 +00:00
dumpfs $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
dumpon The dumpon sysctl only accept cdevs thse days. 2000-01-04 12:52:52 +00:00
fdisk Add ata(4) support. 2000-02-11 11:25:23 +00:00
fsck Fix the use of an uninitialized variable in the previous commit. 2000-01-10 14:20:53 +00:00
fsck_ffs Fix the use of an uninitialized variable in the previous commit. 2000-01-10 14:20:53 +00:00
fsck_ifs Fix the use of an uninitialized variable in the previous commit. 2000-01-10 14:20:53 +00:00
fsdb Fix various man pages to stop abusing the .Bx macro to generate 2000-01-23 01:30:05 +00:00
fsirand Fix various man pages to stop abusing the .Bx macro to generate 2000-01-23 01:30:05 +00:00
i386 Add ata(4) support. 2000-02-11 11:25:23 +00:00
ifconfig Support IPv6 scoped addr in ifconfig and route 2000-02-10 03:03:09 +00:00
init detect deleted tty lines in /etc/ttys. 2000-02-19 20:28:45 +00:00
ip6fw Repair incorrect ``first appeared in'' reference, which originally stated 2000-02-09 19:54:14 +00:00
ipf Add MAINTAINER tag. 1999-12-15 19:48:02 +00:00
ipfstat Add MAINTAINER tag. 1999-12-15 19:48:02 +00:00
ipfw Use correct field for dst_port when displaying masks on dynamic pipes. 2000-02-13 11:46:59 +00:00
ipmon Add ipl.4 manpage 2000-02-09 21:01:35 +00:00
ipnat Add MAINTAINER tag. 1999-12-15 19:48:02 +00:00
kget Get this to compile again. struct pnp_cinfo went away so 1999-09-03 06:01:01 +00:00
kldload Add cross-references to respective syscalls. 1999-09-03 16:40:24 +00:00
kldstat Properly align the columns of the header on Alpha. 1999-12-04 13:36:22 +00:00
kldunload Fixed bitrot in usage message (-n is now optional). 1999-09-08 05:46:47 +00:00
ldconfig If a directory on the command line doesn't exist, warn about it 2000-01-21 02:15:27 +00:00
md5 Add -q quite mode. 1999-12-04 01:29:43 +00:00
mknod Add chown(8)-like functionality. This will allow us to not use chown(8) 2000-01-06 05:20:14 +00:00
mount This is another in Martin Blapp's N-series of mount-related cleanups :) 2000-01-15 14:28:14 +00:00
mount_cd9660 Typo 1999-11-15 03:13:23 +00:00
mount_ext2fs mount* fixes from Martin Blapp <mb@imp.ch>: 1999-10-09 11:54:14 +00:00
mount_hpfs First version of HPFS stuff. 1999-12-09 19:10:13 +00:00
mount_ifs This is another in Martin Blapp's N-series of mount-related cleanups :) 2000-01-15 14:28:14 +00:00
mount_msdos Adjust paths after repository copy. 2000-01-14 17:39:20 +00:00
mount_msdosfs Adjust paths after repository copy. 2000-01-14 17:39:20 +00:00
mount_nfs Changed setflags() to set_flags(). This fixes part of the world breakage 2000-01-28 12:44:50 +00:00
mount_ntfs mount* fixes from Martin Blapp <mb@imp.ch>: 1999-10-09 11:54:14 +00:00
mount_null mount* fixes from Martin Blapp <mb@imp.ch>: 1999-10-09 11:54:14 +00:00
mount_nullfs mount* fixes from Martin Blapp <mb@imp.ch>: 1999-10-09 11:54:14 +00:00
mount_nwfs Fix various man pages to stop abusing the .Bx macro to generate 2000-01-23 01:30:05 +00:00
mount_portal 10 X's for mktemp(). This seems to be free from race conditions. 2000-01-10 09:33:37 +00:00
mount_portalfs 10 X's for mktemp(). This seems to be free from race conditions. 2000-01-10 09:33:37 +00:00
mount_std mount* fixes from Martin Blapp <mb@imp.ch>: 1999-10-09 11:54:14 +00:00
mount_umap mount* fixes from Martin Blapp <mb@imp.ch>: 1999-10-09 11:54:14 +00:00
mount_umapfs mount* fixes from Martin Blapp <mb@imp.ch>: 1999-10-09 11:54:14 +00:00
mount_union mount* fixes from Martin Blapp <mb@imp.ch>: 1999-10-09 11:54:14 +00:00
mount_unionfs mount* fixes from Martin Blapp <mb@imp.ch>: 1999-10-09 11:54:14 +00:00
mountd Fix various man pages to stop abusing the .Bx macro to generate 2000-01-23 01:30:05 +00:00
natd Now that kernel is capable of notifying user processes about 2000-01-25 12:24:06 +00:00
newfs Add Xref to camcontrol(8) (replacing previously-removed scsiformat(8)). 2000-01-30 20:58:33 +00:00
newfs_msdos $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
nextboot $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
nfsd Thresh-out the nfs manual page references a bit 2000-01-13 21:47:21 +00:00
nfsiod Thresh-out the nfs manual page references a bit 2000-01-13 21:47:21 +00:00
nologin $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
nos-tun Fix various man pages to stop abusing the .Bx macro to generate 2000-01-23 01:30:05 +00:00
ping ping -S option was missing from IPsec merge, so enable it again. 2000-02-08 05:07:50 +00:00
ping6 Small bug fix and improvements 1999-12-28 05:37:39 +00:00
quotacheck Make fsck(8) do a MNT_RELOAD after cleaning for all read-only mounted 1999-12-30 16:32:40 +00:00
reboot Add .Nm fastboot' and .Nm fasthalt' to NAME section. 2000-01-10 12:24:47 +00:00
restore Committed changes to restore(8) for previously undocumented -N option. 2000-02-17 02:15:18 +00:00
route Support IPv6 scoped addr in ifconfig and route 2000-02-10 03:03:09 +00:00
routed Remove dead xrefs to gated(8) and htable(8) 1999-11-15 02:53:31 +00:00
rtsol Getaddrinfo(), getnameinfo(), and etc support in libc/net. 1999-12-28 02:37:14 +00:00
savecore Fix bogus initialization of using a sledge hammer to quite -Wall, bad 1999-12-21 07:41:07 +00:00
setkey Change IPv6 scoped addr format again based on recent standard discussion. 2000-02-19 16:10:16 +00:00
shutdown $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
slattach $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
spppcontrol $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
startslip $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
swapon Mention /dev/vn0b and /dev/vntab. ascii -> ASCII transform had 1999-09-26 00:05:45 +00:00
sysctl Belatedly back out rev. 1.20. 1999-11-22 08:38:29 +00:00
tunefs Remove unused #include and prototype declaration. 2000-01-30 05:24:55 +00:00
umount Finish up umntall support. init now passed an argument to the 1999-11-22 04:23:11 +00:00
vinum Don't use /dev/vinum/rsd/XXX for init as it doesn't exist any more. 2000-02-06 02:40:22 +00:00
Makefile Add ip6fw. 2000-01-29 13:54:44 +00:00
Makefile.inc Part one of a "fix-and-move". Init(8) had make macros declared here 1997-02-10 17:41:33 +00:00