NetBSD Problem Report #43597

From jmmv@netbsd.org  Sat Jul 10 15:50:37 2010
Return-Path: <jmmv@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id D67AC63BABA
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 10 Jul 2010 15:50:37 +0000 (UTC)
Message-Id: <20100710155037.85B3663B100@mail.netbsd.org>
Date: Sat, 10 Jul 2010 15:50:37 +0000 (UTC)
From: jmmv@netbsd.org
Reply-To: jmmv@netbsd.org
To: gnats-bugs@gnats.NetBSD.org
Subject: Nested quoting in variable expansion breaks
X-Send-Pr-Version: 3.95

>Number:         43597
>Category:       bin
>Synopsis:       Nested quoting in variable expansion breaks
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jul 10 15:55:00 +0000 2010
>Closed-Date:    Mon Oct 07 04:54:39 +0000 2013
>Last-Modified:  Mon Oct 07 04:54:39 +0000 2013
>Originator:     Julio Merino
>Release:        current as of 2010/07/10, netbsd-5 and netbsd-4
>Organization:
Julio Merino
>Environment:
Architecture: x86_64
Machine: amd64
>Description:
	The following construction causes /bin/sh to keep waiting for
	input:

	    echo "${foo:="first-word"} second-word"

	When run from a script, it causes a syntax error due to unbalanced
	quotes:

	    $ /bin/sh -c 'echo "${foo:="first-word"} second-word"'
	    sh: Syntax error: Unterminated quoted string

	If there is no spaces within the first-level string, then things
	work just fine:

	    $ /bin/sh -c 'echo "${foo:="first-word"}second-word"'
	    first-wordsecond-word

	All these commands work with ksh and bash, so I assume /bin/sh is
	at fault.  Suprisingly, I have confirmed that this problem exists
	in current, in the 5.x branch and in 4.x.

	I found this problem when updating the audacious package in pkgsrc
	to a more recent version.  Its configure script includes the following
	line, which causes it to break:

	    ${as_echo:="echo"} "${as_me:="configure"}: touching .deps files"

	Given that this line comes from autoconf internals, I am afraid that
	we can start seeing breakage in more and more packages...
>How-To-Repeat:
	As described above.
>Fix:
	Unknown.

>Release-Note:

>Audit-Trail:
From: Julio Merino <jmmv@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/43597 CVS commit: src/tests/util/sh
Date: Sat, 10 Jul 2010 15:57:37 +0000

 Module Name:	src
 Committed By:	jmmv
 Date:		Sat Jul 10 15:57:37 UTC 2010

 Modified Files:
 	src/tests/util/sh: t_varquote.sh

 Log Message:
 Add xfail test case for PR bin/43597 that I just submitted.


 To generate a diff of this commit:
 cvs rdiff -u -r1.2 -r1.3 src/tests/util/sh/t_varquote.sh

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/43597 CVS commit: src/bin/sh
Date: Sun, 25 Mar 2012 14:49:14 -0400

 Module Name:	src
 Committed By:	christos
 Date:		Sun Mar 25 18:49:14 UTC 2012

 Modified Files:
 	src/bin/sh: parser.c

 Log Message:
 PR/43597: Don't break from parsing word tokens in we are in double quotes.
 Fixes: sh -c 'echo "${foo:="first-word"} second-word"'


 To generate a diff of this commit:
 cvs rdiff -u -r1.80 -r1.81 src/bin/sh/parser.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/43597 CVS commit: src/tests/bin/sh
Date: Sun, 25 Mar 2012 14:50:19 -0400

 Module Name:	src
 Committed By:	christos
 Date:		Sun Mar 25 18:50:19 UTC 2012

 Modified Files:
 	src/tests/bin/sh: t_varquote.sh

 Log Message:
 PR/43597 was fixed


 To generate a diff of this commit:
 cvs rdiff -u -r1.1 -r1.2 src/tests/bin/sh/t_varquote.sh

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->feedback
State-Changed-By: wiz@NetBSD.org
State-Changed-When: Sun, 25 Mar 2012 19:16:45 +0000
State-Changed-Why:
Christos committed a fix, ok to close?


From: Julio Merino <jmmv@julipedia.org>
To: gnats-bugs@NetBSD.org
Cc: wiz@NetBSD.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org, 
 Christos Zoulas <christos@netbsd.org>
Subject: Re: bin/43597 (Nested quoting in variable expansion breaks)
Date: Mon, 26 Mar 2012 12:54:39 +0200

 On 2012/03/25 21:16 , wiz@NetBSD.org wrote:
 > Synopsis: Nested quoting in variable expansion breaks
 >
 > State-Changed-From-To: open->feedback
 > State-Changed-By: wiz@NetBSD.org
 > State-Changed-When: Sun, 25 Mar 2012 19:16:45 +0000
 > State-Changed-Why:
 > Christos committed a fix, ok to close?

 Pull up to netbsd-6 first if possible?

From: Thomas Klausner <wiz@NetBSD.org>
To: Julio Merino <jmmv@julipedia.org>
Cc: NetBSD bugtracking <gnats-bugs@NetBSD.org>
Subject: Re: bin/43597 (Nested quoting in variable expansion breaks)
Date: Mon, 26 Mar 2012 13:02:22 +0200

 On Mon, Mar 26, 2012 at 12:54:39PM +0200, Julio Merino wrote:
 > On 2012/03/25 21:16 , wiz@NetBSD.org wrote:
 > >Synopsis: Nested quoting in variable expansion breaks
 > >
 > >State-Changed-From-To: open->feedback
 > >State-Changed-By: wiz@NetBSD.org
 > >State-Changed-When: Sun, 25 Mar 2012 19:16:45 +0000
 > >State-Changed-Why:
 > >Christos committed a fix, ok to close?
 > 
 > Pull up to netbsd-6 first if possible?

 Please request the pullup then. Thanks,
  Thomas

State-Changed-From-To: feedback->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Mon, 07 Oct 2013 04:54:39 +0000
State-Changed-Why:
6-month feedback timeout
if you still want it pulled up to -6, please feel free...


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.