From owner-cvs-src-old@FreeBSD.ORG Thu Dec 30 22:36:46 2010 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14420106566B for ; Thu, 30 Dec 2010 22:36:46 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 022C38FC08 for ; Thu, 30 Dec 2010 22:36:46 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.4/8.14.4) with ESMTP id oBUMajgw081361 for ; Thu, 30 Dec 2010 22:36:45 GMT (envelope-from jilles@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.4/8.14.4/Submit) id oBUMajXf081360 for cvs-src-old@freebsd.org; Thu, 30 Dec 2010 22:36:45 GMT (envelope-from jilles@repoman.freebsd.org) Message-Id: <201012302236.oBUMajXf081360@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to jilles@repoman.freebsd.org using -f From: Jilles Tjoelker Date: Thu, 30 Dec 2010 22:33:55 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/bin/sh eval.c src/tools/regression/bin/sh/expansion cmdsubst10.0 X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Dec 2010 22:36:46 -0000 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)