Re: TOCTOU bug in make(1)
David Holland <[email protected]>
| Newsgroups | gmane.os.netbsd.devel.toolchain |
|---|---|
| Message-ID | <[email protected]> |
On Thu, Oct 06, 2022 at 10:51:47PM +0200, Joerg Sonnenberger wrote: > > > This is necessary for historic reasons because old UNIX systems allows > > > unlink(2) on directories with bad consequences. > > > > Also, even if unlink() on a directory actually results in a correct > > rmdir, changing the behavior of that function so that delete-target- > > on-error sometimes removes directories and sometimes doesn't, > > depending on the OS or even on the filesystem in use, doesn't seem > > like a good idea. > > Actually, the correct and expected behavior is that it fails on > directories. unlink and rmdir are supposed to be symmetrical in that > regard. Correct in the sense of not corrupting the filesystem, which as you're aware is not the case if it simply removes the link. -- David A. Holland [email protected]