Re: [PATCH] Do _not_ call unlink on a directory
- From
David Kastrup <dak@gnu.org>
- Date
- Jul 17, 2007, 08:58 UTC
- Message-ID
- <86vecj1k65.fsf@lola.quinscape.zz>
- In-Reply-To
- <alpine.LFD.0.999.0707161252330.20061@woody.linux-foundation.org>
Linus Torvalds <torvalds@linux-foundation.org> writes:
Show 12 quoted lines
> On Mon, 16 Jul 2007, Thomas Glanzmann wrote: >> >> Calling unlink on a directory on a Solaris UFS filesystem as root makes it >> inconsistent. Thanks to Johannes Sixt for the obvious fix. > > Ack, I think this is the right thing to do. > > As pointed out, it doesn't _guarantee_ that git won't call > "unlink()" on a directory (race conditions etc), but that's > fundamentally true (there is no "funlink()" like there is > "fstat()"), and besides, that is in no way git-specific (ie it's > true of *any* application that gets run as root).
Please note that doing "remove" before "mkdir" without checking for directoriness still offers a race window where one can slip in a new non-directory file.
-- David Kastrup