Bug 114580

Summary: cpio -oH ustar (or tar) saves bad mtime date after Jan 10 2004
Product: [Retired] Red Hat Linux Reporter: Need Real Name <bill.godfrey>
Component: cpioAssignee: Peter Vrabec <pvrabec>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 9CC: mitr
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-11-08 15:53:51 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Need Real Name 2004-01-29 18:43:15 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET 
CLR 1.1.4322)

Description of problem:
When cpio creates a tar file via -H ustar or -H tar, files with dates 
after January 10 2004 at 13:37:03 UTC are archived with an incorrect 
mtime of January 1970 (i.e. 34 yrs and 10 days earlier than the 
correct date), and will be restored with that incorrect mtime whether 
restored by cpio or tar. The special thing about that date and time 
is that in octal the mtime value is 7777777777. After that, an 11th 
octal digit is needed, but cpio is only storing the rightmost 10 
octal digits in the tar file mtime field. The problem has also been 
found in earlier versions of Red Hat Linux (7.3, 6.1).

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

How reproducible:
Always

Steps to Reproduce:
1.echo hello >/tmp/hello
2.touch -t 200401111200 /tmp/hello
3.echo /tmp/hello | cpio -oH ustar | cpio -itv
Try the same thing with a touch -t 200401091200 or any other date 
before January 10 2004 at 13:37:04 UTC and it works.

Actual Results:  -rw-r--r--   1 root     root            6 Jan  1  
1970 /tmp/hello

Expected Results:  -rw-r--r--   1 root     root            6 Jan  11  
12:00 /tmp/hello

Additional info:

Comment 1 Need Real Name 2004-02-02 16:30:59 UTC
See also suggested patch at:
http://mail.gnu.org/archive/html/bug-cpio/2004-01/msg00007.html
and next in thread:
http://mail.gnu.org/archive/html/bug-cpio/2004-01/msg00008.html