[comp.unix.questions] is it ok to forbid rm -r x/y/..

mp@allegra.UUCP (01/17/87)

After seeing several people remove their entire hierarchies
with something like ``rm -r /usr/lg/backup/.*'' , I'm tempted to
make rm forbid removing anything that has .. as its last
pathname component (currently, it checks only for pathnames
that are either . or ..).  But I'm wondering why it hasn't
been changed to do this already.  What am I overlooking?

BTW, under 4.3bsd the attempt to recursively remove .. in the
aforementioned manner may cause rm to get a bus error.  On line 167,
add an "if (dirp)" before "closedir(dirp)".
	Mark Plotnick
	allegra!mp

gwyn@brl-smoke.ARPA (Doug Gwyn ) (01/20/87)

In article <6427@allegra.UUCP> mp@allegra.UUCP (Mark Plotnick) writes:
>... I'm tempted to make rm forbid removing anything that has ..
>as its last pathname component ...  What am I overlooking?

Perhaps that "rm" should do as it's told?
(Unless of course it can't work, which is probably
the point of the prohibition on . and ..; I think
those too should not be exempted.)