git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Problem with git-push

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Nov 1, 2006, 11:12 UTC
Message-ID
<Pine.LNX.4.63.0611011205340.1670@wbgn013.biozentrum.uni-wuerzburg.de>
In-Reply-To
<7v64e0qclo.fsf@assigned-by-dhcp.cox.net>
Hi,
On Tue, 31 Oct 2006, Junio C Hamano wrote:
Show 12 quoted lines
> So the next thing to see is why adjust_shared_perm() is failing
> for you.
> 
> Oops.
> 
> I think this function is broken at the concept level.  This is
> to work around people's broken umask (when you are working with
> other people, your umask should not be stronger than 007) and
> tries to flip group writability bit on.
> 
> First of all, if the necessary bits are already on, it is not
> necessary to run chmod(),
right
> but more importantly, if the directory in question was created by 
> somebody else, I do not think this chmod() would succeed even if you are 
> in the same group as the owner (i.e. previous creator) of the directory.

But if somebody else created it, it should already have the correct permissions in the first place (unless the user played around with them, which is not a pilot error, but a willfull pointing of the barrel in the general direction of your knee).

> [jc: I am CC'ing Johannes to blame him on commit 457f06d6;
> git-pickaxe is turning out to be quite handy ;-)
I am hating the tool already.
Show 8 quoted lines
>  	if (dir) {
>  		*dir = 0;
>  		mkdir(filename, 0777);
> -		if (adjust_shared_perm(filename))
> +		if (adjust_shared_perm(filename)) {
> +			*dir = '/';
>  			return -2;
> +		}
How about this instead:
-		mkdir(filename, 0777);
-		if (adjust_shared_perm(filename))
+		if (!mkdir(filename, 0777) && adjust_shared_perm(filename)) {
+			*dir = '/';
 			return -2;
+		}

Ciao, Dscho

Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 12 in “Problem with git-push”
  1. Florent ThoumieOct 31, 2006
  2. Junio C HamanoOct 31, 2006
  3. Johannes SchindelinNov 1, 2006
  4. Junio C HamanoNov 1, 2006
  5. Junio C HamanoNov 1, 2006
  6. Florent ThoumieNov 1, 2006
  7. Junio C HamanoNov 1, 2006
  8. Johannes SchindelinNov 2, 2006
  9. Junio C HamanoNov 1, 2006
  10. Johannes SchindelinNov 2, 2006
  11. Junio C HamanoNov 3, 2006
  12. Florent ThoumieNov 1, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.