-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Documentation for std::fs::set_permissions
doesn't cover symlink behavior
#75942
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
requesting prioritization due to possible relation to CVE-2025-27591. |
Note that libs/libs-api doesn't generally use prioritisation labels, So I've nominated it for @rust-lang/libs-api discussion. |
We discussed this in the @rust-lang/libs-api meeting. Considering that on Unix it's not possible to manipulate the permissions of a symlink (there isn't even a syscall for it on Linux), the question was whether we should change the Windows behavior. The consensus was to leave the behavior as it is and document the difference. One open question was whether this affects WASI since it needs to support both Unix and Windows host platforms. We may revisit this decision if it turns out to cause problems in WASI. |
…5942, r=thomcc std(docs): clarify how std::fs::set_permisions works with symlinks fixes rust-lang#75942 fixes rust-lang#124201
…5942, r=thomcc std(docs): clarify how std::fs::set_permisions works with symlinks fixes rust-lang#75942 fixes rust-lang#124201
…5942, r=thomcc std(docs): clarify how std::fs::set_permisions works with symlinks fixes rust-lang#75942 fixes rust-lang#124201
Rollup merge of rust-lang#139546 - lolbinarycat:std-set_permissions-75942, r=thomcc std(docs): clarify how std::fs::set_permisions works with symlinks fixes rust-lang#75942 fixes rust-lang#124201
The documentation for
std::fs::set_permissions
doesn't say what it does if the given path names a symlink.Experimentally, it seems that on Unix-family platforms it follows symlinks, while on Windows it does not. Though surprising, it's likely just a result of using the
chmod
andSetFileAttributes
functions on their respective platform. The documentation does say that use of those functions isn't guaranteed, so it'd be useful to document what guarantees are intended, if any.The text was updated successfully, but these errors were encountered: