Don't let remove_dir_all recursively remove a symlink#31468
Don't let remove_dir_all recursively remove a symlink#31468bors merged 2 commits intorust-lang:masterfrom pitdicker:fs_tests_cleanup
remove_dir_all recursively remove a symlink#31468Conversation
|
(rust_highfive has picked a reviewer for you, use r? to override) |
| } else { | ||
| remove_dir_all_recursive(path) | ||
| } | ||
| } |
There was a problem hiding this comment.
This logic looks pretty similar between here and windows, perhaps it could be lifted to std::fs and leave the recursive bits to the platform-specific modules?
There was a problem hiding this comment.
The Windows version is similar but a bit tricky. It uses rmdir() so it can only remove directory symlinks and not file symlinks. Unix just uses unlink(). But I don't mind if we make the distinction here or in std::fs.
There was a problem hiding this comment.
Oh right, yeah, good point!
|
Looks good to me, thanks @pitdicker! |
|
⌛ Testing commit d47036c with merge 227f399... |
|
O, I am very sorry. I only tested with symlinking permissions, not also without. The build will fail |
See #29412