Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fs::copy() unix: set file mode early
same fix as commit fb98ca7 PR: rust-lang#58803 A convenience method like fs::copy() should try to prevent pitfalls a normal user doesn't think about. In case of an empty umask, setting the file mode early prevents temporarily world readable or even writeable files, because the default mode is 0o666. In case the target is a named pipe or special device node, setting the file mode can lead to unwanted side effects, like setting permissons on /dev/stdout or for root setting permissions on /dev/null.
- Loading branch information