write_sha1_from_fd() should make new objects read-only
authorNicolas Pitre <nico@cam.org>
Sat, 24 Mar 2007 16:02:27 +0000 (12:02 -0400)
committerJunio C Hamano <junkio@cox.net>
Sun, 25 Mar 2007 05:32:41 +0000 (22:32 -0700)
... like it is done everywhere else.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
sha1_file.c

index e412c70f270f0e8423a7a21ff54e52e76981b11f..0897b945e5dace8189adc35e6eea389cfc7606af 100644 (file)
@@ -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) {