NetBSD-Bugs archive

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

bin/51145: /bin/sh accepts '()' as a valid sub-shell



>Number:         51145
>Category:       bin
>Synopsis:       /bin/sh accepts '()' as a valid sub-shell
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 16 03:25:00 +0000 2016
>Originator:     Robert Elz
>Release:        NetBSD 7.99.26 (all versions from historic until fixed)
>Organization:
>Environment:
System: NetBSD andromeda.noi.kre.to 7.99.26 NetBSD 7.99.26 (VBOX64-1.1-20160128) #43: Thu Jan 28 16:09:08 ICT 2016 kre%onyx.coe.psu.ac.th@localhost:/usr/obj/current/kernels/amd64/VBOX64 amd64
Architecture: x86_64
Machine: amd64
>Description:
	Note: this is related to (but perhaps not quite the same as)
	PR bin/48489

	A sub-shell
		( ... )
	is supposed to contain a command list, and a command list
	cannot be entirely empty (it can, for example, come close,
	as wth ...
		X= ; ( $X )
	but that's not empty, it just evaluates to nothing, later...

	/bin/sh (NetBSD) (and several other shells) does not object
	to literally nothing (white space does not count) appearing
	inside a sub-shell.   bash, zsh (and even dash, which is derived
	from NetBSD's shell, way back) do.

>How-To-Repeat:
	/bin/sh -c '()'

	There should be an error, and non-zero exit code.  There isn't.

>Fix:
	To be investigated.   The fix committed for 48489 does not fix
	this one, which means that fix might get redone as well (if
	it turns out that one fix can fix both.)



Home | Main Index | Thread Index | Old Index