aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCy Schubert <cy@FreeBSD.org>2021-02-25 19:04:50 +0000
committerCy Schubert <cy@FreeBSD.org>2021-02-25 19:47:56 +0000
commitf1ab799927c8e93e8f58e5039f287a2ca45675ec (patch)
tree0b9d103b050ef8aaa33fd78c2fdcc0d296357bda
parent2ae79aa362e7a2ee72657b39be64f1390158aaf6 (diff)
downloadsrc-f1ab799927c8e93e8f58e5039f287a2ca45675ec.tar.gz
src-f1ab799927c8e93e8f58e5039f287a2ca45675ec.zip
rc: fix rc script parsing
77e1ccbee3ed6c837929e4e232fd07f95bfc8294 introduced a bug whereby rc scripts in etc/rc.d and $local_startup failed to parse output from called commands because IFS was set to " " instead of the default " \t\n". This caused parsing of output that contains any whitespace character, such as tabs and newlines, not matching just a space to fail. PR: 249192 MFC after: 3 weeks X-MFC with: 77e1ccbee3ed6c837929e4e232fd07f95bfc8294
-rw-r--r--libexec/rc/rc4
1 files changed, 2 insertions, 2 deletions
diff --git a/libexec/rc/rc b/libexec/rc/rc
index b5bc188fc7c0..92eb5c48aab7 100644
--- a/libexec/rc/rc
+++ b/libexec/rc/rc
@@ -105,7 +105,7 @@ files=`rcorder ${skip} ${skip_firstboot} ${_rc_parallel} /etc/rc.d/* 2>/dev/null
_rc_elem_done=' '
IFS=$'\n'
for _rc_group in ${files}; do
- IFS=$' '
+ unset IFS
for _rc_elem in ${_rc_group}; do
run_rc_script ${_rc_elem} ${_boot} &
_rc_elem_done="${_rc_elem_done}${_rc_elem} "
@@ -138,7 +138,7 @@ fi
files=`rcorder ${skip} ${skip_firstboot} /etc/rc.d/* ${local_rc} ${_rc_parallel} 2>/dev/null`
IFS=$'\n'
for _rc_group in ${files}; do
- IFS=$' '
+ unset IFS
for _rc_elem in ${_rc_group}; do
case "$_rc_elem_done" in
*" $_rc_elem "*) continue ;;