]> git.ipfire.org Git - thirdparty/coreutils.git/commit
rm: avoid bogus diagnostic for a slash-decorated symlink-to-dir
authorJim Meyering <meyering@redhat.com>
Tue, 4 Sep 2012 12:40:11 +0000 (14:40 +0200)
committerJim Meyering <meyering@redhat.com>
Wed, 5 Sep 2012 10:10:38 +0000 (12:10 +0200)
commit57dd06703cb89ba53d05af95c11e89a2ca51af5c
treeecc69c1fe877140a51d52c0d58fb018071faf107
parentd5719921a8968f5dc21149020450cca9b3d6c646
rm: avoid bogus diagnostic for a slash-decorated symlink-to-dir

These commands would evoke an invalid diagnostic:
    $ mkdir d && ln -s d s && env rm -r s/
    rm: cannot remove 's': Too many levels of symbolic links
remove.c was stripping trailing slashes from "s/" before passing
the name to "rm".  But a trailing slash may change the semantics,
and thus should not be stripped.
* src/remove.c (rm_fts): Do not strip trailing slashes.
* tests/rm/v-slash.sh: Adapt to new expected output.
* gnulib: Update to latest, for an improved fts.c that merely
normalizes trailing slashes.
Reported by Paul Eggert in discussion of http://bugs.gnu.org/12339
NEWS
gnulib
src/remove.c
tests/rm/v-slash.sh