Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utcs!mnetor!seismo!munnari!moncskermit!basser!john From: john@basser.UUCP Newsgroups: net.unix-wizards Subject: VERY SERIOUS rmdir bug Message-ID: <707@basser.oz> Date: Thu, 17-Jul-86 14:41:13 EDT Article-I.D.: basser.707 Posted: Thu Jul 17 14:41:13 1986 Date-Received: Fri, 18-Jul-86 23:47:32 EDT References: <79@wanginst.UUCP> Reply-To: john@basser.oz (John Mackin) Distribution: net Organization: Dept of Comp Sci, Uni of Sydney, Australia Lines: 25 Summary: you'd better read this John Tupper pointed out an rm bug (that it didn't check properly for pathnames ending in .. on recursive removes). That got one of our users here to experimenting, and he found that he could remove .. from directories. The amount of braindamage this sort of thing can cause is large. I believe that the bug will be likely to be found on any machine that doesn't do rmdir by system call, although I haven't checked sysV sources, not having any handy. To demonstrate the bug, do this: $ mkdir foo foo/bar $ rmdir foo/bar/../bar (rmdir will cough along the lines of "foo/bar/../bar not removed") $ od -c foo/bar (note the lack of a .. in bar. get very sad.) We have fixed rmdir, but I would like to wait a couple of days to see if I can think of any more problems (or any bugs in the fix, which wasn't simple) before posting a diff. John Mackin, Basser Department of Computer Science, University of Sydney, Sydney, Australia {seismo,hplabs,mcvax,ukc,nttlab}!munnari!basser.oz!john john@basser.oz.au (john%basser.oz@SEISMO.CSS.GOV)