Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #16506

Re: ‘command … &’ creates subshell

Path csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail
From Eli Schwartz <eschwartz@archlinux.org>
Newsgroups gnu.bash.bug
Subject Re: ‘command … &’ creates subshell
Date Wed, 1 Jul 2020 07:54:05 -0400
Lines 78
Approved bug-bash@gnu.org
Message-ID <mailman.749.1593604464.2574.bug-bash@gnu.org> (permalink)
References <tuysgrgt.dag@gnui.org> <pn9hipci.dag@gnui.org> <ac4a98bd-32f4-5c55-3b8f-1306e9758f54@case.edu> <7dvoi92p.dag@gnui.org> <09ea84b2-4fb1-6b05-7c0b-fe6b2ab00c6f@archlinux.org> <2643.1593599092@jinx.noi.kre.to> <511886e8-2262-39ee-2a01-7d284e981cb1@archlinux.org>
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="lK4WBOkiyJZqtaMdrW8cgDc4jTrI53wsP"
X-Trace usenet.stanford.edu 1593604464 29550 209.51.188.17 (1 Jul 2020 11:54:24 GMT)
X-Complaints-To action@cs.stanford.edu
Cc bug-bash@gnu.org
To Robert Elz <kre@munnari.OZ.AU>, Dmitry Alexandrov <dag@gnui.org>
Envelope-to bug-bash@gnu.org
X-Spam-BL-Results
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/simple; d=archlinux.org; s=orion; t=1593604451; bh=mSP7V174I75JbEkAD2wLZ9DqdJfBvrzNbZFED/Gk50Y=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=K/XN9HcGQd6h4mExrDlLeEzkcFIiu+e86/2pE8FVAZ3oQkdaiZim7/BcSX8Hz0Fh+ 3p4jWlgIVC4jfjT+a4Vkd9uy7obPk1Gxbq1UsP/rfMjVwKBDhg01T/+sxihsRUnhR3 MlxKy7LrtHpBJr0qltmcwj6oyd3dcjyUr13ReigTxqpGOkPwlAwJqr61AHsUPBYsZK wqkTWriHH8I6Ve94CltSXV9obrRjUDtyV2lAGk7rykmf+7yk/j0VXuZE+2nh1OO1Hf nlU4k2lMWZDuaq/w00Ld0h6sdS1G9n4FUaoNgcW0B+LKeXnMLOobpv7l0m5y0yWwXK Di69R3VKqsCWuSaU0B12Iq5jldhXj5sKE3xjGFIUGtu6dFZNRl77MDC7jp1PkvFBui vJORAYAltdjvmsi7sV5vPmFX9KiwrYMrFyCsjjZhHdorT2ef+OTwKGzEeKXxfk/JVV pWJOIU3V6fgkHp/GTan49ZuWmLURbA15hTeKcZs13DoeQTAGLM6zQNpmKHBH2W3AiX rQaaQXyFaxMtTnl+4ahGBz6xPEGHLEwV6RuHC+T7kN8Z3RARnAIEI4u+zatDQQaK0O NTyZ4txuSlJr+f3jAZhkP/hoYYs3FAXqIXYLVFip/CUqxJj/Zz+QJrAPycNZP8aFi7 iWYo21ltLGeg7MZ0vo/5LyXw=
X-Clacks-Overhead GNU Terry Pratchett
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0
In-Reply-To <2643.1593599092@jinx.noi.kre.to>
Received-SPF pass client-ip=88.198.91.70; envelope-from=eschwartz@archlinux.org; helo=orion.archlinux.org
X-detected-operating-system by eggs.gnu.org: First seen = 2020/07/01 07:54:16
X-ACL-Warn Detected OS = Linux 2.2.x-3.x [generic] [fuzzy]
X-Spam_score_int -53
X-Spam_score -5.4
X-Spam_bar -----
X-Spam_report (-5.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN
X-Spam_action no action
X-BeenThere bug-bash@gnu.org
X-Mailman-Version 2.1.23
Precedence list
List-Id Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive <https://lists.gnu.org/archive/html/bug-bash>
List-Post <mailto:bug-bash@gnu.org>
List-Help <mailto:bug-bash-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
X-Mailman-Original-Message-ID <511886e8-2262-39ee-2a01-7d284e981cb1@archlinux.org>
X-Mailman-Original-References <tuysgrgt.dag@gnui.org> <pn9hipci.dag@gnui.org> <ac4a98bd-32f4-5c55-3b8f-1306e9758f54@case.edu> <7dvoi92p.dag@gnui.org> <09ea84b2-4fb1-6b05-7c0b-fe6b2ab00c6f@archlinux.org> <2643.1593599092@jinx.noi.kre.to>
Xref csiph.com gnu.bash.bug:16506

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

On 7/1/20 6:24 AM, Robert Elz wrote:
>     Date:        Wed, 01 Jul 2020 00:43:14 +0300
>     From:        Dmitry Alexandrov <dag@gnui.org>
>     Message-ID:  <tuysgrgt.dag@gnui.org>
> 
>   | > If you need to ensure a disk executable is used,
>   | Of course.  Why "command" otherwise?
> 
> That doesn't actually work, "command" can run built-ins, there is
> actually no method (not even via use of "env") which guarantees
> execution of an executable from an external file, other than by
> using the complete path name (containing at least one '/') of the
> desired file.

Indeed -- that's why I specifically used the bashism $(type -P ...) as
type -P forces the printing of an external file executable.

Regarding use of env, I presume you're referring to the busybox behavior
here, where busybox's builtin env applet will still execute other
builtin applets.  That's the only case I'm aware of that will not
guarantee execution of an executable from an external file -- so
shouldn't env be safe to use as such, if you know:

a) your interpreter is bash rather than /bin/sh,
b) the external disk executable "env" is not a symlink to busybox

-- 
Eli Schwartz
Arch Linux Bug Wrangler and Trusted User

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

Re: ‘command … &’ creates subshell Eli Schwartz <eschwartz@archlinux.org> - 2020-07-01 07:54 -0400

csiph-web