Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 40344 - tar ignores -o option when extracting.
Summary: tar ignores -o option when extracting.
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High major (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-03 20:57 UTC by Bob Friesenhahn
Modified: 2004-10-03 01:51 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bob Friesenhahn 2004-02-03 20:57:56 UTC
The tar command is documented to treat '-o' as if '--no-same-owner' had been specified when extracting from a tar.  Instead tar behaves as if -o was not specified at all.

An example command:

  tar -xvof myfile.tar


Reproducible: Always
Steps to Reproduce:
1.Create a tar file as the root user containing files from some other user.
2.Extract the files using 'tar -xvof myfile.tar' as a user other than root, or other than that other user.
3.The tar should extract without complaint or failure (but in fact, it reports permissions errors).

Actual Results:  
tar: valgrind-2.0.0: Cannot change ownership to uid 500, gid 100: Operation not
permitted

Expected Results:  
What it is documented to do.
Comment 1 robertc96 2004-08-07 18:29:04 UTC
The problem is most likely upstream. Informational note: The man page does not currently document the -o option well.  For more information about the recent addition of the --no-same-owner flag see this link: http://lists.gnu.org/archive/html/bug-gnu-utils/2002-06/msg00047.html

So a possible workaround for the problem is to use --no-same-owner instead of -o
Comment 2 Bob Friesenhahn 2004-08-07 18:47:49 UTC
It would be nice if it was possible to change history, but unfortunately that is impossible.  Original tar, System V tar, and GNU tar support -o options.  In order to achieve cross-platform operation, it is necessary to use -o. Using --no-same-owner only works for interactive use when the user is aware that the tar is a GNU tar which supports this option (the GNU tar on my Solaris machine is old enough to not support this option).

I agree that this bug is likely not Gentoo specific.
Comment 3 SpanKY gentoo-dev 2004-10-03 01:51:44 UTC
from manpage of tar-1.14:
       -o, --old-archive, --portability
              write a V7 format archive, rather than ANSI format