Package: scsitools
Version: 0.10-1.2
Severity: normal
File: /sbin/rescan-scsi-bus.sh
Tags: patch
Hi,
rescan-scsi-bus.sh may output tons of errors if scanning a host adapter
with no devices connected. The amount of errors depends on the number of
files in the current directory because at some point '*' is expanded
incorrectly.
The attached patch prevents the channel list getting populated with
invalid entries, skipping any scanning attempt using them.
That part of the scripts needs reindentation after the patch is applied.
I didn't do this in the patch in order to keep it a two line addition.
Furthermore it fixes missing quotes that might cause warnings from 'test'
Andreas
-- System Information:
Debian Release: lenny/sid
APT prefers testing
APT policy: (500, 'testing'), (500, 'stable'), (300, 'unstable')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.26-1-amd64 (SMP w/8 CPU cores)
Locale: LANG=C, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages scsitools depends on:
ii debconf [debconf-2.0] 1.5.22 Debian configuration management sy
ii libc6 2.7-14 GNU C Library: Shared libraries
ii sg3-utils 1.24-2 Utilities for working with generic
ii util-linux 2.13.1.1-1 Miscellaneous system utilities
Versions of packages scsitools recommends:
pn tk8.4 | wish <none> (no description available)
scsitools suggests no packages.
-- debconf information:
scsitools/info:
--- /sbin/rescan-scsi-bus.sh 2008-08-20 23:32:24.000000000 +0200
+++ ../rescan-scsi-bus.sh 2008-10-17 16:19:17.402611002 +0200
@@ -217,6 +217,7 @@
local tmpchan
for dev in /sys/class/scsi_device/${host}:* ; do
+ if test -e "$dev" ; then
hcil=${dev##*/}
cil=${hcil#*:}
chan=${cil%%:*}
@@ -228,6 +229,7 @@
if test -n "$chan" ; then
channelsearch="$channelsearch $chan"
fi
+ fi
done
}
@@ -386,7 +388,7 @@
idlist
fi
for id in $idsearch; do
- if test -z $lunsearch ; then
+ if test -z "$lunsearch" ; then
doreportlun
else
for lun in $lunsearch; do