http://www.nabble.com/Re%3A-cpio-2.9%3A-sets-unexpected-%28wrong-%29-file-owner-UID-td15689526.html

solves the Problem, but only for cpio -i, thus for the modified script:

# ./cpio-bug 
#!/bin/sh
cat cpio-bug
workdir="$PWD"
umask 077
rm -rf wrongperms newdir
mkdir -m 755 wrongperms
>wrongperms/file
#find wrongperms -depth | ./cpio -pmaud newdir
mkdir newdir
find wrongperms -depth | ./cpio -oH newc | (cd newdir && $workdir/cpio -imd)
ls -laR wrongperms
ls -laR newdir
### end of script ###
1 block
1 block
wrongperms:
total 8
drwxr-xr-x 2 root root 4096 Nov 18 14:42 .
drwx------ 8 sc   sc   4096 Nov 18 14:42 ..
-rw------- 1 root root    0 Nov 18 14:42 file
newdir:
total 12
drwx------ 3 root root 4096 Nov 18 14:42 .
drwx------ 8 sc   sc   4096 Nov 18 14:42 ..
drwxr-xr-x 2 root root 4096 Nov 18 14:42 wrongperms

newdir/wrongperms:
total 8
drwxr-xr-x 2 root root 4096 Nov 18 14:42 .
drwx------ 3 root root 4096 Nov 18 14:42 ..
-rw------- 1 root root    0 Nov 18 14:42 file

cpio -p is a separate piece of code and not corrected by the patch.

IMHO the program is not very usable in this state, because the
combination with "find ... -depth" is the standard case.



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to