Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 67362 - rcp doesn't work with large files
Summary: rcp doesn't work with large files
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: rsh
Version: 7.3
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Phil Knirsch
QA Contact: Ben Levenson
URL:
Whiteboard:
: 87860 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-06-23 15:55 UTC by Need Real Name
Modified: 2015-03-05 01:10 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2003-01-17 16:38:53 UTC


Attachments (Terms of Use)
Fix rcp with filesizes > 2GB (deleted)
2003-01-17 14:33 UTC, Panu Matilainen
no flags Details | Diff

Description Need Real Name 2002-06-23 15:55:05 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 4.0)

Description of problem:
rcp, as derived from the netkit-rsh-0.17 source in Red Hat 7.x, doesn't handle 
files larger than 2GB.  There are two types of failure:

- an existing large file can't be opened by rcp (the open() call fails with 
EFBIG)

- trying to write a file on a Red Hat system that the remote side claims is 
larger than 2GB will result in the size variable in sink(), which is declared 
as an int, not to reflect the actual size of the file (it might be negative, or 
it might be filesize%4GB, because of the overflow) and the copy will be aborted 
prematurely after the Red Hat system's rcp believes it has read in the correct 
number of bytes.

Fix:
more recent versions of freebsd's rcp fix the C code.  The snprintf expression 
involving stb.st_size should cast it to (long long) and use %lld instead of %
ld.  size should be declared as off_t rather than int.  And appropriate CFLAGS 
should be defined in the Makefile so that 64-bit versions of off_t, open(), and 
stat() get used; I happened to fix this by adding "CFLAGS += -
D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" to the Makefile.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. rcp largefile remote:destfile
2. (from another system whose rcp supports large files) rcp largefile 
redhatsystem:destfile
3.
	

Additional info:

Comment 1 Panu Matilainen 2003-01-17 14:32:03 UTC
This is still present in phoebe/rawhide and RHL 8.0 as well. Adding this to the
MCONFIG-editing part and patching it as described by mp above fixes it for me:

s,-O2,\$(RPM_OPT_FLAGS) -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
-D_FILE_OFFSET_BITS=64,;

Comment 2 Panu Matilainen 2003-01-17 14:33:25 UTC
Created attachment 89423 [details]
Fix rcp with filesizes > 2GB

Comment 3 Phil Knirsch 2003-01-17 16:38:53 UTC
Fixed in rsh-0.17-13 (available via rawhide shortly).

Read ya, Phil

Comment 4 Phil Knirsch 2003-06-25 15:04:34 UTC
*** Bug 87860 has been marked as a duplicate of this bug. ***


Note You need to log in before you can comment on or make changes to this bug.