Date: Wed, 28 Aug 2002 06:40:03 -0700 (PDT) From: Maxim Konovalov <maxim@FreeBSD.org> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/42108: ftpd works wrong if ACCT command was used. Message-ID: <200208281340.g7SDe3kU076928@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/42108; it has been noted by GNATS. From: Maxim Konovalov <maxim@FreeBSD.org> To: Alex Masterov <alex@infobit.ru> Cc: bug-followup@FreeBSD.org, <yar@FreeBSD.org>, <millert@OpenBSD.org> Subject: Re: bin/42108: ftpd works wrong if ACCT command was used. Date: Wed, 28 Aug 2002 17:33:25 +0400 (MSD) Please try a patch below. It is for RELENG_4_6_2_RELEASE. Yar, could you please review/commit the changes? yylex() returns NOTIMPL for not implemented commands and only for them. NOTIMPL is only user of nack() now and we can move its functionality to NOTIMPL. As far as I understand, OpenBSD has this bug too, so I CC'ed millert@OpenBSD.org, an author of rev. 1.26 ftpcmd.y. Index: ftpcmd.y =================================================================== RCS file: /home/ncvs/src/libexec/ftpd/ftpcmd.y,v retrieving revision 1.16.2.9 diff -u -r1.16.2.9 ftpcmd.y --- ftpcmd.y 15 Apr 2002 15:41:53 -0000 1.16.2.9 +++ ftpcmd.y 28 Aug 2002 13:17:03 -0000 @@ -135,7 +135,7 @@ UMASK IDLE CHMOD MDFIVE - LEXERR + LEXERR NOTIMPL %token <s> STRING %token <u> NUMBER @@ -144,7 +144,7 @@ %type <u.i> check_login_ro check_login_epsv %type <u.i> struct_code mode_code type_code form_code %type <s> pathstring pathname password username -%type <s> ALL +%type <s> ALL NOTIMPL %start cmd_list @@ -753,6 +753,10 @@ reply(221, "Goodbye."); dologout(0); } + | NOTIMPL + { + nack($1); + } | error { yyclearin; /* discard lookahead data */ @@ -1294,12 +1298,10 @@ p = lookup(cmdtab, cbuf); cbuf[cpos] = c; if (p != 0) { - if (p->implemented == 0) { - nack(p->name); - return (LEXERR); - } - state = p->state; yylval.s = p->name; + if (p->implemented == 0) + return (NOTIMPL); + state = p->state; return (p->token); } break; @@ -1318,13 +1320,12 @@ p = lookup(sitetab, cp); cbuf[cpos] = c; if (guest == 0 && p != 0) { + yylval.s = p->name; if (p->implemented == 0) { state = CMD; - nack(p->name); - return (LEXERR); + return (NOTIMPL); } state = p->state; - yylval.s = p->name; return (p->token); } state = CMD; %%% -- Maxim Konovalov, maxim@FreeBSD.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200208281340.g7SDe3kU076928>