From owner-freebsd-ports-bugs@FreeBSD.ORG Fri Apr 27 22:10:10 2012 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6F291065670 for ; Fri, 27 Apr 2012 22:10:10 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 7E83B8FC12 for ; Fri, 27 Apr 2012 22:10:10 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q3RMAApj050159 for ; Fri, 27 Apr 2012 22:10:10 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q3RMAA1n050158; Fri, 27 Apr 2012 22:10:10 GMT (envelope-from gnats) Resent-Date: Fri, 27 Apr 2012 22:10:10 GMT Resent-Message-Id: <201204272210.q3RMAA1n050158@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Daniel Becker Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CDE5A106564A for ; Fri, 27 Apr 2012 22:00:51 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 9F9EB8FC1D for ; Fri, 27 Apr 2012 22:00:51 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q3RM0p5n033824 for ; Fri, 27 Apr 2012 22:00:51 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id q3RM0pRA033823; Fri, 27 Apr 2012 22:00:51 GMT (envelope-from nobody) Message-Id: <201204272200.q3RM0pRA033823@red.freebsd.org> Date: Fri, 27 Apr 2012 22:00:51 GMT From: Daniel Becker To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: ports/167380: updated netatalk 2.2.2 breaks file transfers due to incorrect use of sendfile X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2012 22:10:10 -0000 >Number: 167380 >Category: ports >Synopsis: updated netatalk 2.2.2 breaks file transfers due to incorrect use of sendfile >Confidential: no >Severity: critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Apr 27 22:10:10 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Daniel Becker >Release: 9.0-RELEASE >Organization: >Environment: FreeBSD razzems.Stanford.EDU 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan 3 07:46:30 UTC 2012 root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64 >Description: After the recent update to version 2.2.2, all file transfers that use sendfile return corrupt data and/or terminate the connection. This appears to be a known issue in 2.2.2 that is caused by improper use of FreeBSD's sendfile; it was fixed upstream on Feb 9: This will apparently be rolled into 2.2.3 upstream; however, since 2.2.2 in its current state for all intents and purposes does not work on FreeBSD, please consider integrating the linked patch into the FreeBSD port. >How-To-Repeat: Read any file larger than a few kilobytes from a Netatalk share. >Fix: Backport patch from upstream: Patch attached with submission follows: >From d24a954821229e8835acb6d629ef1f09a4441e8b Mon Sep 17 00:00:00 2001 From: Frank Lahm Date: Thu, 9 Feb 2012 15:39:08 +0100 Subject: [PATCH] Fix broken sendfile on FreeBSD, from Denis Ahrens --- NEWS | 1 + libatalk/adouble/ad_sendfile.c | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletions(-) diff --git a/NEWS b/NEWS index 2ad321a..88d44f7 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,7 @@ Changes in 2.2.3 * UPD: based on Unicode 6.1.0 * UPD: experimental systemd service files: always run both afpd and cnid_metad * UPD: afpd: Ensure our umask is not altered by eg pam_umask +* FIX: afpd: sendfile() on FreeBSD was broken, courtesy of Denis Ahrens Changes in 2.2.2 ================ diff --git a/libatalk/adouble/ad_sendfile.c b/libatalk/adouble/ad_sendfile.c index aabb61c..0e7b278 100644 --- a/libatalk/adouble/ad_sendfile.c +++ b/libatalk/adouble/ad_sendfile.c @@ -67,7 +67,16 @@ ssize_t sys_sendfile(int tofd, int fromfd, off_t *offset, size_t count) #include ssize_t sys_sendfile(int tofd, int fromfd, off_t *offset, size_t count) { - return sendfile(fromfd, tofd, *offset, count, NULL, offset, 0); + off_t len; + int ret; + + ret = sendfile(fromfd, tofd, *offset, count, NULL, &len, 0); + + *offset += len; + + if (ret != 0) + return -1; + return len; } #else -- 1.7.4.1 >Release-Note: >Audit-Trail: >Unformatted: