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.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Jason Vas Dias <jason.vas.dias <at> gmail.com>
Subject: bug#23285: closed (Re: bug#23285: tar lacks a 'preserve symlinks
 on extract' option)
Date: Wed, 13 Apr 2016 21:05:03 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#23285: tar lacks a 'preserve symlinks on extract' option

which was filed against the coreutils package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 23285 <at> debbugs.gnu.org.

-- 
23285: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=23285
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
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 3 (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)]
[Message part 5 (message/rfc822, inline)]
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



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

Previous Next


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