bug-bash
[Top][All Lists]
Advanced

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

Re: bash leaks sh-np-NNN files and pipes in /tmp/ when command substitut


From: Yuri
Subject: Re: bash leaks sh-np-NNN files and pipes in /tmp/ when command substitution is used
Date: Thu, 12 Dec 2013 01:41:25 -0800
User-agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0

On 12/11/2013 22:53, Piotr Grzybowski wrote:
  Yuri: I have verified that under linux 3.2.0, bash-4.2.25, nothing of
the sort takes place. tee gets/dev/fd/${somefd}, why it is not
supported in bsd kernel i have no idea, but I thought it was. I've
even built mplayer and run your script (btw. probably there is an
easier way of doing what you want), I also performed some tests with
command that actually outputs what grep looks for. Also please note
that `command substitution`, or $(command substitution) is slightly
different from >(process substitution).

Piotr,

/dev/fd/{somefd} is quite an advanced feature, and it can be/has been argued that it can lead to unpredictable behavior when file descriptors appear/disappear. So FreeBSD only implements fds 0,1,2. Even those can be closed too. There are some other systems without such feature, and bash should be fixed to work fine without it.

Yuri


reply via email to

[Prev in Thread] Current Thread [Next in Thread]