Re: [PATCH] Do _not_ call unlink on a directory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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).

The theoretical race would only happen if somebody on purpose tries to 
screw things over, it would never happen under any reasonable usage. 

The old ordering of those tests was designed for sane operating systems, 
so that you could basically do the unlink() without bothering, but 
switching the order around is certainly not a disaster either, and if it 
avoids the nasty bug in Solaris it's worth doing.

I have to say that I'm still a bit shocked that Solaris would have that 
kind of behaviour. And they call that pile of sh*t "enterprise class"..

		Linus
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux