]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
fix(lunmask): quote LUN variable
authorBenjamin Drung <benjamin.drung@canonical.com>
Fri, 14 Jun 2024 21:49:13 +0000 (23:49 +0200)
committerLaszlo Gombos <laszlo.gombos@gmail.com>
Sat, 15 Jun 2024 02:02:08 +0000 (22:02 -0400)
shellcheck complains about SC2086 (info): Double quote to prevent
globbing and word splitting.

The variable `LUN` refers to a single logical unit number (LUN) and
therefore is safe to be quoted.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
modules.d/95lunmask/fc_transport_scan_lun.sh
modules.d/95lunmask/sas_transport_scan_lun.sh

index d14d2ca1b1ca87c863d683b5a073331b71989a67..57b530aae9669674ae6981be83bd03329e66a565 100755 (executable)
@@ -23,4 +23,4 @@ if [ -f /sys"$DEVPATH"/scsi_target_id ]; then
     read -r TARGET < /sys"$DEVPATH"/scsi_target_id
 fi
 [ -z "$TARGET" ] && exit 1
-echo "$CHANNEL" "$TARGET" $LUN > /sys/class/scsi_host/host"$HOST"/scan
+echo "$CHANNEL $TARGET $LUN" > /sys/class/scsi_host/host"$HOST"/scan
index 1d1fc4727bd56afc93094e2f36f49f78e887583c..2f1cd42f1606dced5f1276d044f5497d2aca4dae 100755 (executable)
@@ -23,4 +23,4 @@ if [ -f /sys"$DEVPATH"/scsi_target_id ]; then
     read -r TARGET < /sys"$DEVPATH"/scsi_target_id
 fi
 [ -z "$TARGET" ] && exit 1
-echo 0 "$TARGET" $LUN > /sys/class/scsi_host/host"$HOST"/scan
+echo "0 $TARGET $LUN" > /sys/class/scsi_host/host"$HOST"/scan