From nobody@FreeBSD.org  Sat Aug 18 21:23:03 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8BE12106566C
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 18 Aug 2012 21:23:03 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 76D478FC15
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 18 Aug 2012 21:23:03 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q7ILN3Md070373
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 18 Aug 2012 21:23:03 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q7ILN3d2070372;
	Sat, 18 Aug 2012 21:23:03 GMT
	(envelope-from nobody)
Message-Id: <201208182123.q7ILN3d2070372@red.freebsd.org>
Date: Sat, 18 Aug 2012 21:23:03 GMT
From: Devin Teske <dteske@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: bsdinstall(8) produces "unexpected operator" error when passed multi-word first-argument containing whitespace
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         170759
>Category:       bin
>Synopsis:       bsdinstall(8) produces "unexpected operator" error when passed multi-word first-argument containing whitespace
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    dteske
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Aug 18 21:30:09 UTC 2012
>Closed-Date:    Tue Aug 28 16:01:10 UTC 2012
>Last-Modified:  Tue Aug 28 16:01:10 UTC 2012
>Originator:     Devin Teske
>Release:        FreeBSD 9.0-RELEASE i386
>Organization:
FIS Global, Inc.
>Environment:
FreeBSD scribe9.vicor.com 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan  3 07:15:25 UTC 2012     root@obrian.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386
>Description:
When executing bsdinstall(8) with a multi-word first-argument, you get an "unexpected operator" error.
>How-To-Repeat:
Execute: bsdinstall foo
Result: No error, as expected
Execute now: bsdinstall foo\ bar
Result: [: foo: unexpected operator
>Fix:
The problem is surely line 37 of bsdinstall(8) shown below:

if [ -z $VERB ]; then

Which should be instead:

if [ -z "$VERB" ]; then


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-sysinstall 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sun Aug 19 12:23:52 UTC 2012 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=170759 
Responsible-Changed-From-To: freebsd-sysinstall->dteske 
Responsible-Changed-By: dteske 
Responsible-Changed-When: Sun Aug 19 16:12:30 UTC 2012 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=170759 

From: Devin Teske <devin.teske@fisglobal.com>
To: <bug-followup@FreeBSD.org>, Devin Teske <dteske@FreeBSD.org>
Cc: Ed Maste <emaste@FreeBSD.org>
Subject: Re: bin/170759: bsdinstall(8) produces &quot;unexpected operator&quot; error when passed multi-word first-argument containing whitespace
Date: Sun, 19 Aug 2012 09:29:43 -0700

 --Apple-Mail=_A10A2FBF-D692-4AB0-84C6-88BEF0697353
 Content-Transfer-Encoding: 7bit
 Content-Type: text/plain; charset="us-ascii"
 
 Proposed patch attached as patch.txt
 Proposed commit message below:
 
 Fix "unexpected operator" error when passed multi-word first-argument 
 containing whitespace. Also make other changes to support multi-word
 arguments.
 
 PR:             bin/170759
 Submitted by:   dteske
 Reviewed by:   needs review
 Approved by:    needs approval
 MFC after:      3 days
 
 
 _____________
 The information contained in this message is proprietary and/or confidential. If you are not the intended recipient, please: (i) delete the message and all copies; (ii) do not disclose, distribute or use the message in any manner; and (iii) notify the sender immediately. In addition, please be aware that any message addressed to our domain is subject to archiving and review by persons other than the intended recipient. Thank you.
 
 --Apple-Mail=_A10A2FBF-D692-4AB0-84C6-88BEF0697353
 Content-Disposition: attachment; filename="patch.txt"
 Content-Type: text/plain; name="patch.txt"
 Content-Transfer-Encoding: 7bit
 
 Index: bsdinstall
 ===================================================================
 --- bsdinstall	(revision 239395)
 +++ bsdinstall	(working copy)
 @@ -32,13 +32,12 @@
  : ${BSDINSTALL_DISTDIR="/usr/freebsd-dist"}; export BSDINSTALL_DISTDIR
  : ${BSDINSTALL_CHROOT="/mnt"}; export BSDINSTALL_CHROOT
  
 -VERB=$1; shift
 +VERB="$1"; shift
  
 -if [ -z $VERB ]; then
 +if [ -z "$VERB" ]; then
  	VERB=auto
  fi
  
  test -d "$BSDINSTALL_TMPETC" || mkdir "$BSDINSTALL_TMPETC"
 -echo Running installation step: $VERB $@ >> "$BSDINSTALL_LOG"
 -exec /usr/libexec/bsdinstall/$VERB $@ 2>>"$BSDINSTALL_LOG"
 -
 +echo "Running installation step: $VERB $@" >> "$BSDINSTALL_LOG"
 +exec "/usr/libexec/bsdinstall/$VERB" "$@" 2>>"$BSDINSTALL_LOG"
 
 --Apple-Mail=_A10A2FBF-D692-4AB0-84C6-88BEF0697353--

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/170759: commit references a PR
Date: Tue, 21 Aug 2012 13:47:01 +0000 (UTC)

 Author: dteske
 Date: Tue Aug 21 13:46:46 2012
 New Revision: 239500
 URL: http://svn.freebsd.org/changeset/base/239500
 
 Log:
   Fix "unexpected operator" error when passed multi-word first-argument
   containing whitespace. Also make other changes to support multi-word
   arguments.
   
   PR:		bin/170759
   Submitted by:	dteske
   Reviewed by:	emaste (mentor)
   Approved by:	emaste (mentor)
   MFC after:	3 days
 
 Modified:
   head/usr.sbin/bsdinstall/bsdinstall
 
 Modified: head/usr.sbin/bsdinstall/bsdinstall
 ==============================================================================
 --- head/usr.sbin/bsdinstall/bsdinstall	Tue Aug 21 13:33:48 2012	(r239499)
 +++ head/usr.sbin/bsdinstall/bsdinstall	Tue Aug 21 13:46:46 2012	(r239500)
 @@ -34,11 +34,10 @@
  
  VERB=$1; shift
  
 -if [ -z $VERB ]; then
 +if [ -z "$VERB" ]; then
  	VERB=auto
  fi
  
  test -d "$BSDINSTALL_TMPETC" || mkdir "$BSDINSTALL_TMPETC"
 -echo Running installation step: $VERB $@ >> "$BSDINSTALL_LOG"
 -exec /usr/libexec/bsdinstall/$VERB $@ 2>>"$BSDINSTALL_LOG"
 -
 +echo "Running installation step: $VERB $@" >> "$BSDINSTALL_LOG"
 +exec "/usr/libexec/bsdinstall/$VERB" "$@" 2>>"$BSDINSTALL_LOG"
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->patched 
State-Changed-By: dteske 
State-Changed-When: Tue Aug 21 14:08:14 UTC 2012 
State-Changed-Why:  
Committed as r239500. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=170759 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/170759: commit references a PR
Date: Tue, 28 Aug 2012 15:45:47 +0000 (UTC)

 Author: dteske
 Date: Tue Aug 28 15:45:37 2012
 New Revision: 239782
 URL: http://svn.freebsd.org/changeset/base/239782
 
 Log:
   MFC r239500:
   Fix "unexpected operator" error when passed multi-word first-argument
   containing whitespace. Also make other changes to support multi-word
   arguments.
   
   PR:		bin/170759
   Submitted by:	dteske
   Reviewed by:	emaste (mentor)
   Approved by:	emaste (mentor)
 
 Modified:
   stable/9/usr.sbin/bsdinstall/bsdinstall
 
 Modified: stable/9/usr.sbin/bsdinstall/bsdinstall
 ==============================================================================
 --- stable/9/usr.sbin/bsdinstall/bsdinstall	Tue Aug 28 14:20:41 2012	(r239781)
 +++ stable/9/usr.sbin/bsdinstall/bsdinstall	Tue Aug 28 15:45:37 2012	(r239782)
 @@ -34,11 +34,10 @@
  
  VERB=$1; shift
  
 -if [ -z $VERB ]; then
 +if [ -z "$VERB" ]; then
  	VERB=auto
  fi
  
  test -d "$BSDINSTALL_TMPETC" || mkdir "$BSDINSTALL_TMPETC"
 -echo Running installation step: $VERB $@ >> "$BSDINSTALL_LOG"
 -exec /usr/libexec/bsdinstall/$VERB $@ 2>>"$BSDINSTALL_LOG"
 -
 +echo "Running installation step: $VERB $@" >> "$BSDINSTALL_LOG"
 +exec "/usr/libexec/bsdinstall/$VERB" "$@" 2>>"$BSDINSTALL_LOG"
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: dteske 
State-Changed-When: Tue Aug 28 15:59:11 UTC 2012 
State-Changed-Why:  
MFC'd to stable/9 as r239782 

http://www.freebsd.org/cgi/query-pr.cgi?pr=170759 
>Unformatted:
