Andreas Schwab <[EMAIL PROTECTED]> wrote:
> When moving a file between filesystems, and the source directory is
> unwritable, the diagnostic given by mv is wrong:
>
> $ mkdir /tmp/x; touch /tmp/x/y; chmod -w /tmp/x
> $ test $(stat -c %d /tmp/x) -ne $(stat -c %d .); echo $?
> 0
> $ mv /tmp/x/y .
> mv: cannot remove `/tmp/x/y': Not a directory
Thanks for the report.
That was fixed by this recent change to remove.c:
[I'll mention in NEWS that the fix also affects cross-partition-mv]
2007-09-22 Jim Meyering <[EMAIL PROTECTED]>
rm: give a sensible diagnostic when failing to remove a symlink
On some systems (those with openat et al), when rm would fail to
remove a symlink, it would fail with the misleading diagnostic,
"Too many levels of symbolic links".
* NEWS: Mention the bug fix.
* src/remove.c (is_nondir_lstat): New function.
(remove_entry): Use it to catch failed-to-remove symlink (and any
other non-dir) here so that we don't fall through and try to treat
it as directory, which -- with a symlink -- would provoke the bogus
ELOOP failure.
* tests/rm/fail-eacces: Add a test for the above.
* src/c99-to-c89.diff: Adjust offsets.
_______________________________________________
Bug-coreutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-coreutils