NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

standards/42829: Almquist shell does not perform parameter expansion on ${ENV}



>Number:         42829
>Category:       standards
>Synopsis:       Almquist shell does not perform parameter expansion on ${ENV}
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    standards-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Feb 16 18:40:00 +0000 2010
>Originator:     Richard Hansen
>Release:        5.0
>Organization:
>Environment:
NetBSD deer-netbsd.bbn.com 5.0_STABLE NetBSD 5.0_STABLE (GENERIC) #4: Tue Feb  
2 10:43:58 EST 2010  
gdt%fnord.ir.bbn.com@localhost:/n0/obj/gdt-5/amd64/sys/arch/amd64/compile/GENERIC
 amd64
>Description:
NetBSD 5.0's /bin/sh does not perform parameter expansion on the contents of 
the ENV environment variable before using it as a pathname to a file.  
POSIX:2004 [1] and POSIX:2008 [2] (at least) require parameter expansion.

Also see PR #40639 [3], which is the same bug except applied to ${PS1} instead 
of ${ENV}.

[1] 
<http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_05_03>
[2] 
<http://www.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_05_03>
[3] <http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=40639>
>How-To-Repeat:
$ echo "echo foo" > foo
$ ENV="${PWD}/foo" /bin/sh -i
foo
$ exit
$ ENV='${PWD}/foo' /bin/sh -i
$ exit
$ 

Notice that "foo" is not printed when ${PWD}/foo is enclosed in single quotes.
>Fix:



Home | Main Index | Thread Index | Old Index