Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Mar 2001 16:15:21 -0600
From:      Jonathan Lemon <jlemon@flugsvamp.com>
To:        Jonathan Lemon <jlemon@flugsvamp.com>
Cc:        Matt Dillon <dillon@earth.backplane.com>, stable@freebsd.org
Subject:   Re: Not only ftpd's problem with ls */../*.....
Message-ID:  <20010318161521.G82645@prism.flugsvamp.com>
In-Reply-To: <20010318160034.F82645@prism.flugsvamp.com>
References:  <local.mail.freebsd-stable/200103172107.f2HL7Ea02611@cwsys.cwsent.com> <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>

next in thread | previous in thread | raw e-mail | index | archive | help
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




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