Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!rutgers!mit-eddie!allegra!mp From: mp@allegra.UUCP Newsgroups: comp.unix.questions Subject: is it ok to forbid rm -r x/y/.. Message-ID: <6427@allegra.UUCP> Date: Sat, 17-Jan-87 13:43:28 EST Article-I.D.: allegra.6427 Posted: Sat Jan 17 13:43:28 1987 Date-Received: Sat, 17-Jan-87 23:39:29 EST Organization: AT&T Bell Laboratories, Murray Hill Lines: 12 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