From a7ec8caffe1a48590f5e3da9400080ab8a6ec303 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 22 Sep 2007 10:02:09 +0200 Subject: 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. --- NEWS | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'NEWS') diff --git a/NEWS b/NEWS index 93a632c5a..e8e20e098 100644 --- a/NEWS +++ b/NEWS @@ -202,6 +202,10 @@ GNU coreutils NEWS -*- outline -*- "rm --interactive=never F" no longer prompts for an unwritable F + "rm -rf D" would emit an misleading diagnostic when failing to + remove a symbolic link within the unwritable directory, D. + Introduced in coreutils-6.0. + ** New features sort's new --compress-program=PROG option specifies a compression -- cgit v1.2.3-70-g09d2