From owner-freebsd-bugs Sun Mar 11 4:20: 8 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 8E81A37B71A for ; Sun, 11 Mar 2001 04:20:02 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f2BCK2904404; Sun, 11 Mar 2001 04:20:02 -0800 (PST) (envelope-from gnats) Received: from mgate04.so-net.ne.jp (mgate04.so-net.ne.jp [210.139.254.151]) by hub.freebsd.org (Postfix) with ESMTP id 45FB137B719 for ; Sun, 11 Mar 2001 04:11:49 -0800 (PST) (envelope-from ipfw@ya3.so-net.ne.jp) Received: from mail.ya3.so-net.ne.jp (mspool11.so-net.ne.jp [210.139.248.11]) by mgate04.so-net.ne.jp (8.8.8+3.0Wbeta9/3.6W01022711) with ESMTP id VAA10588 for ; Sun, 11 Mar 2001 21:11:48 +0900 (JST) Received: from localhost (p78a12f.kngwnt01.ap.so-net.ne.jp [61.120.161.47]) by mail.ya3.so-net.ne.jp (8.9.3/3.7W01022316) with ESMTP id VAA01771 for ; Sun, 11 Mar 2001 21:11:47 +0900 (JST) Message-Id: <20010311211810J.ipfw@ya3.so-net.ne.jp> Date: Sun, 11 Mar 2001 21:18:10 +0900 From: Yoshihiro Koya To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: bin/25699: ftpd doesn't count transfered data bytes Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 25699 >Category: bin >Synopsis: ftpd bug >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: Sun Mar 11 04:20:01 PST 2001 >Closed-Date: >Last-Modified: >Originator: Yoshihiro Koya >Release: FreeBSD 5.0-CURRENT i386 >Organization: Dept. of Math. Sci., Yokohama City University >Environment: System: FreeBSD current.my.domain 5.0-CURRENT FreeBSD 5.0-CURRENT #1: Sat Mar 10 15:25:02 JST 2001 root@current.my.domain:/usr/obj/usr/src/sys/current i386 The same bug can be found on 4.3-BETA maybe. >Description: /usr/libexec/ftpd doesn't count the total bytes amount of a file sent. I obtain syslog as follows: Mar 11 16:22:25 current ftpd[964]: FTP LOGIN FROM localhost as someuser Mar 11 16:22:42 current ftpd[964]: get /home/someuser/send-pr.0305 = 0 bytes Mar 11 19:43:25 current ftpd[2253]: connection from localhost (192.168.0.11) Mar 11 19:43:28 current ftpd[2253]: FTP LOGIN FROM localhost as someuser Mar 11 19:43:41 current ftpd[2253]: get /home/someuser/send-pr.0305 = 0 bytes Mar 11 19:44:13 current ftpd[2305]: connection from localhost (192.168.0.11) Mar 11 19:44:18 current ftpd[2305]: FTP LOGIN FROM localhost as someuser Mar 11 19:44:39 current ftpd[2305]: get /home/someuser/src/perl-current.tar.gz = 0 bytes I always get the 0 byte file via ftp. But, the file size isn't zero byte, of course. >How-To-Repeat: Confirm that ftpd can record log. Check /etc/inetd.conf and /etc/syslog.conf. % ftp localhost Get some files, and check the logfile recorded by ftpd. >Fix: --- /usr/src/libexec/ftpd/ftpd.c.orig Sun Mar 11 20:19:53 2001 +++ /usr/src/libexec/ftpd/ftpd.c Sun Mar 11 20:46:15 2001 @@ -1756,10 +1756,12 @@ if (!cnt) goto oldway; + byte_count = offset; goto data_err; } } + byte_count = offset; reply(226, "Transfer complete."); return; } >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message