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

'error: unable to set permission to './objects/...'

From
Rafal Rusin <rafal.rusin@gmail.com>
Date
Nov 22, 2009, 20:02 UTC
Message-ID
<9bbf67fa0911221202r605de38coc2496b1f09123725@mail.gmail.com>
Hello,

I'm hosting git repository on filesystem with 'chmod <some-file>' causing permission denied error (it's smbfs mounted directory), When I was doing push to such repo using file:// protocol, I got following error: error: unable to set permission to './objects/...'

I did a small fix to sha1_file.c (patch in attachment) and git now warns when unable to chmod, and continues push. This resolved problem. What do you think about applying it?

Regards,
-- 
Rafał Rusin
http://rrusin.blogspot.com
http://www.touk.pl
http://top.touk.pl


diff --git a/sha1_file.c b/sha1_file.c
index 4ea0b18..305e751 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -2272,8 +2272,9 @@ int move_temp_to_file(const char *tmpfile, const char *filename)
 	}
 
 out:
-	if (set_shared_perm(filename, (S_IFREG|0444)))
-		return error("unable to set permission to '%s'", filename);
+	if (set_shared_perm(filename, (S_IFREG|0444))) {
+		warning("unable to set permission to '%s'", filename);
+    }
 	return 0;
 }
 
Next: Miklos Vajna
Message 1 of 7 in “'error: unable to set permission to './objects/...'”
  1. Rafal RusinNov 22, 2009
  2. Miklos VajnaNov 22, 2009
  3. Junio C HamanoNov 22, 2009
  4. Rafal RusinNov 23, 2009
  5. Junio C HamanoNov 23, 2009
  6. Rafal RusinNov 24, 2009
  7. Martin LanghoffNov 23, 2009

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.