From owner-freebsd-bugs Wed Jun 5 12:40:13 2002 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 18C9937B401 for ; Wed, 5 Jun 2002 12:40:02 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g55Je2I45545; Wed, 5 Jun 2002 12:40:02 -0700 (PDT) (envelope-from gnats) Received: from lurza.secnetix.de (lurza.secnetix.de [212.66.1.130]) by hub.freebsd.org (Postfix) with ESMTP id 177F737B404 for ; Wed, 5 Jun 2002 12:30:01 -0700 (PDT) Received: (from olli@localhost) by lurza.secnetix.de (8.11.6/8.11.6) id g55JTxF18891; Wed, 5 Jun 2002 21:29:59 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Message-Id: <200206051929.g55JTxF18891@lurza.secnetix.de> Date: Wed, 5 Jun 2002 21:29:59 +0200 (CEST) From: Oliver Fromme Reply-To: Oliver Fromme To: FreeBSD-gnats-submit@FreeBSD.org Cc: Oliver Fromme X-Send-Pr-Version: 3.113 Subject: bin/38928: [PATCH] ftpd(8) logs aborted transfers incorrectly Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 38928 >Category: bin >Synopsis: [PATCH] ftpd(8) logs aborted transfers incorrectly >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: Wed Jun 05 12:40:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Oliver Fromme >Release: FreeBSD 4.6-RC2 i386 >Organization: secnetix GmbH, Munich, Germany >Environment: FreeBSD 4.6-RC2 i386 >Description: When running ftpd with the -ll flags (i.e. log every transfer) and a transfer is aborted (the client user presses Ctrl-C or whatever), then the transfer size logged via syslog is always 0 bytes, no matter how much had been transferred thus far. (This might be a serious problem for sites who use the log information for service accounting or traffic statistics, which is the only reason why I made the priority of the PR "medium" instead of "low".) >How-To-Repeat: Connect an FTP client to a FreeBSD box running ftpd -ll (and syslog properly configured), initiate download of a file which is large enough, and press Ctrl-C when it's halfway through. Note that "0 bytes" will be written to the log. >Fix: --- src/libexec/ftpd/ftpd.c.orig Fri Mar 15 19:37:50 2002 +++ src/libexec/ftpd/ftpd.c Wed Jun 5 20:54:55 2002 @@ -1806,9 +1806,9 @@ while (err != -1 && filesize > 0) { err = sendfile(filefd, netfd, offset, 0, (struct sf_hdtr *) NULL, &cnt, 0); + byte_count += cnt; if (recvurg) goto got_oob; - byte_count += cnt; offset += cnt; filesize -= cnt; >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message