Bug 538 - tar does not preserve symlink owner.group upon extraction
Summary: tar does not preserve symlink owner.group upon extraction
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: tar
Version: 4.2
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Preston Brown
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 1998-12-19 06:27 UTC by jve
Modified: 2008-05-01 15:37 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 1999-03-22 17:34:12 UTC

Attachments (Terms of Use)

Description jve 1998-12-19 06:27:07 UTC
When running as root, tar will properly set the owner and
group of extracted directories and files.  However, for
symlinks, it uses root.root.  The chown and chgrp commands
do operate on the symlink, itself, and not its target, so
it is possible to set the ownership properly.  The symlink
owner.group info *is* in the tar archive, so that's not the

Comment 1 Preston Brown 1999-03-22 17:33:59 UTC
linux versions prior to 2.1.86 didn't include the lchown syscall,
which allowed changing ownership of a symlink itself, instead of the
file it points to.  While it may have looked like the ownership was
changed, the behaviour was undefined.

GNU tar doesn't handle symlink ownership well.  however, it does
support lchown.  In Red Hat Linux 6.0, which will ship with kernel
2.2.x, this means that ownership of symlinks is correctly handled.

Comment 2 Preston Brown 1999-03-22 17:34:59 UTC
for more information, please see tar's README file.

Note You need to log in before you can comment on or make changes to this bug.