It like we may have a bug in tar that ships with Centos.
It looks like -o is mapped to --same-owner.
Some basic info....
uname -a
Linux jazzy 2.6.9-34.0.1.ELsmp #1 SMP Wed May 24 08:14:29 CDT 2006
i686 i686 i386 GNU/Linux
cat /etc/redhat-release
CentOS release 4.3 (Final)
% /bin/tar --version
tar (GNU tar) 1.14
--same-owner try extracting files with the same ownership
--no-same-owner extract files as yourself
Compatibility options:
-o when creating, same as --old-archive
when extracting, same as --no-same-owner
and Now a test!
#goto tmp dir
cd /tmp
#become root
su - root
#create three test files
touch afile bfile cfile
#verify ownership
ls -l
total 0
-rw-r--r-- 1 root root 0 Jun 26 11:16 afile
-rw-r--r-- 1 root root 0 Jun 26 11:16 bfile
-rw-r--r-- 1 root root 0 Jun 26 11:16 cfile
#create a tar archive
tar zcvf testoh.tgz afile bfile cfil
#become regular user
tar -zxof testoh.tgz
tar: afile: Cannot change ownership to uid 0, gid 0: Operation not ermitted
tar: bfile: Cannot change ownership to uid 0, gid 0: Operation not ermitted
tar: cfile: Cannot change ownership to uid 0, gid 0: Operation not ermitted
tar: Error exit delayed from previous errors
This error should not happen!
tar --no-same-owner -zxf testoh.tgz
jazzy 328 % ls -l
total 4
-rw------- 1 paulg tech 0 Jun 26 11:16 afile
-rw------- 1 paulg tech 0 Jun 26 11:16 bfile
-rw------- 1 paulg tech 0 Jun 26 11:16 cfile
-rw-r--r-- 1 root root 125 Jun 26 11:17 testoh.tgz
This works but according to the manpages -o should also work!
It looks like -o is mapped to --same-owner
jazzy 329 % tar --same-owner -zxf testoh.tgz
tar: afile: Cannot change ownership to uid 0, gid 0: Operation not ermitted
tar: bfile: Cannot change ownership to uid 0, gid 0: Operation not ermitted
tar: cfile: Cannot change ownership to uid 0, gid 0: Operation not ermitted
tar: Error exit delayed from previous errors
Thanks
Paul
Paul Griffith wrote:> % /bin/tar --version > tar (GNU tar) 1.14 > > --same-owner try extracting files with the same ownership > --no-same-owner extract files as yourself > > Compatibility options: > -o when creating, same as --old-archive > when extracting, same as --no-same-ownerThe info page tells something different: `-o' When creating -- `--no-same-owner', when extracting -- `--portability'. The later usage is deprecated. It is retained for compatibility with the earlier versions of GNU `tar'. In the future releases `-o' will be equivalent to `--no-same-owner' only. The manual page says: -o, --old-archive, --portability write a V7 format archive, rather than ANSI format So yes, there is a bug somewhere, but I'm not really sure, where it is. I'd file it as a documentation bug inside of tar. Ralph -- Ralph Angenendt......ra at br-online.de | .."Text processing has made it possible Bayerischer Rundfunk...80300 M?nchen | ....to right-justify any idea, even one Programmbereich.Bayern 3, Jugend und | .which cannot be justified on any other Multimedia.........Tl:089.5900.16023 | ..........grounds." -- J. Finnegan, USC -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available URL: <http://lists.centos.org/pipermail/centos/attachments/20060626/c89409b5/attachment-0002.sig>
Apparently Analagous Threads
- rpc command function failed! (NT_STATUS_ACCESS_DENIED) trying to grant privileges - 3.0.23a
- NT_STATUS_ACCESS_DENIED on a directory I have permission to access
- NT_STATUS_ACCESS_DENIED on a directory I have permission to access
- problem with non-allocatable register classes
- OCI8::Cursor (Name Error) in HP-UX 11.11 error