From owner-cvs-all Thu Mar 15 11:34: 5 2001 Delivered-To: cvs-all@freebsd.org Received: from whale.sunbay.crimea.ua (whale.sunbay.crimea.ua [212.110.138.65]) by hub.freebsd.org (Postfix) with ESMTP id DCE7637B71C; Thu, 15 Mar 2001 11:33:54 -0800 (PST) (envelope-from ru@whale.sunbay.crimea.ua) Received: (from ru@localhost) by whale.sunbay.crimea.ua (8.11.2/8.11.2) id f2FJXKh06415; Thu, 15 Mar 2001 21:33:20 +0200 (EET) (envelope-from ru) Date: Thu, 15 Mar 2001 21:33:19 +0200 From: Ruslan Ermilov To: Jonathan Lemon Cc: Garrett Wollman , Jonathan Lemon , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/lib/libc/gen glob.c Message-ID: <20010315213319.A5860@sunbay.com> Mail-Followup-To: Jonathan Lemon , Garrett Wollman , Jonathan Lemon , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org References: <200103151850.f2FIoXl53931@freefall.freebsd.org> <200103151921.OAA48111@khavrinen.lcs.mit.edu> <20010315132503.D82645@prism.flugsvamp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010315132503.D82645@prism.flugsvamp.com>; from jlemon@flugsvamp.com on Thu, Mar 15, 2001 at 01:25:03PM -0600 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, Mar 15, 2001 at 01:25:03PM -0600, Jonathan Lemon wrote: > On Thu, Mar 15, 2001 at 02:21:28PM -0500, Garrett Wollman wrote: > > < said: > > > > > Limit the number of paths that glob can return to MAX_GLOBENTRIES, which > > > is currently set to 10000. > > > > I don't see any language in the current POSIX draft that permits such > > behavior. I think it's clearly intended that glob() return all paths > > which match the given specification. The only possible error relevant > > to this case is: > > > > GLOB_NOSPACE An attempt to allocate memory failed. > > > > But I think returning GLOB_NOSPACE for the case of ``you tried to glob > > too many files'' is a huge stretch. > > Well, I agree that there is nothing in the documentation that > explicitly limits the amount of space that glob should take, and this > is probably a bug. It woule probably be better if somehow, the > application set the limit in advance. I'm also returning GLOB_ABEND > instead of GLOB_NOSPACE. > > If you want to try this out, ftp to your machine, and then perform > 'ls */../*/../*/../*/../*/../*/../*'; this will cause ftpd to start > chewing up all memory and cpu. > > This applies to anything using glob, not just ftpd, though. > That's what the resource limits for, no? -- Ruslan Ermilov Oracle Developer/DBA, ru@sunbay.com Sunbay Software AG, ru@FreeBSD.org FreeBSD committer, +380.652.512.251 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message