Not really sure if this is a bug or not, but if cpio creates a directory
that is not specified by itself on a line from standard input, it creates
the directory with 700, i.e. rwx------, permissions.

--------------- example ---------------------

mkdir foo
cd foo

mkdir ../bar

mkdir testdir
touch testdir/testfile

# THIS WORKS FINE

echo -e "testdir\ntestdir/testfile" | cpio -pvdum ../bar
ls -lR ../bar

# THE OUTPUT FROM THE ABOVE COMMAND INDICATES CPIO IS WORKING OK HERE:
#
# ../bar:
# total 1
# drwxrwxr-x    2 hnine    hnine        1024 Mar 17 16:23 testdir
#
# ../bar/testdir:
# total 0
# -rw-rw-r--    1 hnine    hnine           0 Mar 17 16:17 testfile


# SETUP FOR NEXT CASE (THE ONE THAT INDICATES A POTENTIAL BUG

rm -r ../bar
mkdir ../bar


# THIS ISN'T WORKING RIGHT (?)

echo -e "testdir/testfile" | cpio -pvdum ../bar
ls -lR ../bar

# THE OUTPUT FROM THE ABOVE COMMAND INDICATES A PROBLEM -- CPIO IS GIVING 
# THE ../bar/testdir DIRECTORY THE PERMISSIONS 700 (rwx------).  THE ONLY
# DIFFERENCE IS IN THE "echo" COMMAND FEEDING CPIO THE NAMES OF THE FILES
# TO COPY, THE "testdir" DIRECTORY ISN'T EXPLICITLY ON A LINE BY ITSELF:
#
# ../bar:
# total 1
# drwx------    2 hnine    hnine        1024 Mar 17 16:28 testdir
#
# ../bar/testdir:
# total 0
# -rw-rw-r--    1 hnine    hnine           0 Mar 17 16:17 testfile


----------------- end example -------------------


-- Harmon


---------------------------
Dr. Harmon S. Nine
Netarx, Inc.

30910 Telegraph Road
Bingham Farms, MI 48025

PH.  (248)647-9800
FX.  (248)647-9840

Reply via email to