mv command deleted source file without moving to destination
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
coreutils (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
I mv'd a file to a directory where I had group write permissions, but a file existed owned by another user. I was asked if I wanted to override the permissions. I said "y". The ownership was changed on the destination file to me, but the mod time and contents of the file were not changed and the source file was deleted. I tried to duplicate the behavior, but it worked as it should with a test file.
toma@admn1:~$ ls -ld /opt/scripts
drwxrwxr-- 3 ansible ansible 4096 Jun 24 16:25 /opt/scripts
toma@admn1:~$ mv GeneratePortList.pl /opt/scripts/
mv: replace '/opt/scripts/
toma@admn1:~$ ls -l /opt/scripts/
-rwxr-xr-x 1 toma domain users 2855 Jul 16 2018 /opt/scripts/
I have mv aliased to mv -i so I can confirm that the existing destination file was not owned by me since I was not prompted to overwrite the file.
Both source and destination are in the same file system. I cannot find the source file anywhere.
toma@admn1:~$ lsb_release -rd
Description: Ubuntu 20.04.2 LTS
Release: 20.04
toma@admn1:~$ uname -a
Linux admn1.aaisdirec
toma@admn1:~$ apt-cache policy coreutils
coreutils:
Installed: 8.30-3ubuntu2
Candidate: 8.30-3ubuntu2
Version table:
*** 8.30-3ubuntu2 500
500 http://
100 /var/lib/
8.28-1ubuntu1 500
500 http://