Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: fd used for saving redirected fds leaked to child processes



Peter Stephenson wrote on Mon, 14 Aug 2017 20:19 +0100:
> On Mon, 14 Aug 2017 07:49:52 -0700
> Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> > On Mon, Aug 14, 2017 at 2:09 AM, Peter Stephenson
> > <p.stephenson@xxxxxxxxxxx> wrote:
> > >
> > > We need to expose the entire hierarchy for this particular case, but
> > > that looks like a stack or a linked list, which seems a little
> > > heavyweight for this case.
> > 
> > Another flag in the fdtable array?
> 
> This does that --- this looks easy.  It didn't seem convenient to
> optimise, since once one set of saved fds is restored, exposing any in
> an enclosing scope, there's no way of working out which the new highest
> number is without an exhaustive search.

This patch introduces a new warning:

% Src/zsh -fc ': 3>&1' 
1: Src/exec.c:2330: Saved file descriptor not marked as internal

It's commit ddb86759012992fa6471bd738f906a4ed434b69f (the log message
doesn't include the X-Seq).

Found this via z-sy-h's "make quiet-test".

Cheers,

Daniel



Messages sorted by: Reverse Date, Date, Thread, Author