From owner-freebsd-bugs@FreeBSD.ORG Fri Nov 28 15:30:35 2003 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9B71D16A4CE for ; Fri, 28 Nov 2003 15:30:35 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3C0AF43FE9 for ; Fri, 28 Nov 2003 15:30:23 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id hASNUMFY048277 for ; Fri, 28 Nov 2003 15:30:22 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id hASNUMOn048276; Fri, 28 Nov 2003 15:30:22 -0800 (PST) (envelope-from gnats) Resent-Date: Fri, 28 Nov 2003 15:30:22 -0800 (PST) Resent-Message-Id: <200311282330.hASNUMOn048276@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Nick Leuta Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A211516A4D1 for ; Fri, 28 Nov 2003 15:23:30 -0800 (PST) Received: from falcon.lipetsk.ru (falcon.lipetsk.ru [195.34.224.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7054043FB1 for ; Fri, 28 Nov 2003 15:23:29 -0800 (PST) (envelope-from skynick@stu.lipetsk.ru) Received: from lstu by falcon.lipetsk.ru with UUCP id ; Sat, 29 Nov 2003 02:23:06 +0300 Received: from chuck2.lstu (chuck2.lstu [192.168.15.7]) by maverick.stu.int (8.9.3/8.8.5) with ESMTP id CAA22985 +0300 (MSK) Received: by chuck2.lstu (Postfix, from userid 1000) id 3122D49A29; Sat, 29 Nov 2003 02:24:15 +0300 (MSK) Message-Id: <20031128232415.3122D49A29@chuck2.lstu> Date: Sat, 29 Nov 2003 02:24:15 +0300 (MSK) From: Nick Leuta To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/59775: ftpd(8)/FreeBSD 5: incorrect reply for "unimplemented" SITE command X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Nick Leuta List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Nov 2003 23:30:35 -0000 X-List-Received-Date: Fri, 28 Nov 2003 23:30:35 -0000 >Number: 59775 >Category: bin >Synopsis: ftpd(8)/FreeBSD 5: incorrect reply for "unimplemented" SITE command >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Nov 28 15:30:21 PST 2003 >Closed-Date: >Last-Modified: >Originator: Nick Leuta >Release: FreeBSD 4.9-RC i386 >Organization: Lipetsk State Technical University >Environment: System: FreeBSD skynick.stu.lipetsk.ru 4.9-RC FreeBSD 4.9-RC #0: Sun Nov 23 19:53:55 MSK 2003 root@skynick.stu.lipetsk.ru:/usr/src/sys/compile/CORSAIR i386 >Description: An unimplemented FTP command is marked by '*' symbol and an attempt to use it returns something like "502 ACCT command not implemented." It's also possible to mark any SITE command as "unimplemented", and it also will be marked by '*'... But an attempt to use such command leads to the significantly different reply like "500 'SITE MD5 xxx': command not understood.". Both situations are handled by the similar ways, and the difference is that unimplemented command matches to "| NOTIMPL", but unimplemented SITE command matches to "| SITE SP NOTIMPL"... p.s. I think that the better way is not to show unimplemented commands at all, but if the mentioned above way is selected, it must be implemented completely... >How-To-Repeat: 1. modify sitetab[] like this: --- ftpcmd.y.ORI Tue Feb 11 17:28:28 2003 +++ ftpcmd.y Fri Nov 28 19:57:09 2003 @@ -1149,7 +1149,7 @@ }; struct tab sitetab[] = { - { "MD5", MDFIVE, STR1, 1, "[ file-name ]" }, + { "MD5", MDFIVE, STR1, 0, "[ file-name ]" }, { "UMASK", UMASK, ARGS, 1, "[ umask ]" }, { "IDLE", IDLE, ARGS, 1, "[ maximum-idle-time ]" }, { "CHMOD", CHMOD, NSTR, 1, " mode file-name" }, 2. recompile and install ftpd... 3. run ftp(1), connect to server as the non-anonymous user... 4. enter the command like "site md5 xxx" >Fix: diff -urN ftpd.ORI/ftpcmd.y ftpd/ftpcmd.y --- ftpd.ORI/ftpcmd.y Sun Oct 26 07:30:05 2003 +++ ftpd/ftpcmd.y Thu Nov 27 01:54:13 2003 @@ -756,6 +756,12 @@ { nack($1); } + | SITE SP NOTIMPL + { + char buf[64]; + snprintf(buf, sizeof(buf), "SITE %s", $3); + nack(buf); + } | error { yyclearin; /* discard lookahead data */ >Release-Note: >Audit-Trail: >Unformatted: