Skip to content

Commit

Permalink
Honor user's umask.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Oct 1, 2005
1 parent 1fea629 commit f8d839a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ int hold_index_file_for_update(struct cache_file *cf, const char *path)
signal(SIGINT, remove_lock_file_on_signal);
atexit(remove_lock_file);
}
return open(cf->lockfile, O_RDWR | O_CREAT | O_EXCL, 0600);
return open(cf->lockfile, O_RDWR | O_CREAT | O_EXCL, 0666);
}

int commit_index_file(struct cache_file *cf)
Expand Down
2 changes: 1 addition & 1 deletion mailsplit.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ int main(int argc, char **argv)
unsigned long len = parse_email(map, size);
assert(len <= size);
sprintf(name, "%04d", ++nr);
fd = open(name, O_WRONLY | O_CREAT | O_EXCL, 0600);
fd = open(name, O_WRONLY | O_CREAT | O_EXCL, 0666);
if (fd < 0) {
perror(name);
exit(1);
Expand Down

0 comments on commit f8d839a

Please sign in to comment.