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

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

bug#55029: closed (Simple backup swaps source and destination files)


From: GNU bug Tracking System
Subject: bug#55029: closed (Simple backup swaps source and destination files)
Date: Thu, 21 Apr 2022 02:54:02 +0000

Your message dated Wed, 20 Apr 2022 19:53:06 -0700
with message-id <347efce7-f714-a470-7903-2bd0443941aa@cs.ucla.edu>
and subject line Re: bug#55029: Simple backup swaps source and destination files
has caused the debbugs.gnu.org bug report #55029,
regarding Simple backup swaps source and destination files
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
55029: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=55029
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: Simple backup swaps source and destination files Date: Tue, 19 Apr 2022 19:05:09 -0400
When doing mv or cp with --backup=simple, if an existing file in
DIRECTORY has the same name as SOURCE, the files appear to be swapped
instead of an in-place backup of the original file in DIRECTORY being
made.
It doesn't happen with --backup=numbered.  SIMPLE_BACKUP_SUFFIX is not set.

Steps to reproduce:

$ mkdir tmp
$ echo "first file" > tmp/a
$ echo "second file" > a
$ command mv -v --backup=simple a tmp/
renamed 'a' -> 'tmp/a' (backup: 'tmp/a~')

$ cat tmp/a~
cat: tmp/a~: No such file or directory

$ cat a~
first file

Version info:

$ mv --version | head -n 1
mv (GNU coreutils) 9.1

$ uname -srm
Linux 5.17.3-arch1-1 x86_64

$ ldd --version | head -n 1
ldd (GNU libc) 2.35

The filesystem type is ext4.



--- End Message ---
--- Begin Message --- Subject: Re: bug#55029: Simple backup swaps source and destination files Date: Wed, 20 Apr 2022 19:53:06 -0700 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0
On 4/19/22 16:05, Steve Ward wrote:
When doing mv or cp with --backup=simple, if an existing file in
DIRECTORY has the same name as SOURCE, the files appear to be swapped
instead of an in-place backup of the original file in DIRECTORY being
made.

Thanks for the bug report. That's new to coreutils 9.1, and is a big enough fail that it suggests we'll need a 9.2 sooner rather than later. I introduced the bug when fixing an earlier bug (sorry).

I installed the attached Gnulib patch, which should fix the bug in Coreutils, with the attached two Coreutils patches to update to the latest Gnulib, and to add a test case for the bug.

Attachment: 0001-backupfile-fix-bug-when-renaming-simple-backups.patch
Description: Text Data

Attachment: 0001-build-update-gnulib-submodule-to-latest.patch
Description: Text Data

Attachment: 0002-mv-test-Bug-55029.patch
Description: Text Data


--- End Message ---

reply via email to

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