[Top][All Lists]

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

bug#62607: closed (cp --recursive --backup broken in 9.2)

From: GNU bug Tracking System
Subject: bug#62607: closed (cp --recursive --backup broken in 9.2)
Date: Tue, 04 Apr 2023 11:03:02 +0000

Your message dated Tue, 4 Apr 2023 12:02:50 +0100
with message-id <f5661ffa-59c0-bae4-2903-cc3f8cfaf36d@draigBrady.com>
and subject line Re: bug#62607: cp --recursive --backup broken in 9.2
has caused the debbugs.gnu.org bug report #62607,
regarding cp --recursive --backup broken in 9.2
to be marked as done.

(If you believe you have received this mail in error, please contact

62607: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=62607
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: cp --recursive --backup broken in 9.2 Date: Sun, 2 Apr 2023 00:40:07 +0200

After upgrading to coreutils 9.2-2 on Arch Linux the following:
mkdir -p src dst
touch {src,dst}/bar
cp --recursive --backup src/* dst
fails with:
cp: cannot create regular file 'dst/foo/bar': File exists

Running strace on cp I noticed:
renameat2(4, "foo/bar", 4, "foo/bar~", 0) = -1 ENOENT (No such file or directory)

In coreutils 9.1-3 the syscall succeeds:
renameat2(4, "bar", 4, "bar~", 0)       = 0

I assume renameat2 is called with the wrong oldpath and newpath in 9.2 and that it should just be the basename and not the full relative path.

Kristian Klausen

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

--- End Message ---
--- Begin Message --- Subject: Re: bug#62607: cp --recursive --backup broken in 9.2 Date: Tue, 4 Apr 2023 12:02:50 +0100 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Thunderbird/109.0
On 03/04/2023 18:19, Pádraig Brady wrote:
On 02/04/2023 13:40, Pádraig Brady wrote:
For completeness the correct repro is:

     mkdir -p {src,dst}/foo
     touch {src,dst}/foo/bar
     cp --recursive --backup src/* dst

The attached two patches should address this.
The first fixes the bug in gnulib (cc'd),
while the second adds a test to coreutils.

Marking this as done.


--- End Message ---

reply via email to

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