File tree 1 file changed +8
-6
lines changed
1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -2980,19 +2980,21 @@ pub fn read_dir<P: AsRef<Path>>(path: P) -> io::Result<ReadDir> {
2980
2980
///
2981
2981
/// [changes]: io#platform-specific-behavior
2982
2982
///
2983
- /// # Symlinks
2984
- /// On UNIX systems, it is impossible to manipulate the permission bits of a symlink itself[^1].
2985
- /// Because of this, on those systems, this function will update the permission bits
2983
+ /// ## Symlinks
2984
+ /// On UNIX-like systems, this function will update the permission bits
2986
2985
/// of the file pointed to by the symlink.
2987
2986
///
2988
2987
/// Note that this behavior can lead to privalage escalation vulnerabilites,
2989
- /// where the ability to write a symlink in one directory allows you to
2990
- /// cause the permissions of another directory to be modified.
2988
+ /// where the ability to create a symlink in one directory allows you to
2989
+ /// cause the permissions of another file or directory to be modified.
2991
2990
///
2992
2991
/// For this reason, using this function with symlinks should be avoided.
2993
2992
/// When possible, permissions should be set at creation time instead.
2994
2993
///
2995
- /// [^1]: even if it were possible, the permissions on a symlink are ignored.
2994
+ /// # Rationale
2995
+ /// POSIX does not specify an `lchown` function,
2996
+ /// and symlinks can be followed regardless of what permission bits are set.
2997
+ ///
2996
2998
/// # Errors
2997
2999
///
2998
3000
/// This function will return an error in the following situations, but is not
You can’t perform that action at this time.
0 commit comments