commit 2ad902c0cee1b56de28385c8f1cd6c2d70131a82 from: Stefan Sperling date: Sun Dec 15 11:03:52 2019 UTC use fchmod() instead of chmod() to tweak permissions of a merged temp file commit - 32d2fb48346b752db5098ea03c9c1800863bc71b commit + 2ad902c0cee1b56de28385c8f1cd6c2d70131a82 blob - b463e74467b24e30f3a5d0f011b14cc4af7a69ff blob + dfe5cb16a9227740ff262c42a6f06f174256bc7a --- lib/worktree.c +++ lib/worktree.c @@ -802,8 +802,8 @@ merge_file(int *local_changes_subsumed, struct got_wor goto done; } - if (chmod(merged_path, st_mode) != 0) { - err = got_error_from_errno2("chmod", merged_path); + if (fchmod(merged_fd, st_mode) != 0) { + err = got_error_from_errno2("fchmod", merged_path); goto done; }