Date: Thu, 30 Dec 2010 22:33:55 +0000 (UTC) From: Jilles Tjoelker <jilles@FreeBSD.org> To: cvs-src-old@freebsd.org Subject: cvs commit: src/bin/sh eval.c src/tools/regression/bin/sh/expansion cmdsubst10.0 Message-ID: <201012302236.oBUMajXf081360@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
jilles 2010-12-30 22:33:55 UTC FreeBSD src repository Modified files: bin/sh eval.c Added files: tools/regression/bin/sh/expansion cmdsubst10.0 Log: SVN rev 216826 on 2010-12-30 22:33:55Z by jilles sh: Avoid side effects from builtins in optimized command substitution. Change the criterion for builtins to be safe to execute in the same process in optimized command substitution from a blacklist of only cd, . and eval to a whitelist. This avoids clobbering the main shell environment such as by $(exit 4) and $(set -x). The builtins jobid, jobs, times and trap can still show information not available in a child process; this is deliberately permitted. (Changing traps is not.) For some builtins, whether they are safe depends on the arguments passed to them. Some of these are always considered unsafe to keep things simple; this only harms efficiency a little in the rare case they are used alone in a command substitution. Revision Changes Path 1.97 +27 -5 src/bin/sh/eval.c 1.1 +51 -0 src/tools/regression/bin/sh/expansion/cmdsubst10.0 (new)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201012302236.oBUMajXf081360>