Bug 28820 - tar and cpio cannot deal with files > 2GB
Summary: tar and cpio cannot deal with files > 2GB
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 4.3-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-07-08 17:10 UTC by andrew
Modified: 2002-06-02 01:39 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description andrew 2001-07-08 17:10:01 UTC
When attempting to tar a larger than 2GB file, tar immediately returns, having created 10240 byte file.
tar tvf file.tar reveals that file size is inidcated as negative!

Fix: 

Probably 32bit integers used inside tar & cpio when calculating filesizes.
How-To-Repeat: Create >2gb file
tar cvf file.tar 2gbfile.data
tar tvf file.tar
Comment 1 Andrew Webster 2001-08-05 03:47:45 UTC
I have investigated TAR code in create.c.
Problem is that counter is a 32 bit long (save_totsize) see line 198.
Should be of type off_t to deal with numbers > 2,147,483,647

Probably similar problem with cpio.

--
  Andrew
Comment 2 Matt Jacob freebsd_committer freebsd_triage 2001-10-02 05:52:52 UTC
Responsible Changed
From-To: freebsd-bugs->mjacob

I'll take it.
Comment 3 Matt Jacob freebsd_committer freebsd_triage 2001-10-21 02:34:17 UTC
Responsible Changed
From-To: mjacob->freebsd-bugs

give back to whomever has more time to do the actual right thing
Comment 4 perisa 2002-05-29 01:35:38 UTC
Please close this PR. It is better described at

http://www.freebsd.org/cgi/query-pr.cgi?pr=gnu/24903

Thanks

Marc
Comment 5 Crist J. Clark freebsd_committer freebsd_triage 2002-06-02 01:37:58 UTC
State Changed
From-To: open->closed

Several other PRs deal with this same problem, e.g. 24903.