From owner-freebsd-bugs@FreeBSD.ORG Thu Oct 25 21:40:01 2012 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 862FCB07 for ; Thu, 25 Oct 2012 21:40:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.FreeBSD.org [8.8.178.135]) by mx1.freebsd.org (Postfix) with ESMTP id 5C6298FC18 for ; Thu, 25 Oct 2012 21:40:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q9PLe0dX008469 for ; Thu, 25 Oct 2012 21:40:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q9PLe0Ik008468; Thu, 25 Oct 2012 21:40:00 GMT (envelope-from gnats) Resent-Date: Thu, 25 Oct 2012 21:40:00 GMT Resent-Message-Id: <201210252140.q9PLe0Ik008468@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Chris Rees Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B6C58553 for ; Thu, 25 Oct 2012 21:30:11 +0000 (UTC) (envelope-from crees@bayofrum.net) Received: from mk-outboundfilter-1.mail.uk.tiscali.com (mk-outboundfilter-1.mail.uk.tiscali.com [212.74.114.37]) by mx1.freebsd.org (Postfix) with ESMTP id 429DE8FC08 for ; Thu, 25 Oct 2012 21:30:10 +0000 (UTC) Received: from 212-139-242-85.dynamic.dsl.as9105.com (HELO pegasus.bayofrum.net) ([212.139.242.85]) by smtp.pipex.tiscali.co.uk with ESMTP; 25 Oct 2012 22:30:09 +0100 Received: by pegasus.bayofrum.net (Postfix, from userid 1001) id E6AFC4D1BC; Thu, 25 Oct 2012 22:29:16 +0100 (BST) Message-Id: <20121025212916.E6AFC4D1BC@pegasus.bayofrum.net> Date: Thu, 25 Oct 2012 22:29:16 +0100 (BST) From: Chris Rees To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: conf/173088: [PATCH] rc.subr breaks with spaces in ${name}_chroot X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Chris Rees List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Oct 2012 21:40:01 -0000 >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@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: