GNU bug report logs - #23285
tar lacks a 'preserve symlinks on extract' option

Previous Next

Package: coreutils;

Reported by: Jason Vas Dias <jason.vas.dias <at> gmail.com>

Date: Wed, 13 Apr 2016 21:00:02 UTC

Severity: normal

Tags: notabug

Done: Eric Blake <eblake <at> redhat.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 23285 in the body.
You can then email your comments to 23285 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#23285; Package coreutils. (Wed, 13 Apr 2016 21:00:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jason Vas Dias <jason.vas.dias <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Wed, 13 Apr 2016 21:00:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jason Vas Dias <jason.vas.dias <at> gmail.com>
To: bug-coreutils <at> gnu.org
Subject: tar lacks a 'preserve symlinks on extract' option
Date: Wed, 13 Apr 2016 21:58:56 +0100
There appears to be no way of telling tar
not to replace a destination symlink with a directory ,
in this scenario :

$ cd /tmp
$ mkdir d s t
$ ln -s ../t d/t
$ mkdir s/t
$ touch s/t/f
$ (cd s; tar -cpf - .) | (cd d; tar -xpf -)
$ ls -R d
  d:
t

d/t:
f

On extraction, tar has replaced the symlink d/t with a directory d/t .

I think there should be a way of getting tar to follow and preserve
such symlinks on extraction .

The manual page :
http://www.gnu.org/software/tar/manual/html_node/Dealing-with-Old-Files.html
states:
" When extracting files, if tar discovers that the extracted file
already exists, it
  normally replaces the file by removing it before extracting it, to
prevent confusi
 on in the presence of hard or symbolic links. (If the existing file
is a symbolic link,
 it is removed, not followed.)
" ...
"To be more aggressive about altering existing files, use the
`--overwrite' option.
 It causes tar to overwrite existing files and to follow existing
symbolic links when
 extracting.
"

But the --overwrite option does not prevent tar from removing symlinks in
the above scenario !

Morever, despite adding -v / --verbose, tar does not say anything about
removing such symlinks - I think it should.

Please, either make the --overwrite option follow & preserve symlinks
on extraction, or provide a --preserve-symlinks-on-extract option or
something
like it .
This problem prevents administrators from maintaining symlinks on systems
which might be updated with tar .

Is it likely that GNU tar will ever support this in future or or do I
have to develop
a patch to make it preserve symlinks on extraction  ?

Thanks & Regards,
Jason




Added tag(s) notabug. Request was from Eric Blake <eblake <at> redhat.com> to control <at> debbugs.gnu.org. (Wed, 13 Apr 2016 21:05:02 GMT) Full text and rfc822 format available.

Reply sent to Eric Blake <eblake <at> redhat.com>:
You have taken responsibility. (Wed, 13 Apr 2016 21:05:03 GMT) Full text and rfc822 format available.

Notification sent to Jason Vas Dias <jason.vas.dias <at> gmail.com>:
bug acknowledged by developer. (Wed, 13 Apr 2016 21:05:03 GMT) Full text and rfc822 format available.

Message #12 received at 23285-done <at> debbugs.gnu.org (full text, mbox):

From: Eric Blake <eblake <at> redhat.com>
To: Jason Vas Dias <jason.vas.dias <at> gmail.com>, 23285-done <at> debbugs.gnu.org
Subject: Re: bug#23285: tar lacks a 'preserve symlinks on extract' option
Date: Wed, 13 Apr 2016 15:04:30 -0600
[Message part 1 (text/plain, inline)]
tag 23285 notabug
thanks

On 04/13/2016 02:58 PM, Jason Vas Dias wrote:
> There appears to be no way of telling tar
> not to replace a destination symlink with a directory ,
> in this scenario :

Thanks for the report.  However, you've reached the coreutils list,
which does not include tar; and tar does not (yet?) use the
debbugs.gnu.org bug tracker, so we can't reassign your bug.  The best we
can do is close this bug (as it is not a coreutils problem) and tell you
to resend your mail to bug-tar <at> gnu.org, as directed by 'tar --help'.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

[signature.asc (application/pgp-signature, attachment)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 12 May 2016 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 98 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.