Bug 168401 - cpio -o -H ustar munges file modification times in created archive
cpio -o -H ustar munges file modification times in created archive
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: cpio (Show other bugs)
4.0
x86_64 Linux
medium Severity medium
: ---
: ---
Assigned To: Peter Vrabec
Brock Organ
:
Depends On:
Blocks: 187538
  Show dependency treegraph
 
Reported: 2005-09-15 14:59 EDT by DriveCam Video Systems
Modified: 2007-11-30 17:07 EST (History)
0 users

See Also:
Fixed In Version: RHBA-2006-0305
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-04-19 14:59:44 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description DriveCam Video Systems 2005-09-15 14:59:05 EDT
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-15 23:05:00 EDT
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 14:59:44 EDT
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.