From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7748 invoked by alias); 20 Jul 2013 20:58:12 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 31547 Received: (qmail 26313 invoked from network); 20 Jul 2013 20:58:06 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,HTML_MESSAGE, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at brasslantern.com does not designate permitted sender hosts) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:x-gm-message-state; bh=xcIKbcsU57WB/o7ZPQZfMbxk+rVzk5C+XjYsiLn6zJc=; b=mPrpN0wCRXmC7o5QZHbihihilmIRwIX5AjTPkNT2wpq/i1mQL0sRczXXGhuIlY6Z+T b7G70mIqBVR2YNUtjiHmF16doDvi0lPg9K66h5q5+ZHMAuYn1SRd1ewYw02U0UzNYLRm NlIbAJ3/Zze369GaSq5kQSOIWOVu8ziLhfoGA9FbXe3B5oSni05+LpJ2ahGDrywycRRM IqQ3sDVRv26I/L1D4sFk5oQzWEcGdFi1mxcAxrnTkkrf8HXsBkmvZZq+aB8giH/dETgz aE9tYVugspzV6jj7WrVkkEg82oibLiAfv7wor8wJQrkF0lCIXXgbOkto4hLMRUQVFGmn ugUw== MIME-Version: 1.0 X-Received: by 10.112.5.134 with SMTP id s6mr9613408lbs.95.1374353879370; Sat, 20 Jul 2013 13:57:59 -0700 (PDT) In-Reply-To: <20130720181144.1b5a7fc0@pws-pc.ntlworld.com> References: <20130715133525.GA7694@chaz.gmail.com> <130715100624.ZM14123@torch.brasslantern.com> <20130716215540.22d88a27@pws-pc.ntlworld.com> <130717000027.ZM15643@torch.brasslantern.com> <20130717201733.2c0b029b@pws-pc.ntlworld.com> <20130718095741.3f54725f@pwslap01u.europe.root.pri> <20130718102227.527429bd@pwslap01u.europe.root.pri> <20130718123210.054f1ea1@pwslap01u.europe.root.pri> <20130719200159.GA8712@chaz.gmail.com> <20130719205853.GB8712@chaz.gmail.com> <20130720181144.1b5a7fc0@pws-pc.ntlworld.com> Date: Sat, 20 Jul 2013 13:57:59 -0700 Message-ID: Subject: Re: bug with eval, proc-subst and pipes From: Bart Schaefer To: Peter Stephenson Cc: "zsh-workers@zsh.org" Content-Type: multipart/alternative; boundary=14dae94ed641c6a1df04e1f7b2c1 X-Gm-Message-State: ALoCoQl6/ZECe9L/7O1j2FqWHZH/qpLRks6rp7Ir4A3mJ+V6407TiE7kJvSS0wz2otMVdBZyuNNu --14dae94ed641c6a1df04e1f7b2c1 Content-Type: text/plain; charset=ISO-8859-1 Note, there are at least three messages in this thread that I've never received ... they don't seem to be in my spam folder, either ... On Saturday, July 20, 2013, Peter Stephenson wrote: > On Fri, 19 Jul 2013 21:58:53 +0100 > Stephane Chazelas > wrote: > > and fd 13 by closedumps() (the missing link to compinit?). > > That's distinctly suspicious, if 13 was opened for the process > substitution. > > Does the following fix it, or is there yet more? Something doesn't look right about this patch, but I've only looked at the patch itself, not at the context (I'm away from my usual computers at the moment). The #ifndef lines seem to put both a functional and a no-op version of closedumps() in the same not-FD_CLOEXEC context? And if closedumps() was a no-op with FD_CLOEXEC before (?) then would it change anything to remove it at the point of call? (Pardon the excessive quoting below.) If it does we still have an error for older systems, but I suspect > FD_CLOEXEC (and O_CLOEXEC) are widely enough supported that may be more > a theoretical then an actual problem. > > diff --git a/Src/exec.c b/Src/exec.c > index d462d97..f9efb3a 100644 > --- a/Src/exec.c > +++ b/Src/exec.c > @@ -448,7 +448,9 @@ zexecve(char *pth, char **argv, char **newenvp) > else > sprintf(buf + 2, "%s/%s", pwd, pth); > zputenv(buf); > +#ifndef FD_CLOEXEC > closedumps(); > +#endif > > if (newenvp == NULL) > newenvp = environ; > diff --git a/Src/parse.c b/Src/parse.c > index 753080d..b670925 100644 > --- a/Src/parse.c > +++ b/Src/parse.c > @@ -3171,6 +3171,9 @@ load_dump_file(char *dump, struct stat *sbuf, int > other, int len) > d->dev = sbuf->st_dev; > d->ino = sbuf->st_ino; > d->fd = fd; > +#ifdef FD_CLOEXEC > + fcntl(fd, F_SETFD, FD_CLOEXEC); > +#endif > d->map = addr + (other ? (len - off) / sizeof(wordcode) : 0); > d->addr = addr; > d->len = len; > @@ -3439,6 +3442,7 @@ decrdumpcount(FuncDump f) > } > } > > +#ifndef FD_CLOEXEC > /**/ > mod_export void > closedumps(void) > @@ -3448,6 +3452,7 @@ closedumps(void) > for (p = dumps; p; p = p->next) > zclose(p->fd); > } > +#endif > > #else > > @@ -3461,11 +3466,13 @@ decrdumpcount(FuncDump f) > { > } > > +#ifndef FD_CLOEXEC > /**/ > mod_export void > closedumps(void) > { > } > +#endif > > #endif > > -- > Peter Stephenson > > Web page now at http://homepage.ntlworld.com/p.w.stephenson/ > --14dae94ed641c6a1df04e1f7b2c1--