Subject: bin/28940: /bin/sh doesn't quote the output of trap
To: None <gnats-admin@netbsd.org, netbsd-bugs@netbsd.org>
From: None <dsl@netbsd.org>
List: netbsd-bugs
Date: 01/11/2005 18:33:00
>Number:         28940
>Category:       bin
>Synopsis:       /bin/sh doesn't quote the output of trap
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jan 11 18:33:00 +0000 2005
>Originator:     David Laight
>Release:        NetBSD 2.99.x
>Organization:
	
>Environment:
>Description:
	The SUS reqiures that the output of trap be quoted so that
	    save_trap=$(trap)
	    ...
	    eval $save_trap
	restores the original trap settings.
>How-To-Repeat:
	    (trap -- "echo '\$test'" HUP;trap)
	generates:
	    trap -- 'echo '$test'' HUP
	which has $test incorrectly quoted.
>Fix: