From owner-freebsd-bugs@FreeBSD.ORG Thu Oct 14 14:00:50 2004 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 EFF7216A4CE for ; Thu, 14 Oct 2004 14:00:50 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id C6BF143D2F for ; Thu, 14 Oct 2004 14:00:50 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.11/8.12.11) with ESMTP id i9EE0o9P007212 for ; Thu, 14 Oct 2004 14:00:50 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i9EE0oSL007211; Thu, 14 Oct 2004 14:00:50 GMT (envelope-from gnats) Resent-Date: Thu, 14 Oct 2004 14:00:50 GMT Resent-Message-Id: <200410141400.i9EE0oSL007211@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, Oleg Koreshkov Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5C77516A4CE; Thu, 14 Oct 2004 13:54:32 +0000 (GMT) Received: from ns.salut.ru (ns.salut.ru [194.67.150.71]) by mx1.FreeBSD.org (Postfix) with ESMTP id 86D0443D1D; Thu, 14 Oct 2004 13:54:31 +0000 (GMT) (envelope-from okor@ns.salut.ru) Received: from ns.salut.ru (ns.salut.ru [194.67.150.71] (may be forged)) by ns.salut.ru (8.12.11/8.12.11) with ESMTP id i9EDsUiB034668; Thu, 14 Oct 2004 17:54:30 +0400 (MSD) (envelope-from okor@ns.salut.ru) Received: (from okor@localhost) by ns.salut.ru (8.12.11/8.12.11/Submit) id i9EDsSiH034666; Thu, 14 Oct 2004 17:54:29 +0400 (MSD) (envelope-from okor) Message-Id: <200410141354.i9EDsSiH034666@ns.salut.ru> Date: Thu, 14 Oct 2004 17:54:29 +0400 (MSD) From: Oleg Koreshkov To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 cc: yar@FreeBSD.org Subject: bin/72687: [PATCH] ftpd(8) logs to /var/log/ftpd incorrect size. X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Oleg Koreshkov List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2004 14:00:51 -0000 >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: