aboutsummaryrefslogtreecommitdiff
path: root/libexec/ftpd/ftpcmd.y
diff options
context:
space:
mode:
authorBrian Feldman <green@FreeBSD.org>2001-04-16 22:20:26 +0000
committerBrian Feldman <green@FreeBSD.org>2001-04-16 22:20:26 +0000
commit7d6505e64eeb068562679202b3819962c99eaa76 (patch)
treea9772ac4dc27f74b14addda66add3f2ce71e065e /libexec/ftpd/ftpcmd.y
parentb952dabaa1f9ac1b97fa0fb5597677bd48940cbd (diff)
downloadsrc-7d6505e64eeb068562679202b3819962c99eaa76.tar.gz
src-7d6505e64eeb068562679202b3819962c99eaa76.zip
Support the empty "PASS\r\n" command.
Notes
Notes: svn path=/head/; revision=75556
Diffstat (limited to 'libexec/ftpd/ftpcmd.y')
-rw-r--r--libexec/ftpd/ftpcmd.y10
1 files changed, 7 insertions, 3 deletions
diff --git a/libexec/ftpd/ftpcmd.y b/libexec/ftpd/ftpcmd.y
index f3bff5d3c009..7a96de3e48c1 100644
--- a/libexec/ftpd/ftpcmd.y
+++ b/libexec/ftpd/ftpcmd.y
@@ -166,6 +166,10 @@ cmd
pass($3);
free($3);
}
+ | PASS CRLF
+ {
+ pass("");
+ }
| PORT check_login SP host_port CRLF
{
if (epsvall) {
@@ -1028,7 +1032,7 @@ extern jmp_buf errcatch;
#define STR1 2 /* expect SP followed by STRING */
#define STR2 3 /* expect STRING */
#define OSTR 4 /* optional SP then STRING */
-#define ZSTR1 5 /* SP then optional STRING */
+#define ZSTR1 5 /* optional SP then optional STRING */
#define ZSTR2 6 /* optional STRING after SP */
#define SITECMD 7 /* SITE command */
#define NSTR 8 /* Number followed by a string */
@@ -1043,7 +1047,7 @@ struct tab {
struct tab cmdtab[] = { /* In order defined in RFC 765 */
{ "USER", USER, STR1, 1, "<sp> username" },
- { "PASS", PASS, ZSTR1, 1, "<sp> password" },
+ { "PASS", PASS, ZSTR1, 1, "[<sp> [password]]" },
{ "ACCT", ACCT, STR1, 0, "(specify account)" },
{ "SMNT", SMNT, ARGS, 0, "(structure mount)" },
{ "REIN", REIN, ARGS, 0, "(reinitialize server state)" },
@@ -1298,6 +1302,7 @@ yylex()
state = CMD;
break;
+ case ZSTR1:
case OSTR:
if (cbuf[cpos] == '\n') {
state = CMD;
@@ -1306,7 +1311,6 @@ yylex()
/* FALLTHROUGH */
case STR1:
- case ZSTR1:
dostr1:
if (cbuf[cpos] == ' ') {
cpos++;