diff options
author | jedgar <jedgar@FreeBSD.org> | 2001-04-17 02:33:20 +0000 |
---|---|---|
committer | jedgar <jedgar@FreeBSD.org> | 2001-04-17 02:33:20 +0000 |
commit | 58889ae5bb8ce5d32f9e6234ff21f8d89c2f54a8 (patch) | |
tree | bd1098fcecb9655225a398760f3232b9f7624863 /libexec | |
parent | a82a61059f61b3b4a69b3519044ec5a90ff87952 (diff) | |
download | FreeBSD-src-58889ae5bb8ce5d32f9e6234ff21f8d89c2f54a8.zip FreeBSD-src-58889ae5bb8ce5d32f9e6234ff21f8d89c2f54a8.tar.gz |
Limit number of paths returned via glob() for authorized users
using tilde expansion.
Diffstat (limited to 'libexec')
-rw-r--r-- | libexec/ftpd/ftpcmd.y | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libexec/ftpd/ftpcmd.y b/libexec/ftpd/ftpcmd.y index 7a96de3..04a7d87 100644 --- a/libexec/ftpd/ftpcmd.y +++ b/libexec/ftpd/ftpcmd.y @@ -947,6 +947,8 @@ pathname GLOB_BRACE|GLOB_NOCHECK|GLOB_QUOTE|GLOB_TILDE; memset(&gl, 0, sizeof(gl)); + flags |= GLOB_MAXPATH; + gl.gl_matchc = MAXGLOBARGS; if (glob($1, flags, NULL, &gl) || gl.gl_pathc == 0) { reply(550, "not found"); @@ -1037,6 +1039,8 @@ extern jmp_buf errcatch; #define SITECMD 7 /* SITE command */ #define NSTR 8 /* Number followed by a string */ +#define MAXGLOBARGS 1000 + struct tab { char *name; short token; |