bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#12339: [PATCH] rm: avoid bogus diagnostic for a slash-decorated syml


From: Linda A. Walsh
Subject: bug#12339: [PATCH] rm: avoid bogus diagnostic for a slash-decorated symlink-to-dir
Date: Tue, 04 Sep 2012 10:46:10 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.24) Gecko/20100228 Lightning/0.9 Thunderbird/2.0.0.24 Mnenhy/0.7.6.666

Jim Meyering wrote:
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.
I would assert that the trailing "." shouldn't be stripped either.

If the directory is a mount point -- then "." would indicate the
contents of the mount point -- being after the "/", while the "/" would be
the mount point itself.

In my case, I wanted to delete everything in the mount point.  Removal
of the mount point itself would ideally unmount the 'fs', but I won't hold
my breath on that one (and leave the root inode of the file system in the unmounted file system -- thus I've effectively removed "." from mountpoint/.
Which is different from the "." of a directory entry -- NO I'm not
asking for this as a feature, I'm just saying it would be a valid semantic
paradigm"). I WOULD want rm dir foobar/. to remove all contents in the directory before failing on ".". The original version of posix didn't have
this restriction/problem.   POSIX is portability standard -- it should not
be regarded as a restrictive standard, unless not doing so would hinder portability. In effect, they are disallowing OS's to make extensions beyond what they allow in the newer standards...
That goes WAY beyond a portability standard...







reply via email to

[Prev in Thread] Current Thread [Next in Thread]