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:
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
Created attachment 118990 [details] patch to fix this problem https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=114580 http://lists.gnu.org/archive/html/bug-cpio/2004-01/msg00007.html
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