Uh oh!
There was an error while loading. Please reload this page.
fs::copy() unix: set file mode early - #58803
Conversation
rust-highfive
commented
Feb 28, 2019
(rust_highfive has picked a reviewer for you, use r? to override) |
haraldh
commented
Feb 28, 2019
bors
commented
Feb 28, 2019
☔ The latest upstream changes (presumably #58208) made this pull request unmergeable. Please resolve the merge conflicts. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
c7a6814 to
d329ec4Compareharaldh
commented
Mar 1, 2019
new refined version with better comments and logic |
rust-highfive
commented
Mar 1, 2019
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
alexcrichton
commented
Mar 1, 2019
@bors: r+ |
bors
commented
Mar 1, 2019
📌 Commit fb98ca7 has been approved by |
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.
fs::copy() linux: set file mode early 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`. copy_file_range() returns EINVAL, if the destination is a FIFO/pipe or a device like "/dev/null", so fallback to io::copy, too. Fixes: rust-lang#26933Fixed: rust-lang#37885
fs::copy() linux: set file mode early 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`. copy_file_range() returns EINVAL, if the destination is a FIFO/pipe or a device like "/dev/null", so fallback to io::copy, too. Fixes: rust-lang#26933Fixed: rust-lang#37885
fs::copy() linux: set file mode early 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`. copy_file_range() returns EINVAL, if the destination is a FIFO/pipe or a device like "/dev/null", so fallback to io::copy, too. Fixes: rust-lang#26933Fixed: rust-lang#37885
fs::copy() linux: set file mode early 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`. copy_file_range() returns EINVAL, if the destination is a FIFO/pipe or a device like "/dev/null", so fallback to io::copy, too. Fixes: rust-lang#26933Fixed: rust-lang#37885
rust-highfive
commented
Mar 23, 2019
Your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem. Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Hmpf, this filesystem test fails on |
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`. copy_file_range() returns EINVAL, if the destination is a FIFO/pipe or a device like "/dev/null", so fallback to io::copy, too. Use `fcopyfile` on MacOS instead of `copyfile`. Fixes: rust-lang#26933Fixed: rust-lang#37885
haraldh
commented
Mar 23, 2019
added to test |
haraldh
commented
Mar 23, 2019
removed the ignore and added |
haraldh
commented
Mar 23, 2019
Another alternative would be to use TempDir as |
haraldh
commented
Mar 23, 2019
Or just |
alexcrichton
commented
Mar 25, 2019
Hm I wonder if this test could just be ignored on emscripten? You can just add a |
haraldh
commented
Mar 25, 2019
Basically I did that with the latest version. For emscripten it's the old unchanged test (which should pass then) and for all the others it is hopefully picking up the current executable as the test file. |
alexcrichton
commented
Mar 25, 2019
Oh sure yeah and this might pass, but it's pretty jarring to be reading a test and randomly see a conditional statement for one particular platform. It's pretty common, however, to ignore tests on platforms for various reasons, so I think it's best to just ignore the whole test |
haraldh
commented
Mar 26, 2019
I didn't want to take away the test for emscripten, because it seems to pass in the past. |
alexcrichton
commented
Mar 26, 2019
Let's please ignore the test for emscripten, because we don't really need to keep tests running that just happened to pass before. |
haraldh
commented
Mar 26, 2019
here we go, although that contradicts my understanding of a CI |
alexcrichton
commented
Mar 26, 2019
@bors: r+ |
bors
commented
Mar 26, 2019
📌 Commit cf8347b has been approved by |
fs::copy() unix: set file mode early 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`. copy_file_range() returns EINVAL, if the destination is a FIFO/pipe or a device like "/dev/null", so fallback to io::copy, too. Fixes: rust-lang#26933Fixed: rust-lang#37885
Rollup of 12 pull requests Successful merges: - #57987 (Fix some AArch64 typos) - #58581 (Refactor generic parameter encoder functions) - #58803 (fs::copy() unix: set file mode early) - #58848 (Prevent cache issues on version updates) - #59198 (Do not complain about unmentioned fields in recovered patterns) - #59351 (Include llvm-ar with llvm-tools component) - #59413 (HirIdify hir::ItemId) - #59441 (Remove the block on natvis for lld-link.) - #59448 (Use consistent phrasing for all macro summaries) - #59456 (Add documentation about `for` used as higher ranked trait bounds) - #59472 (Document that `std::io::BufReader` discards contents on drop) - #59474 (Fix link capitalization in documentation of std::io::BufWriter.) Failed merges: r? @ghost
haraldh
commented
Mar 28, 2019
Halleluja 😀 |
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/stdoutor for root setting permissions on/dev/null.copy_file_range() returns EINVAL, if the destination is a FIFO/pipe or
a device like "/dev/null", so fallback to io::copy, too.
Fixes: #26933
Fixed: #37885