Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!rutgers!bpa!cbmvax!vu-vlsi!devon!stb!michael From: michael@stb.UUCP (Michael) Newsgroups: comp.sys.tandy Subject: Serious bug in TAR -- URGENT Message-ID: <10494@stb.UUCP> Date: 31 Jul 88 06:05:47 GMT Organization: STB BBS, La, Ca, Usa Lines: 23 I discovered a very nasty bug in tar, the hard way. Given a file called "empire" which is a tar file whose first entry is for a directory named "empire", tar will call mkdir to make "empire". Mkdir will complain, accurately. Tar will then do a creat() call on empire. *** tar does a creat() call on the directory when mkdir failed. *** It shouldn't do anything. If it had tried to unlink it and try again, it would have unpack the archive from the now-dummy file, and no data would have been lost. If it had done nothing, the file would have been there and no data would have been lost. Instead, I wound up with a zero length file that should have been a meg and a half, or a directory. Michael : --- : Michael Gersten uunet.uu.net!denwa!stb!michael : sdcsvax!crash!gryphon!denwa!stb!michael : What would have happened if we had lost World War 2. Well, the west coast : would be owned by Japan, we would all be driving foreign cars, hmm...