Date: Thu, 25 Feb 2021 20:07:31 GMT From: Cy Schubert <cy@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: f1ab799927c8 - main - rc: fix rc script parsing Message-ID: <202102252007.11PK7Vld014317@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=f1ab799927c8e93e8f58e5039f287a2ca45675ec commit f1ab799927c8e93e8f58e5039f287a2ca45675ec Author: Cy Schubert <cy@FreeBSD.org> AuthorDate: 2021-02-25 19:04:50 +0000 Commit: Cy Schubert <cy@FreeBSD.org> CommitDate: 2021-02-25 19:47:56 +0000 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 --- libexec/rc/rc | 4 ++-- 1 file 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 ;;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202102252007.11PK7Vld014317>