SVR2 rm -r bug

Doug Gwyn <gwyn> gwyn at brl-tgr.ARPA
Thu Dec 19 09:59:26 AEST 1985


I think the SVR2 "rm" utility has a serious bug;
since my version has been heavily modified, I'm
not entirely sure about the unmodified version.
To see if you have the bug, try the following:

	$ mkdir foo foo/bar
	$ touch xxx foo/xxx foo/bar/xxx
	$ rm -r foo/bar xxx
	$ ls -R xxx foo

You should see that "xxx", "foo/bar/xxx", and
"foo/bar" no longer exist and "foo" and "foo/xxx"
still exist.  Any other result indicates that
your "rm" has the bug.

There is also a separate bug in the code that
checks for attempts to "rm ..".

The fixes for these were too extensive to try to
post; if you have received the BRL UNIX System
V emulation for 4.2BSD before this posting, send
me a note and I'll mail you the corrected source.



More information about the Net.bugs.usg mailing list