tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
From: "T. Horsnell \(tsh\)" <tsh@mrc-lmb.cam.ac.uk>
Subject: tar and dir attribs
Date: Thu, 22 Jan 2004 16:42:08 +0000 (GMT)	[thread overview]
Message-ID: <E1AjhuC-001ioQ-Nt@alf1.lmb.internal> (raw)

Hi all,

ES45, TU64 V5.1B PK2


I'm seeing some very odd behaviour with tar.
If I tar up a directory which has protection 1777
(rwxrwxrwxt) and then untar it into a different
place, the new directory only has protection 755.
If I repeat the operation with the new directory
already in place, its protection changes to 1777
I'm doing this logged in as (not su'd to) root.

Have I missed some subtle comment in the man pages,
or is something amis with tar? The procedure
works correctly with Gnu-tar.

The following script will demonstrate the problem:
Can anyone with the same OS version and patch level
confirm/deny what I'm seeing?

Thanks,
Terry.


#!/bin/csh
#
#####Run me as root in a scratch directory:
#make a source directory
mkdir tmp1
#
#make a test dir in that source dir with protection 1777
mkdir tmp1/test
chmod 1777 tmp1/test
#
#make a dest directory into which to untar the test dir
mkdir tmp2
#
#tar up the (empty) test dir and untar it into the source dir
tar cf - -C tmp1 . | (cd tmp2; tar xpf -)
#
#list the source and dest dirs
#note the wrong protection on /tmp2/test
ls -l tmp1
ls -l tmp2
#
#leave the test dir in place and repeat the operation.
#note the different (correct) protection on tmp2/dest
tar cf - -C tmp1 . | (cd tmp2; tar xpf -)
ls -l tmp1
ls -l tmp2
#
#remove the test dir
rmdir tmp2/test



                 reply	other threads:[~2004-01-22 16:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox