Bug 168401 - cpio -o -H ustar munges file modification times in created archive
Summary: cpio -o -H ustar munges file modification times in created archive
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: cpio
Version: 4.0
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Peter Vrabec
QA Contact: Brock Organ
URL:
Whiteboard:
Depends On:
Blocks: 187538
TreeView+ depends on / blocked
 
Reported: 2005-09-15 18:59 UTC by DriveCam Video Systems
Modified: 2007-11-30 22:07 UTC (History)
0 users

Fixed In Version: RHBA-2006-0305
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-04-19 18:59:44 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
patch to fix this problem (412 bytes, patch)
2005-09-19 15:03 UTC, Peter Vrabec
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2006:0305 0 normal SHIPPED_LIVE cpio bug fix update 2006-04-19 04:00:00 UTC

Description DriveCam Video Systems 2005-09-15 18:59:05 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.10) Gecko/20050909 Red Hat/1.0.6-1.4.2 Firefox/1.0.6

Description of problem:
When I create an archive using "cpio -o -H ustar", the file modification times stored in the archive are incorrect.

Version-Release number of selected component (if applicable):
cpio-2.5-8.RHEL4

How reproducible:
Always

Steps to Reproduce:
Case 1:  touch test ; ls -l test ; echo "test" | cpio -o -H ustar > test.tar ; rm test ; cpio -i -m < test.tar ; ls -l test ; rm test test.tar

File modification times are incorrect.

Case 2:  touch test ; ls -l test ; echo "test" | cpio -o -H ustar > test.tar ; rm test ; tar -xf test.tar ; ls -l test ; rm test test.tar

File modification times are incorrect.

Case 3:  touch test ; ls -l test ; tar -cf test.tar test ; rm test ; cpio -i -m < test.tar ; ls -l test ; rm test test.tar

File modification times are correct.

Case 4:  touch test ; ls -l test ; tar -cf test.tar test ; rm test ; tar -xf test.tar ; ls -l test ; rm test test.tar

File modification times are correct.


The common thread across all cases is that when the archive is created with cpio, the times are wrong, but when the archive is created with tar, they are correct.

Actual Results:  Cases 1 and 2 produce:

-rw-rw-r--  1 chaz chaz 0 Sep 15 11:38 test
-rw-rw-r--  1 chaz chaz 0 Sep  6  1971 test

The second file time is clearly wrong.

Cases 3 and 4 produce the expected result, below.

Expected Results:  All cases should produce:

-rw-rw-r--  1 chaz chaz 0 Sep 15 11:39 test
-rw-rw-r--  1 chaz chaz 0 Sep 15 11:39 test

where the two times listed are identical.

Additional info:

Comment 1 DriveCam Video Systems 2005-09-16 03:05:00 UTC
Found a record of an apparently identical bug in the Debian bug report logs. 
Looks like they've released a fix.  Might be a good starting point.

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=238177



Comment 12 Red Hat Bugzilla 2006-04-19 18:59:44 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2006-0305.html



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