Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Mar 2001 21:33:19 +0200
From:      Ruslan Ermilov <ru@FreeBSD.org>
To:        Jonathan Lemon <jlemon@flugsvamp.com>
Cc:        Garrett Wollman <wollman@khavrinen.lcs.mit.edu>, Jonathan Lemon <jlemon@FreeBSD.org>, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/lib/libc/gen glob.c
Message-ID:  <20010315213319.A5860@sunbay.com>
In-Reply-To: <20010315132503.D82645@prism.flugsvamp.com>; from jlemon@flugsvamp.com on Thu, Mar 15, 2001 at 01:25:03PM -0600
References:  <200103151850.f2FIoXl53931@freefall.freebsd.org> <200103151921.OAA48111@khavrinen.lcs.mit.edu> <20010315132503.D82645@prism.flugsvamp.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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:
> > <<On Thu, 15 Mar 2001 10:50:33 -0800 (PST), Jonathan Lemon <jlemon@FreeBSD.org> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010315213319.A5860>