Bug 28629

Summary: ftpd REST command does not support restarting files at >2^31 bytes (2GB)
Product: Base System Reporter: Chris Myers <chris>
Component: miscAssignee: Maxim Konovalov <maxim>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.3-RELEASE   
Hardware: Any   
OS: Any   

Description Chris Myers 2001-07-02 13:00:06 UTC
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.

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.
How-To-Repeat: telnet localhost ftp
user <username>
pass <password>
rest 3000000000
Comment 1 Maxim Konovalov freebsd_committer freebsd_triage 2002-03-14 16:06:01 UTC
State Changed
From-To: open->feedback

Fixed in -current, libexec/ftpd/ftpcmd.y rev. 1.33. 


Comment 2 Maxim Konovalov freebsd_committer freebsd_triage 2002-03-14 16:06:01 UTC
Responsible Changed
From-To: freebsd-bugs->maxim
Comment 3 Maxim Konovalov freebsd_committer freebsd_triage 2002-04-15 16:46:06 UTC
State Changed
From-To: feedback->closed

Fixed in rev. 1.33 and rev. 1.16.2.9 src/libexec/ftpd/ftpcmd.y 
in -current and -stable. Thanks!