GNU bug report logs - #33155
cp: copy from symlink -> to symlink?

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: coreutils; Severity: wishlist; Reported by: L A Walsh <coreutils@HIDDEN>; dated Thu, 25 Oct 2018 19:59:02 UTC; Maintainer for coreutils is bug-coreutils@HIDDEN.
Changed bug title to 'cp: copy from symlink -> to symlink?' from 'rfe? cp from symlink -> to symlink? cp symlink meta-info(target) with "-a"? (vs. no diagnostic)' Request was from Assaf Gordon <assafgordon@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Severity set to 'wishlist' from 'normal' Request was from Assaf Gordon <assafgordon@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 25 Oct 2018 19:58:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 25 15:58:50 2018
Received: from localhost ([127.0.0.1]:42875 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gFlmM-000691-9z
	for submit <at> debbugs.gnu.org; Thu, 25 Oct 2018 15:58:50 -0400
Received: from eggs.gnu.org ([208.118.235.92]:54786)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <coreutils@HIDDEN>) id 1gFlmK-00068o-Mh
 for submit <at> debbugs.gnu.org; Thu, 25 Oct 2018 15:58:48 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <coreutils@HIDDEN>) id 1gFlmE-00069r-Ox
 for submit <at> debbugs.gnu.org; Thu, 25 Oct 2018 15:58:43 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled
 version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:54342)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <coreutils@HIDDEN>) id 1gFlmD-00069f-MV
 for submit <at> debbugs.gnu.org; Thu, 25 Oct 2018 15:58:42 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:36153)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <coreutils@HIDDEN>) id 1gFlmC-0004NM-TT
 for bug-coreutils@HIDDEN; Thu, 25 Oct 2018 15:58:41 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <coreutils@HIDDEN>) id 1gFlm9-00068j-MI
 for bug-coreutils@HIDDEN; Thu, 25 Oct 2018 15:58:40 -0400
Received: from ishtar.tlinx.org ([173.164.175.65]:49952
 helo=Ishtar.sc.tlinx.org)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <coreutils@HIDDEN>) id 1gFlm8-00060J-IQ
 for bug-coreutils@HIDDEN; Thu, 25 Oct 2018 15:58:36 -0400
Received: from [192.168.3.12] (Athenae [192.168.3.12])
 by Ishtar.sc.tlinx.org (8.14.7/8.14.4/SuSE Linux 0.8) with ESMTP id
 w9PJwKec072298
 for <bug-coreutils@HIDDEN>; Thu, 25 Oct 2018 12:58:23 -0700
Message-ID: <5BD2205C.5040706@HIDDEN>
Date: Thu, 25 Oct 2018 12:58:20 -0700
From: L A Walsh <coreutils@HIDDEN>
User-Agent: Thunderbird
MIME-Version: 1.0
To: Coreutils <bug-coreutils@HIDDEN>
Subject: rfe?  cp from symlink -> to symlink? cp symlink meta-info(target)
 with "-a"? (vs. no diagnostic)
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by Ishtar.sc.tlinx.org id
 w9PJwKec072298
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no
 timestamps) [generic] [fuzzy]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.0 (------)


Created following test dir (as seen by tree) in /tmp
>  tree mybin
Ishtar:/tmp> tree mybin
mybin
=E2=94=9C=E2=94=80=E2=94=80 iptool -> alt-tool         #broken link
=E2=94=9C=E2=94=80=E2=94=80 iptool-restore -> iptool   #broken link
=E2=94=9C=E2=94=80=E2=94=80 iptool-save -> iptool      #broken link
=E2=94=94=E2=94=80=E2=94=80 usr
    =E2=94=94=E2=94=80=E2=94=80 mybin
        =E2=94=9C=E2=94=80=E2=94=80 alt-tool
        =E2=94=9C=E2=94=80=E2=94=80 iptool -> alt-tool
        =E2=94=9C=E2=94=80=E2=94=80 iptool-restore -> iptool
        =E2=94=9C=E2=94=80=E2=94=80 iptool-save -> iptool
        =E2=94=9C=E2=94=80=E2=94=80 junka
        =E2=94=9C=E2=94=80=E2=94=80 junkb
        =E2=94=94=E2=94=80=E2=94=80 junkc

3 directories, 9 files
----
So first I try copying iptool-save from mybin/usr/mybin to /tmp/mybin

Ishtar:/tmp/mybin/usr/mybin> cp --preserve=3Dall iptool-save /tmp/mybin/
cp: not writing through dangling symlink '/tmp/mybin/iptool-save'

   then try:
Ishtar:/tmp/mybin/usr/mybin> /bin/cp -r --preserve=3Dall -iptool-save=20
/tmp/mybin/
(and get no error message)

It seems to have _re_copied the link (time is updated on that link)
but it didn't recursively follow the link and copy the destination.
(nor with -a).  Why did it act as though I said "force" and recopy the
link (unexpected), but didn't recursively follow the link to its target?
(not entirely expected, but wanted).

Especially if I use '-a', shouldn't copying a symlink also copy the
material pointed to -- i.e. duplicated the symlink structure at the targe=
t?

One *could* consider the target file "metadata" of the symlink, so at lea=
st,
"-a" could cover that case.

It seems odd to silence the diagnostic with "-r" and "-a", but not
recursively follow the link...(I know traditionally -r has referred to
directory structure, but in this case it would be more important & useful
to copy the symlink structure -- ESPECIALLY, since the target symlink
does not exist.  Maybe only overwrite symlink target with "-af"?













Acknowledgement sent to L A Walsh <coreutils@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-coreutils@HIDDEN. Full text available.
Report forwarded to bug-coreutils@HIDDEN:
bug#33155; Package coreutils. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

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