DORMANTno replies

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

From: Nicolas Pitre <hidden>
Date: 2016-06-15 22:43:01
Subsystem: the rest · Maintainer: Linus Torvalds

... like it is done everywhere else.

Signed-off-by: Nicolas Pitre <redacted>
---
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) {
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help