From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3240 invoked from network); 23 Sep 2009 19:41:03 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from new-brage.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.254.104) by ns1.primenet.com.au with SMTP; 23 Sep 2009 19:41:03 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 98438 invoked from network); 23 Sep 2009 19:41:00 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 23 Sep 2009 19:41:00 -0000 Received: (qmail 27846 invoked by alias); 23 Sep 2009 19:40:56 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 27290 Received: (qmail 27824 invoked from network); 23 Sep 2009 19:40:56 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 23 Sep 2009 19:40:56 -0000 Received: from mtaout02-winn.ispmail.ntl.com (mtaout02-winn.ispmail.ntl.com [81.103.221.48]) by bifrost.dotsrc.org (Postfix) with ESMTP id DE467804CE03 for ; Wed, 23 Sep 2009 21:40:38 +0200 (CEST) Received: from aamtaout03-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout02-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20090923194038.RNFX6611.mtaout02-winn.ispmail.ntl.com@aamtaout03-winn.ispmail.ntl.com> for ; Wed, 23 Sep 2009 20:40:38 +0100 Received: from pws-pc ([82.6.98.90]) by aamtaout03-winn.ispmail.ntl.com (InterMail vG.2.02.00.01 201-2161-120-102-20060912) with ESMTP id <20090923194038.PVDK2093.aamtaout03-winn.ispmail.ntl.com@pws-pc> for ; Wed, 23 Sep 2009 20:40:38 +0100 Date: Wed, 23 Sep 2009 20:40:17 +0100 From: Peter Stephenson To: zsh-workers@sunsite.dk Subject: Re: latest from CVS segfaults when FD ulimit is set too low Message-ID: <20090923204017.3c27a8eb@pws-pc> In-Reply-To: <090922064007.ZM5883@torch.brasslantern.com> References: <87iqfgwplu.fsf@meyering.net> <20090921214528.7c7b412c@pws-pc> <20090922100019.3c302758@news01> <090922064007.ZM5883@torch.brasslantern.com> X-Mailer: Claws Mail 3.7.2 (GTK+ 2.16.6; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Cloudmark-Analysis: v=1.0 c=1 a=VR7FTlIkdzgA:10 a=q2GGsy2AAAAA:8 a=NLZqzBF-AAAA:8 a=W8F0Szl77KNwcmKs8qQA:9 a=dDpHVwBgbH45NH58Sn5Rb4e-VlYA:4 a=I6wTmPyJxzYA:10 a=_dQi-Dcv4p4A:10 X-Virus-Scanned: ClamAV 0.94.2/9828/Wed Sep 23 19:56:24 2009 on bifrost X-Virus-Status: Clean On Tue, 22 Sep 2009 06:40:07 -0700 Bart Schaefer wrote: > Perhaps instead of an unconditional close, movefd() should do > > if (fe != -1 || fd > 2) > zclose(fd); > > so we never actually lose stdin/out/err but other leaks are plugged. I think that does make sense, in the context of calls that aren't fully error-checked. The worst that's likely to happen is that if a user deliberately closed 0, 1, or 2 we'll get an unwanted fd there. In return 0, 1, or 2 won't be accidentally closed. -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/