rm: give a sensible diagnostic when failing to remove a symlink
authorJim Meyering <jim@meyering.net>
Sat, 22 Sep 2007 08:02:09 +0000 (10:02 +0200)
committerJim Meyering <jim@meyering.net>
Sat, 22 Sep 2007 11:27:57 +0000 (13:27 +0200)
commita7ec8caffe1a48590f5e3da9400080ab8a6ec303
tree2f60406ee7f34139c53def242c7bf89005074761
parent920b4416c147ecb76731137158da8bcc9041fecd
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.
ChangeLog
NEWS
src/c99-to-c89.diff
src/remove.c
tests/rm/fail-eacces