From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5)
Description of problem:
I found a couple of bugs in scsi_info.c that prevent it from working
properly with devices if channel/id/lun >= 10. A real example follows:
# scsi_info /dev/sdl
1. format string disagreement with /proc/scsi/scsi
When scsi_format reads /proc/scsi/scsi, its forms the match string as
the following (at line 122-123):
sprintf(match, "Host: scsi%d Channel: %02x Id: %02x Lun: %02x\n",
host, channel, id, lun);
whereas kernel 2.4.9-e.49's drivers/scsi/scsi_proc.c says (at L265-267):
y = sprintf(buffer + len,
"Host: scsi%d Channel: %02d Id: %02d Lun: %02d\n Vendor: ",
scd->host->host_no, scd->channel, scd->id, scd->lun);
Suggested fix: 122s/%02x/%02d/g
2. EOF not checked when falling through
At line 133-135 of scsi_info.c:
while (fgets(s, 128, f) != NULL)
if (strcmp(s, match) == 0) break;
fgets(s, 128, f);
Because EOF is never checked, scsi_info.c spits out garbage like the
example above when no match is found due to malformatted match string.
Although this one can be left unfixed if the first bug is fixed, I
think it should be fixed for the sake of promoting good programming style.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Connect a SCSI device (e.g. RAID) that has more than 10 LUNs
2. run scsi_info on the 10th LUN (e.g. scsi_info /dev/sdl)
Actual Results: # scsi_info /dev/sdl
Expected Results: # scsi_info /dev/sdl
MODEL="DGC RAID 5"
There's no workaround to this problem except avoiding use of scsi_info.
Created attachment 128757 [details]
This version of scsi_info fixes the first problem mentioned in the bug
This bug is filed against RHEL2.1, which is in maintenance phase.
During the maintenance phase, only security errata and select mission
critical bug fixes will be released for enterprise products. Since
this bug does not meet that criteria, it is now being closed.
For more information of the RHEL errata support policy, please visit:
If you feel this bug is indeed mission critical, please contact your
support representative. You may be asked to provide detailed
information on how this bug is affecting you.