emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#40352: closed (cp -a --attributes-only zeroes a file with more than


From: GNU bug Tracking System
Subject: bug#40352: closed (cp -a --attributes-only zeroes a file with more than one link)
Date: Wed, 01 Apr 2020 12:11:02 +0000

Your message dated Wed, 1 Apr 2020 13:10:02 +0100
with message-id <address@hidden>
and subject line Re: bug#40352: cp -a --attributes-only zeroes a file with more 
than one link
has caused the debbugs.gnu.org bug report #40352,
regarding cp -a --attributes-only zeroes a file with more than one link
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden.)


-- 
40352: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=40352
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: cp -a --attributes-only zeroes a file with more than one link Date: Tue, 31 Mar 2020 14:32:13 +0200
Hello,
When you cp -a --attributes-only a file which has a more than one “hardlink”, it zeroes the file:
 
$ echo hello > aaa
$ cp aaa foo
$ chmod 777 aaa
$ ls -li
total 8
407584 -rwxrwxrwx 1 matt matt 6 mars  31 14:19 aaa
399313 -rw-r--r-- 1 matt matt 6 mars  31 14:19 foo
$ cp -a --attributes-only aaa foo   # this is fine
$ ls -li
total 8
407584 -rwxrwxrwx 1 matt matt 6 mars  31 14:19 aaa
399313 -rwxrwxrwx 1 matt matt 6 mars  31 14:19 foo
$ ln foo foo2
$ cp -a --attributes-only aaa foo   # here comes the bug
$ ls -li
total 8
407584 -rwxrwxrwx 1 matt matt 6 mars  31 14:19 aaa
407740 -rwxrwxrwx 1 matt matt 0 mars  31 14:19 foo
399313 -rwxrwxrwx 1 matt matt 6 mars  31 14:19 foo2
 
foo has a size of 0 bytes!
The user thinks he's replicating timestamp and permissions, and he's actually deleting data. (Well, the data is still in foo2, but...)
 
coreutils 8.30
 
Matt

--- End Message ---
--- Begin Message --- Subject: Re: bug#40352: cp -a --attributes-only zeroes a file with more than one link Date: Wed, 1 Apr 2020 13:10:02 +0100 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:73.0) Gecko/20100101 Thunderbird/73.0
On 31/03/2020 13:32, Matt Kloss wrote:
    Hello,

    When you cp -a --attributes-only a [dest] file which has a more than one
    “hardlink”, it zeroes the file:

The attached fixes this, which I'll push later.
Marking this as done.
thanks!

Pádraig

Attachment: cp-a--attributes-only.patch
Description: Text Data


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]