From owner-freebsd-stable Sun Mar 18 14:19:10 2001 Delivered-To: freebsd-stable@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 3A05837B71B for ; Sun, 18 Mar 2001 14:19:00 -0800 (PST) (envelope-from jlemon@flugsvamp.com) Received: (from jlemon@localhost) by prism.flugsvamp.com (8.11.0/8.11.0) id f2IMFLw48314; Sun, 18 Mar 2001 16:15:21 -0600 (CST) (envelope-from jlemon) Date: Sun, 18 Mar 2001 16:15:21 -0600 From: Jonathan Lemon To: Jonathan Lemon Cc: Matt Dillon , stable@freebsd.org Subject: Re: Not only ftpd's problem with ls */../*..... Message-ID: <20010318161521.G82645@prism.flugsvamp.com> References: <200103172253.f2HMrZ008412@prism.flugsvamp.com> <200103180027.f2I0RSn96769@earth.backplane.com> <20010317222918.B82645@prism.flugsvamp.com> <200103180543.f2I5hb398084@earth.backplane.com> <20010318160034.F82645@prism.flugsvamp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0pre2i In-Reply-To: <20010318160034.F82645@prism.flugsvamp.com> Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sun, Mar 18, 2001 at 04:00:34PM -0600, Jonathan Lemon wrote: > > Patch attached. Oh yeah, this doesn't include the patch to ftpd, which is fairly trivial. -- Jonathan Index: ftpd.c =================================================================== RCS file: /ncvs/src/libexec/ftpd/ftpd.c,v retrieving revision 1.72 diff -u -r1.72 ftpd.c --- ftpd.c 2000/12/20 03:34:54 1.72 +++ ftpd.c 2001/03/18 22:30:45 @@ -189,6 +189,13 @@ char *pid_file = NULL; /* + * Limit number of pathnames that glob can return. + * A limit of 0 indicates the number of pathnames is unlimited. + */ +#define MAXGLOBARGS 16384 +# + +/* * Timeout intervals for retrying connections * to hosts that don't accept PORT cmds. This * is a kludge, but given the problems with TCP... @@ -2620,6 +2627,8 @@ int flags = GLOB_BRACE|GLOB_NOCHECK|GLOB_QUOTE|GLOB_TILDE; memset(&gl, 0, sizeof(gl)); + gl.gl_matchc = MAXGLOBARGS; + flags |= GLOB_MAXPATH; freeglob = 1; if (glob(whichf, flags, 0, &gl)) { reply(550, "not found"); Index: popen.c =================================================================== RCS file: /ncvs/src/libexec/ftpd/popen.c,v retrieving revision 1.19 diff -u -r1.19 popen.c --- popen.c 2000/09/04 05:47:14 1.19 +++ popen.c 2001/03/18 22:26:38 @@ -107,6 +107,8 @@ int flags = GLOB_BRACE|GLOB_NOCHECK|GLOB_QUOTE|GLOB_TILDE; memset(&gl, 0, sizeof(gl)); + gl.gl_matchc = MAXGLOBARGS; + flags |= GLOB_MAXPATH; if (glob(argv[argc], flags, NULL, &gl)) gargv[gargc++] = strdup(argv[argc]); else To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message