Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Mar 2001 21:18:10 +0900
From:      Yoshihiro Koya <Yoshihiro.Koya@math.yokohama-cu.ac.jp>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/25699: ftpd doesn't count transfered data bytes
Message-ID:  <20010311211810J.ipfw@ya3.so-net.ne.jp>

next in thread | raw e-mail | index | archive | help

>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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010311211810J.ipfw>