From unknown Sun Aug 17 10:23:08 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23285: tar lacks a 'preserve symlinks on extract' option Resent-From: Jason Vas Dias Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Wed, 13 Apr 2016 21:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 23285 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 23285@debbugs.gnu.org X-Debbugs-Original-To: bug-coreutils@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.146058114821377 (code B ref -1); Wed, 13 Apr 2016 21:00:02 +0000 Received: (at submit) by debbugs.gnu.org; 13 Apr 2016 20:59:08 +0000 Received: from localhost ([127.0.0.1]:34070 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aqRsS-0005Yj-1B for submit@debbugs.gnu.org; Wed, 13 Apr 2016 16:59:08 -0400 Received: from eggs.gnu.org ([208.118.235.92]:48593) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aqRsQ-0005YI-CB for submit@debbugs.gnu.org; Wed, 13 Apr 2016 16:59:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aqRsK-0006ir-C4 for submit@debbugs.gnu.org; Wed, 13 Apr 2016 16:59:01 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:48967) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqRsK-0006in-8M for submit@debbugs.gnu.org; Wed, 13 Apr 2016 16:59:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39555) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqRsJ-0005vL-7U for bug-coreutils@gnu.org; Wed, 13 Apr 2016 16:59:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aqRsI-0006i6-7V for bug-coreutils@gnu.org; Wed, 13 Apr 2016 16:58:59 -0400 Received: from mail-wm0-x22e.google.com ([2a00:1450:400c:c09::22e]:32989) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqRsI-0006hN-0k for bug-coreutils@gnu.org; Wed, 13 Apr 2016 16:58:58 -0400 Received: by mail-wm0-x22e.google.com with SMTP id f198so214067535wme.0 for ; Wed, 13 Apr 2016 13:58:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to; bh=YtnsloDjNm8fVafP6TVLvC15/arvFEune/3fJFVhywY=; b=SmghasmLSoaeuTPKMG2CRG1i0UhXcxTwlViADgS75o/vajFkuXAdbN29LDrpLBAU4M vTQKCMfAF2gHKQh4Q0EyKJCPxVeMlPya6AcHP+P5f74oAqe1Cqn2h1tO+oxWObFeMFOh YRqvsZucxUC7cy9zvU1P2fHi5GDD8z6uivQ5eDBdRosl47zIBMn1RkENN/gKw90uQ02e B0eAS3qdFB4JivEPa1kRMxIt6suQQkH4X9/dotC8Jx+bAd2BDZU6AB760bEAolo1G7Jz 1snLjJlUiq267bCrd2kJntu8Ewb6gQaCllF3lMRaJu8wy0Z+SBGW1qHS4Si0O4mhbpge yH8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to; bh=YtnsloDjNm8fVafP6TVLvC15/arvFEune/3fJFVhywY=; b=MHM3dap8z1e2TNIJ+GIQvY2ru7EuxH9TvuMsOPYyJU9QAjw37W2QigkRyGCmemdpv8 HTSEegcV+agPjvA2pC+dpoDZ9vmZtrmUn+5DZik2wAeAn0AMF4tz3bD9MEDNbyoYpXIV IvZWpf/RI8e23WiOHobBFw8tffFdeibvDM3VTMJGZ3zHCJcNFhlO5SyRafbnvoEXIOCp iMbEwDrYlRFC4e2zedSzKoEtgmOds+NJFBmkeoA8jT1+vESuz86FK3GgQbKXK65VwqlO 5Go0RXgGOkY3iqjxzxyZzzQUPlywtGI4TRpaW+Xv4q2x99Ad26t2auHohVSHlG50chHa 5drw== X-Gm-Message-State: AOPr4FUSbejaLAAyj4gw4YPxLe6wSI6u/vX6P5reGfKDy/mjT5jDX64arDtKq0G2HNWiGhlhik6zycMAJZYZgw== MIME-Version: 1.0 X-Received: by 10.28.142.197 with SMTP id q188mr12152309wmd.52.1460581136660; Wed, 13 Apr 2016 13:58:56 -0700 (PDT) Received: by 10.28.234.70 with HTTP; Wed, 13 Apr 2016 13:58:56 -0700 (PDT) Date: Wed, 13 Apr 2016 21:58:56 +0100 Message-ID: From: Jason Vas Dias Content-Type: text/plain; charset=UTF-8 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) 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 From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 13 17:04:39 2016 Received: (at control) by debbugs.gnu.org; 13 Apr 2016 21:04:39 +0000 Received: from localhost ([127.0.0.1]:34082 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aqRxn-0005lV-5q for submit@debbugs.gnu.org; Wed, 13 Apr 2016 17:04:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52815) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aqRxk-0005lB-4w; Wed, 13 Apr 2016 17:04:36 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A5A46C0467E6; Wed, 13 Apr 2016 21:04:31 +0000 (UTC) Received: from [10.3.113.194] (ovpn-113-194.phx2.redhat.com [10.3.113.194]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u3DL4VuQ015902; Wed, 13 Apr 2016 17:04:31 -0400 Subject: Re: bug#23285: tar lacks a 'preserve symlinks on extract' option To: Jason Vas Dias , 23285-done@debbugs.gnu.org References: From: Eric Blake Openpgp: url=http://people.redhat.com/eblake/eblake.gpg Organization: Red Hat, Inc. Message-ID: <570EB45E.8000906@redhat.com> Date: Wed, 13 Apr 2016 15:04:30 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ma7cXFjfTBwG56oifphGqhBsEwo1r6x33" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Spam-Score: -6.0 (------) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ma7cXFjfTBwG56oifphGqhBsEwo1r6x33 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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@gnu.org, as directed by 'tar --help'. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --ma7cXFjfTBwG56oifphGqhBsEwo1r6x33 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJXDrReAAoJEKeha0olJ0NqvzoH/ip4vO4AgwAacY3JV8rErNM6 ZEWrrfMsWTdYJLALfI15U6EKUIHfeuWXnrqa3F96trEb6BNkBxj9plhIAoDBBv34 HbraorprdXOwc1l6AuwZ1yr1Tkc4ugmvB5X7uW42VklUXo0pMJdDgEzis6KSaDi1 JrpI8cwwNnH3dCLFY5KTwPmjexcsgufSDS+lm7ZqM8vc05cSus1spzGgoQraewYH o5QqpGuaqrYK1Rp0nKjTg7PrBjpw/n/Ip5REjZNzVo7e07zyKBIP87g93M36q0hC 7HfHDTvlbstL+/u8RdwQWVikLmElYgIs5mnrYR0/A94Ofaue3SE8yvS+OfRlkNs= =SR0I -----END PGP SIGNATURE----- --ma7cXFjfTBwG56oifphGqhBsEwo1r6x33-- From unknown Sun Aug 17 10:23:08 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Jason Vas Dias Subject: bug#23285: closed (Re: bug#23285: tar lacks a 'preserve symlinks on extract' option) Message-ID: References: <570EB45E.8000906@redhat.com> X-Gnu-PR-Message: they-closed 23285 X-Gnu-PR-Package: coreutils X-Gnu-PR-Keywords: notabug Reply-To: 23285@debbugs.gnu.org Date: Wed, 13 Apr 2016 21:05:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1460581503-22217-1" This is a multi-part message in MIME format... ------------=_1460581503-22217-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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@debbugs.gnu.org. --=20 23285: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D23285 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1460581503-22217-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 23285-done) by debbugs.gnu.org; 13 Apr 2016 21:04:39 +0000 Received: from localhost ([127.0.0.1]:34080 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aqRxm-0005lT-VB for submit@debbugs.gnu.org; Wed, 13 Apr 2016 17:04:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52815) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aqRxk-0005lB-4w; Wed, 13 Apr 2016 17:04:36 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A5A46C0467E6; Wed, 13 Apr 2016 21:04:31 +0000 (UTC) Received: from [10.3.113.194] (ovpn-113-194.phx2.redhat.com [10.3.113.194]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u3DL4VuQ015902; Wed, 13 Apr 2016 17:04:31 -0400 Subject: Re: bug#23285: tar lacks a 'preserve symlinks on extract' option To: Jason Vas Dias , 23285-done@debbugs.gnu.org References: From: Eric Blake Openpgp: url=http://people.redhat.com/eblake/eblake.gpg Organization: Red Hat, Inc. Message-ID: <570EB45E.8000906@redhat.com> Date: Wed, 13 Apr 2016 15:04:30 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ma7cXFjfTBwG56oifphGqhBsEwo1r6x33" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Spam-Score: -6.0 (------) X-Debbugs-Envelope-To: 23285-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ma7cXFjfTBwG56oifphGqhBsEwo1r6x33 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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@gnu.org, as directed by 'tar --help'. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --ma7cXFjfTBwG56oifphGqhBsEwo1r6x33 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJXDrReAAoJEKeha0olJ0NqvzoH/ip4vO4AgwAacY3JV8rErNM6 ZEWrrfMsWTdYJLALfI15U6EKUIHfeuWXnrqa3F96trEb6BNkBxj9plhIAoDBBv34 HbraorprdXOwc1l6AuwZ1yr1Tkc4ugmvB5X7uW42VklUXo0pMJdDgEzis6KSaDi1 JrpI8cwwNnH3dCLFY5KTwPmjexcsgufSDS+lm7ZqM8vc05cSus1spzGgoQraewYH o5QqpGuaqrYK1Rp0nKjTg7PrBjpw/n/Ip5REjZNzVo7e07zyKBIP87g93M36q0hC 7HfHDTvlbstL+/u8RdwQWVikLmElYgIs5mnrYR0/A94Ofaue3SE8yvS+OfRlkNs= =SR0I -----END PGP SIGNATURE----- --ma7cXFjfTBwG56oifphGqhBsEwo1r6x33-- ------------=_1460581503-22217-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 13 Apr 2016 20:59:08 +0000 Received: from localhost ([127.0.0.1]:34070 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aqRsS-0005Yj-1B for submit@debbugs.gnu.org; Wed, 13 Apr 2016 16:59:08 -0400 Received: from eggs.gnu.org ([208.118.235.92]:48593) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aqRsQ-0005YI-CB for submit@debbugs.gnu.org; Wed, 13 Apr 2016 16:59:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aqRsK-0006ir-C4 for submit@debbugs.gnu.org; Wed, 13 Apr 2016 16:59:01 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:48967) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqRsK-0006in-8M for submit@debbugs.gnu.org; Wed, 13 Apr 2016 16:59:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39555) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqRsJ-0005vL-7U for bug-coreutils@gnu.org; Wed, 13 Apr 2016 16:59:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aqRsI-0006i6-7V for bug-coreutils@gnu.org; Wed, 13 Apr 2016 16:58:59 -0400 Received: from mail-wm0-x22e.google.com ([2a00:1450:400c:c09::22e]:32989) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqRsI-0006hN-0k for bug-coreutils@gnu.org; Wed, 13 Apr 2016 16:58:58 -0400 Received: by mail-wm0-x22e.google.com with SMTP id f198so214067535wme.0 for ; Wed, 13 Apr 2016 13:58:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to; bh=YtnsloDjNm8fVafP6TVLvC15/arvFEune/3fJFVhywY=; b=SmghasmLSoaeuTPKMG2CRG1i0UhXcxTwlViADgS75o/vajFkuXAdbN29LDrpLBAU4M vTQKCMfAF2gHKQh4Q0EyKJCPxVeMlPya6AcHP+P5f74oAqe1Cqn2h1tO+oxWObFeMFOh YRqvsZucxUC7cy9zvU1P2fHi5GDD8z6uivQ5eDBdRosl47zIBMn1RkENN/gKw90uQ02e B0eAS3qdFB4JivEPa1kRMxIt6suQQkH4X9/dotC8Jx+bAd2BDZU6AB760bEAolo1G7Jz 1snLjJlUiq267bCrd2kJntu8Ewb6gQaCllF3lMRaJu8wy0Z+SBGW1qHS4Si0O4mhbpge yH8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to; bh=YtnsloDjNm8fVafP6TVLvC15/arvFEune/3fJFVhywY=; b=MHM3dap8z1e2TNIJ+GIQvY2ru7EuxH9TvuMsOPYyJU9QAjw37W2QigkRyGCmemdpv8 HTSEegcV+agPjvA2pC+dpoDZ9vmZtrmUn+5DZik2wAeAn0AMF4tz3bD9MEDNbyoYpXIV IvZWpf/RI8e23WiOHobBFw8tffFdeibvDM3VTMJGZ3zHCJcNFhlO5SyRafbnvoEXIOCp iMbEwDrYlRFC4e2zedSzKoEtgmOds+NJFBmkeoA8jT1+vESuz86FK3GgQbKXK65VwqlO 5Go0RXgGOkY3iqjxzxyZzzQUPlywtGI4TRpaW+Xv4q2x99Ad26t2auHohVSHlG50chHa 5drw== X-Gm-Message-State: AOPr4FUSbejaLAAyj4gw4YPxLe6wSI6u/vX6P5reGfKDy/mjT5jDX64arDtKq0G2HNWiGhlhik6zycMAJZYZgw== MIME-Version: 1.0 X-Received: by 10.28.142.197 with SMTP id q188mr12152309wmd.52.1460581136660; Wed, 13 Apr 2016 13:58:56 -0700 (PDT) Received: by 10.28.234.70 with HTTP; Wed, 13 Apr 2016 13:58:56 -0700 (PDT) Date: Wed, 13 Apr 2016 21:58:56 +0100 Message-ID: Subject: tar lacks a 'preserve symlinks on extract' option From: Jason Vas Dias To: bug-coreutils@gnu.org Content-Type: text/plain; charset=UTF-8 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) 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 ------------=_1460581503-22217-1--