Skip to content

Commit

Permalink
Fix setting of new files' permissions on Unix
Browse files Browse the repository at this point in the history
The changes in 0c39a4a accidentally
tried to preserve permissions of existing file even if one didn't exist,
leading to setting essentially random permissions.
  • Loading branch information
vslavik committed Feb 23, 2016
1 parent 229d107 commit f4a0cd2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,11 @@ bool TempOutputFileFor::ReplaceFile(const wxString& temp, const wxString& dest)
return false;

#ifdef __UNIX__
chown(destPath, st.st_uid, st.st_gid);
chmod(destPath, st.st_mode);
if (overwrite)
{
chown(destPath, st.st_uid, st.st_gid);
chmod(destPath, st.st_mode);
}
#endif

return true;
Expand Down

0 comments on commit f4a0cd2

Please sign in to comment.