Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 223869 - mv(1) command produces wrong error message
mv(1) command produces wrong error message
Product: Fedora
Classification: Fedora
Component: coreutils (Show other bugs)
All Linux
medium Severity low
: ---
: ---
Assigned To: Tim Waugh
Depends On:
Blocks: FC6Update
  Show dependency treegraph
Reported: 2007-01-22 15:28 EST by Tamal Kanti Nath
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version: 5.97-12.5.fc6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-04-19 04:25:28 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Tamal Kanti Nath 2007-01-22 15:28:23 EST
Description of problem:
The mv(1) command produces a wrong error message.

Version-Release number of selected component (if applicable):

How reproducible:
When I attempt to replace a non-empty directory with another directory, this
wrong error message occurs.

Steps to Reproduce:
1. mkdir -p a/b b
2. date > a/b/c.txt
3. mv b a

Actual results:
mv: cannot move `b' to a subdirectory of itself, `a/b'

Expected results:
mv: directory 'a/b' already exists

Additional info:
Replacement successfully occurs if the destination directory is empty.
Comment 1 Jim Meyering 2007-01-22 15:40:16 EST
FWIW, upstream (coreutils-6.7) gets this right now: It prints this:
mv: cannot move `b' to `a/b': Directory not empty

Tim, I don't see off-hand where I made that fix.  Let me know if you'd like details.
Comment 2 Tim Waugh 2007-01-23 05:22:17 EST
If we do another coreutils update for FC6 it would be nice to get this fix in.
Comment 3 Jim Meyering 2007-01-23 15:06:59 EST
The fix was on the trunk, between 5.92 and 6.0.  Looks safe.


Here's the log entry:

    * src/copy.c (copy_internal): Don't work around old NFS clients like
    SunOS-4.1.4 and Irix 5.3 that set errno to values like EIO and
    ENOTEMPTY upon failed rename.  Otherwise, we risk misinterpreting
    a banal failure as a recursive move-into-self failure.
    Reported by Florent Bayle in <http://bugs.debian.org/376749>.
Comment 4 Fedora Update System 2007-04-18 18:37:19 EDT
Fixed in update: coreutils-5.97-12.5.fc6

Note You need to log in before you can comment on or make changes to this bug.