From nobody@FreeBSD.org  Mon Jul  2 04:57:13 2001
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id C178E37B407
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  2 Jul 2001 04:57:12 -0700 (PDT)
	(envelope-from nobody@FreeBSD.org)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.3/8.11.3) id f62BvCR39420;
	Mon, 2 Jul 2001 04:57:12 -0700 (PDT)
	(envelope-from nobody)
Message-Id: <200107021157.f62BvCR39420@freefall.freebsd.org>
Date: Mon, 2 Jul 2001 04:57:12 -0700 (PDT)
From: Chris Myers <chris@by-design.net>
To: freebsd-gnats-submit@FreeBSD.org
Subject: ftpd REST command does not support restarting files at >2^31 bytes (2GB)
X-Send-Pr-Version: www-1.0

>Number:         28629
>Category:       misc
>Synopsis:       ftpd REST command does not support restarting files at >2^31 bytes (2GB)
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    maxim
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jul 02 05:00:06 PDT 2001
>Closed-Date:    Mon Apr 15 08:47:50 PDT 2002
>Last-Modified:  Mon Apr 15 08:47:50 PDT 2002
>Originator:     Chris Myers
>Release:        4.3-RELEASE
>Organization:
Networks By Design
>Environment:
FreeBSD connected.by-design.net 4.3-RELEASE FreeBSD 4.3-RELEASE #0: Sat Apr 21 10:54:49 GMT 2001     jkh@narf.osd.bsdi.com:/usr/src/sys/compile/GENERIC  i386

>Description:
The restart (REST) command does not properly support large (>2GB) files.  If the restart point is greater than (2^31)-1 bytes, it will be set to (2^31)-1 and a "success" return code will be given to the FTP client program.  The result is that if a user attempts to restart an FTP at the 2GB point or higher, the file will be corrupted.
>How-To-Repeat:
telnet localhost ftp
user <username>
pass <password>
rest 3000000000
>Fix:
The restart location in ftpd.c is (correctly) an off_t (a uint_64).  In ftpcmd.y, it is a signed int.  Change the parameter to REST from type int to type string and use strtoll() to convert it to a uint_64.
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: maxim 
State-Changed-When: Thu Mar 14 08:06:01 PST 2002 
State-Changed-Why:  
Fixed in -current, libexec/ftpd/ftpcmd.y rev. 1.33. 


Responsible-Changed-From-To: freebsd-bugs->maxim 
Responsible-Changed-By: maxim 
Responsible-Changed-When: Thu Mar 14 08:06:01 PST 2002 
Responsible-Changed-Why:  


http://www.freebsd.org/cgi/query-pr.cgi?pr=28629 
State-Changed-From-To: feedback->closed 
State-Changed-By: maxim 
State-Changed-When: Mon Apr 15 08:46:06 PDT 2002 
State-Changed-Why:  
Fixed in rev. 1.33 and rev. 1.16.2.9 src/libexec/ftpd/ftpcmd.y 
in -current and -stable. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=28629 
>Unformatted:
