conf/173088: [PATCH] rc.subr breaks with spaces in ${name}_chroot
Chris Rees
crees at physics.org
Thu Oct 25 21:40:01 UTC 2012
>Number: 173088
>Category: conf
>Synopsis: [PATCH] rc.subr breaks with spaces in ${name}_chroot
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Thu Oct 25 21:40:00 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator: Chris Rees
>Release: FreeBSD 9.0-RELEASE amd64
>Organization:
>Environment:
System: FreeBSD pegasus.bayofrum.net 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Sun Apr 29 12:29:02 BST 2012 root at pegasus.bayofrum.net:/usr/obj/usr/src/sys/PEGASUS amd64
>Description:
A guy in IRC pointed out to me that rc.subr will not work correctly if
a chroot has spaces in it.
Although this is unlikely, would it hurt to include it?
>How-To-Repeat:
>Fix:
--- rc-subr-support-chroot-spaces.diff begins here ---
Index: rc.subr
===================================================================
--- rc.subr (revision 241356)
+++ rc.subr (working copy)
@@ -261,8 +261,8 @@
_pref=
if [ $_interpreter != "." ]; then # an interpreted script
- _script=${_chroot}${_chroot:+"/"}$_procname
- if [ -r $_script ]; then
+ _script="${_chroot}${_chroot:+/}$_procname"
+ if [ -r "$_script" ]; then
read _interp < $_script # read interpreter name
case "$_interp" in
\#!*)
@@ -705,7 +705,7 @@
return 1
fi
- if [ ! -x ${_chroot}${_chroot:+"/"}${command} ]; then
+ if [ ! -x "${_chroot}${_chroot:+/}${command}" ]; then
warn "run_rc_command: cannot run $command"
return 1
fi
--- rc-subr-support-chroot-spaces.diff ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list