2016-09-01 13:57:40 +02:00
|
|
|
From bcaa0a11b41765be7cbb92e2641750b5adb8e326 Mon Sep 17 00:00:00 2001
|
2016-06-07 15:51:45 +02:00
|
|
|
From: Hannes Reinecke <hare@suse.de>
|
|
|
|
Date: Mon, 14 Jul 2014 10:22:31 +0200
|
2016-09-01 13:57:40 +02:00
|
|
|
Subject: [PATCH] Reset IFS variable
|
2016-06-07 15:51:45 +02:00
|
|
|
|
|
|
|
Setting and unsetting the IFS variable is tricky. To be on the
|
|
|
|
safe side we should always reset the IFS variable to its original
|
|
|
|
value after parsing.
|
|
|
|
|
|
|
|
Signed-off-by: Hannes Reinecke <hare@suse.de>
|
|
|
|
---
|
2016-09-01 13:57:40 +02:00
|
|
|
modules.d/95dasd/parse-dasd.sh | 2 ++
|
|
|
|
modules.d/95dasd_rules/parse-dasd.sh | 8 ++++++--
|
|
|
|
modules.d/95zfcp_rules/parse-zfcp.sh | 4 ++++
|
|
|
|
3 files changed, 12 insertions(+), 2 deletions(-)
|
2016-06-07 15:51:45 +02:00
|
|
|
|
2016-09-01 13:57:40 +02:00
|
|
|
diff --git a/modules.d/95dasd/parse-dasd.sh b/modules.d/95dasd/parse-dasd.sh
|
|
|
|
index 35c997c..976bd03 100755
|
|
|
|
--- a/modules.d/95dasd/parse-dasd.sh
|
|
|
|
+++ b/modules.d/95dasd/parse-dasd.sh
|
2016-06-07 15:51:45 +02:00
|
|
|
@@ -1,8 +1,10 @@
|
|
|
|
#!/bin/sh
|
|
|
|
for dasd_arg in $(getargs rd.dasd= -d rd_DASD= DASD=); do
|
|
|
|
(
|
|
|
|
+ local OLDIFS="$IFS"
|
|
|
|
IFS=","
|
|
|
|
set -- $dasd_arg
|
|
|
|
+ IFS="$OLDIFS"
|
|
|
|
echo "$@" | normalize_dasd_arg >> /etc/dasd.conf
|
|
|
|
)
|
|
|
|
done
|
2016-09-01 13:57:40 +02:00
|
|
|
diff --git a/modules.d/95dasd_rules/parse-dasd.sh b/modules.d/95dasd_rules/parse-dasd.sh
|
|
|
|
index e1bee62..1cc621f 100755
|
|
|
|
--- a/modules.d/95dasd_rules/parse-dasd.sh
|
|
|
|
+++ b/modules.d/95dasd_rules/parse-dasd.sh
|
|
|
|
@@ -59,8 +59,10 @@ for dasd_arg in $(getargs root=) $(getargs resume=); do
|
2016-06-07 15:51:45 +02:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
if [ -n "$ccw_arg" ] ; then
|
|
|
|
+ OLDIFS="$IFS"
|
|
|
|
IFS="-"
|
|
|
|
set -- $ccw_arg
|
|
|
|
+ IFS="$OLDIFS"
|
|
|
|
create_udev_rule $2
|
|
|
|
fi
|
|
|
|
)
|
|
|
|
@@ -68,9 +70,10 @@ done
|
|
|
|
|
|
|
|
for dasd_arg in $(getargs rd.dasd=); do
|
|
|
|
(
|
|
|
|
+ OLDIFS="$IFS"
|
|
|
|
IFS=","
|
|
|
|
set -- $dasd_arg
|
|
|
|
- unset IFS
|
|
|
|
+ IFS="$OLDIFS"
|
|
|
|
while (($# > 0)); do
|
|
|
|
case $1 in
|
|
|
|
autodetect|probeonly)
|
|
|
|
@@ -78,13 +81,14 @@ for dasd_arg in $(getargs rd.dasd=); do
|
|
|
|
;;
|
|
|
|
*-*)
|
|
|
|
range=$1
|
|
|
|
+ OLDIFS="$IFS"
|
|
|
|
IFS="-"
|
|
|
|
set -- $range
|
|
|
|
start=${1#0.0.}
|
|
|
|
shift
|
|
|
|
end=${1#0.0.}
|
|
|
|
shift
|
|
|
|
- unset IFS
|
|
|
|
+ IFS="$OLDIFS"
|
|
|
|
for dev in $(seq $(( 16#$start )) $(( 16#$end )) ) ; do
|
|
|
|
create_udev_rule $(printf "0.0.%04x" "$dev")
|
|
|
|
done
|
2016-09-01 13:57:40 +02:00
|
|
|
diff --git a/modules.d/95zfcp_rules/parse-zfcp.sh b/modules.d/95zfcp_rules/parse-zfcp.sh
|
|
|
|
index 77412f7..7d47d35 100755
|
|
|
|
--- a/modules.d/95zfcp_rules/parse-zfcp.sh
|
|
|
|
+++ b/modules.d/95zfcp_rules/parse-zfcp.sh
|
2016-06-07 15:51:45 +02:00
|
|
|
@@ -53,8 +53,10 @@ fi
|
|
|
|
|
|
|
|
for zfcp_arg in $(getargs rd.zfcp); do
|
|
|
|
(
|
|
|
|
+ OLDIFS="$IFS"
|
|
|
|
IFS=","
|
|
|
|
set $zfcp_arg
|
|
|
|
+ IFS="$OLDIFS"
|
|
|
|
create_udev_rule $1 $2 $3
|
|
|
|
)
|
|
|
|
done
|
2016-09-01 13:57:40 +02:00
|
|
|
@@ -70,8 +72,10 @@ for zfcp_arg in $(getargs root=) $(getargs resume=); do
|
2016-06-07 15:51:45 +02:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
if [ -n "$ccw_arg" ] ; then
|
|
|
|
+ OLDIFS="$IFS"
|
|
|
|
IFS="-"
|
|
|
|
set -- $ccw_arg
|
|
|
|
+ IFS="$OLDIFS"
|
|
|
|
_wwpn=${4%:*}
|
|
|
|
_lun=${4#*:}
|
|
|
|
create_udev_rule $2 $wwpn $lun
|
2016-09-01 13:57:40 +02:00
|
|
|
--
|
|
|
|
2.6.6
|
|
|
|
|