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

[PATCH] write_sha1_from_fd() should make new objects read-only

From
Nicolas Pitre <nico@cam.org>
Date
Mar 24, 2007, 16:02 UTC
Message-ID
<alpine.LFD.0.83.0703241159360.18328@xanadu.home>
... like it is done everywhere else.
Signed-off-by: Nicolas Pitre <nico@cam.org>
---
diff --git a/sha1_file.c b/sha1_file.c
index 940bab5..0897b94 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -2154,6 +2154,7 @@ int write_sha1_from_fd(const unsigned char *sha1, int fd, char *buffer,
 	} while (1);
 	inflateEnd(&stream);
 
+	fchmod(local, 0444);
 	close(local);
 	SHA1_Final(real_sha1, &c);
 	if (ret != Z_STREAM_END) {
Message 1 of 1 in “write_sha1_from_fd() should make new objects read-only”
  1. write_sha1_from_fd() should make new objects read-onlyNicolas Pitre, Mar 24, 2007

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.