Honor user's umask.
Fix the last two holdouts that forced mode bits stricter than the user's umask. Noticed by Wolfgang Denk and fixed by Linus. [jc: applied the same fix to mailsplit just for the sake of consistency.] Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano committed
Oct 1, 2005 at 11:58 UTC
f8d839ad992d92e1e31d7a557c198371d1fb7692
2 files changed
+2
-2
index.c
+1
-1
@@ -29,7 +29,7 @@ int hold_index_file_for_update(struct cache_file *cf, const char *path)
29
signal(SIGINT, remove_lock_file_on_signal);
30
atexit(remove_lock_file);
31
}
32
- return open(cf->lockfile, O_RDWR | O_CREAT | O_EXCL, 0600);
32
+ return open(cf->lockfile, O_RDWR | O_CREAT | O_EXCL, 0666);
33
}
34
35
int commit_index_file(struct cache_file *cf)
mailsplit.c
+1
-1
@@ -128,7 +128,7 @@ int main(int argc, char **argv)
128
unsigned long len = parse_email(map, size);
129
assert(len <= size);
130
sprintf(name, "%04d", ++nr);
131
- fd = open(name, O_WRONLY | O_CREAT | O_EXCL, 0600);
131
+ fd = open(name, O_WRONLY | O_CREAT | O_EXCL, 0666);
132
if (fd < 0) {
133
perror(name);
134
exit(1);