From owner-cvs-all Thu Mar 15 11:28:48 2001 Delivered-To: cvs-all@freebsd.org Received: from prism.flugsvamp.com (cb58709-a.mdsn1.wi.home.com [24.17.241.9]) by hub.freebsd.org (Postfix) with ESMTP id 721A937B71A; Thu, 15 Mar 2001 11:28:43 -0800 (PST) (envelope-from jlemon@flugsvamp.com) Received: (from jlemon@localhost) by prism.flugsvamp.com (8.11.0/8.11.0) id f2FJP3B09578; Thu, 15 Mar 2001 13:25:03 -0600 (CST) (envelope-from jlemon) Date: Thu, 15 Mar 2001 13:25:03 -0600 From: Jonathan Lemon To: Garrett Wollman Cc: Jonathan Lemon , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/lib/libc/gen glob.c Message-ID: <20010315132503.D82645@prism.flugsvamp.com> References: <200103151850.f2FIoXl53931@freefall.freebsd.org> <200103151921.OAA48111@khavrinen.lcs.mit.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0pre2i In-Reply-To: <200103151921.OAA48111@khavrinen.lcs.mit.edu> Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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. -- Jonathan To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message