Description of problem: cpio -i does not restaure the owner of directories if archive are created with "find ... -depth ... | cpio -o" Version-Release number of selected component (if applicable): cpio-2.9-5.fc8 Exemple : [root@one test]# mkdir -p test/test [root@one test]# touch test/file test/test/file [root@one test]# chown -R apache:apache test [root@one test]# find test -print0 | xargs -0 ls -l -d drwxr-xr-x 3 apache apache 4096 jan 30 01:47 test -rw-r--r-- 1 apache apache 0 jan 30 01:47 test/file drwxr-xr-x 2 apache apache 4096 jan 30 01:47 test/test -rw-r--r-- 1 apache apache 0 jan 30 01:47 test/test/file [root@one test]# find test -depth -print0 | cpio -ov --null --format=newc -a > test.cpio test/test/file test/test test/file test 2 blocks [root@one test]# rm -r -f test [root@one test]# cpio -iv -m -d < test.cpio test/test/file test/test test/file test 2 blocks [root@one test]# find test -print0 | xargs -0 ls -l -d drwxr-xr-x 3 root root 4096 jan 30 01:47 test -rw-r--r-- 1 apache apache 0 jan 30 01:47 test/file drwxr-xr-x 2 root root 4096 jan 30 01:47 test/test -rw-r--r-- 1 apache apache 0 jan 30 01:47 test/test/file [root@one test]# Additional info: Work fine if "find -depth" is not used.
It seems it's a serious security issue : [root@one test]# mkdir -p test/test [root@one test]# chown -R apache:apache test [root@one test]# chmod -R 700 test [root@one test]# find test -depth -print0 | cpio -pv --null -a -m -d tmp tmp/test/test tmp/test 0 blocks [root@one test]# find tmp/ -print0 | xargs -0 ls -l -d drwxr-xr-x 3 root root 4096 jan 30 02:15 tmp/ drwxr-xr-x 3 root root 4096 jan 30 02:15 tmp/test drwx------ 2 apache apache 4096 jan 30 02:15 tmp/test/test [root@one test]# tmp/test has 755 mode ! Should be 700.
Seems to be an old bug (30 Oct 2007): http://lists.gnu.org/archive/html/bug-cpio/2007-10/msg00001.html Is cpio supported by Fedora/Red Hat ? If not, Fedora should remove the cpio package.
Hi, thanks for the report. I can reproduce the bug, it appeared in upstream cpio 2.9 and cpio 2.8 seems to be OK. Trying to find the change which causes this regression...
cpio-2.9-6.fc8 has been submitted as an update for Fedora 8
cpio-2.9-6.fc8 has been pushed to the Fedora 8 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update cpio'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F8/FEDORA-2008-1894
Bug in #c1 not fixed. Exemple : [root@one tmp]# rpm -q --queryformat "%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n" cpio cpio-2.9-6.fc8.x86_64 [root@one tmp]# mkdir -p test/test [root@one tmp]# chown -R apache:apache test [root@one tmp]# chmod -R 700 test [root@one tmp]# find test -depth -print0 | cpio -pv --null -a -m -d tmp tmp/test/test tmp/test 0 blocks [root@one tmp]# find tmp/ -print0 | xargs -0 ls -l -d drwxr-xr-x 3 root root 4096 fév 22 07:30 tmp/ drwxr-xr-x 3 root root 4096 fév 22 07:30 tmp/test <=== drwx------ 2 apache apache 4096 fév 22 07:30 tmp/test/test [root@one tmp]# rm -r -f * [root@one tmp]# mkdir -p test/test [root@one tmp]# chown -R apache:apache test [root@one tmp]# find test -print0 | cpio -pv --null -a -m -d tmp tmp/test tmp/test/test 0 blocks [root@one tmp]# find tmp/ -print0 | xargs -0 ls -l -d drwxr-xr-x 3 root root 4096 fév 22 07:30 tmp/ drwxr-xr-x 3 apache apache 4096 fév 22 07:30 tmp/test <=== drwxr-xr-x 2 apache apache 4096 fév 22 07:30 tmp/test/test [root@one tmp]# Should I change the bug status to FAILS_QA ?
Yes, thanks for noticing. It seems I fixed just copyin mode, not copypass... Will look on it little more.
cpio-2.9-7.fc8 has been submitted as an update for Fedora 8
Ok, I reverted some bad-behaving code to cpio 2.8 state. This bug should be resolved completely now.
cpio-2.9-7.fc8 has been pushed to the Fedora 8 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update cpio'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F8/FEDORA-2008-2211
Seems OK. Well done. Tested with cpio-2.9-7.fc8.x86_64.
cpio-2.9-7.fc8 has been pushed to the Fedora 8 stable repository. If problems still persist, please make note of it in this bug report.