Re: [Junio C Hamano] Re: Consolidate SHA1 object file close

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

 




On Mon, 16 Jun 2008, Junio C Hamano wrote:
> 
> However, this may be more important fix.  We want to make sure that
> adjust_shared_perm() is called on the success codepath, especially not
> when mkdir() does _not_ fail.

Oops. Yes.

The old code this came from actually did it differently: it failed if 
mkdir _succeeded_ but then adjust_shared_perm() failed. If the mkdir 
failed, it would just try again. That was what confused me - it was a 
copy-and-paste thing, but with me misreading the source of it and being 
confused.

IOW, the old code looked like

	if (!mkdir(filename, 0777) && adjust_shared_perm(filename)) {
		.. failure path ..

which is just really odd. A failing mkdir would be a "success" from this 
standpoint, leading to another "link()" being attempted. I think it may 
have wanted to return the errno from the link() or something.

Your fix is obviously superior. And equally obviously we don't seem to 
have any tests for this case. Maybe because I have a umask of 0002, so the 
mkdir() would already make it group-writable?

		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