Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Oct 2004 17:54:29 +0400 (MSD)
From:      Oleg Koreshkov <freebsd-pr@zone.salut.ru>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        yar@FreeBSD.org
Subject:   bin/72687: [PATCH] ftpd(8) logs to /var/log/ftpd incorrect size.
Message-ID:  <200410141354.i9EDsSiH034666@ns.salut.ru>
Resent-Message-ID: <200410141400.i9EE0oSL007211@freefall.freebsd.org>

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

>Number:         72687
>Category:       bin
>Synopsis:       [PATCH] ftpd(8) logs to /var/log/ftpd incorrect size.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Oct 14 14:00:49 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Oleg Koreshkov
>Release:        any
>Organization:
none
>Environment:
		FreeBSD 4.8 i386
>Description:
		ftpd(8) logs to /var/log/ftpd full file size instead of
		number of really transferred octets.
>How-To-Repeat:
		Run ftpd(8) with -S set (log all anonymous file downloads to
		/var/run/ftpd). Start transfer of file, issue ABOR command
		or simulate disconnect. ftpd(8) will log full file size
		instead of number really transferred octets.
>Fix:
--- ftpd.c
+++ ftpd.c

@@ -1675,8 +1675,8 @@
 	time(&start);
 	send_data(fin, dout, st.st_blksize, st.st_size,
 		  restart_point == 0 && cmd == 0 && S_ISREG(st.st_mode));
-	if (cmd == 0 && guest && stats)
-		logxfer(name, st.st_size, start);
+	if (cmd == 0 && guest && stats && byte_count > 0)
+		logxfer(name, byte_count, start);
 	(void) fclose(dout);
 	data = -1;
 	pdata = -1;
>Release-Note:
>Audit-Trail:
>Unformatted:



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