From 5f8fa6bc2d8af9e32fae0fa711eb40b857a003de Mon Sep 17 00:00:00 2001 From: Kirill Elagin Date: Thu, 7 Jul 2011 11:51:39 -0500 Subject: [PATCH] save and restore IFS correctly --- init.d/localmount.in | 8 +------- init.d/mount-ro.in | 8 +------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/init.d/localmount.in b/init.d/localmount.in index efbddc7..166ee77 100644 --- a/init.d/localmount.in +++ b/init.d/localmount.in @@ -37,16 +37,10 @@ stop() local x= no_umounts_r="/|/dev|/dev/.*|${RC_SVCDIR}" no_umounts_r="${no_umounts_r}|/bin|/sbin|/lib|/libexec" # RC_NO_UMOUNTS is an env var that can be set by plugins - local OIFS=$IFS SIFS=${IFS-y} - IFS=$IFS: + local IFS="$IFS:" for x in $no_umounts $RC_NO_UMOUNTS; do no_umounts_r="$no_umounts_r|$x" done - if [ "$SIFS" = y ]; then - IFS=$OIFS - else - unset IFS - fi if [ "$RC_UNAME" = Linux ]; then no_umounts_r="$no_umounts_r|/proc|/proc/.*|/run|/sys|/sys/.*" diff --git a/init.d/mount-ro.in b/init.d/mount-ro.in index dc2a098..7049d4b 100644 --- a/init.d/mount-ro.in +++ b/init.d/mount-ro.in @@ -22,16 +22,10 @@ start() local m="/dev|/dev/.*|/proc|/proc.*|/sys|/sys/.*|${RC_SVCDIR}" x= fs= m="$m|/bin|/sbin|/lib|/libexec" # RC_NO_UMOUNTS is an env var that can be set by plugins - local OIFS=$IFS SIFS=${IFS-y} IFS=$IFS - IFS=$IFS: + local IFS="$IFS:" for x in $no_umounts $RC_NO_UMOUNTS; do m="$m|$x" done - if [ "$SIFS" = y ]; then - IFS=$OIFS - else - unset IFS - fi m="^($m)$" fs= for x in $net_fs_list $extra_net_fs_list; do -- 1.7.3.4