File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -2980,6 +2980,21 @@ pub fn read_dir<P: AsRef<Path>>(path: P) -> io::Result<ReadDir> {
29802980///
29812981/// [changes]: io#platform-specific-behavior
29822982///
2983+ /// ## Symlinks
2984+ /// On UNIX-like systems, this function will update the permission bits
2985+ /// of the file pointed to by the symlink.
2986+ ///
2987+ /// Note that this behavior can lead to privalage escalation vulnerabilites,
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.
2990+ ///
2991+ /// For this reason, using this function with symlinks should be avoided.
2992+ /// When possible, permissions should be set at creation time instead.
2993+ ///
2994+ /// # Rationale
2995+ /// POSIX does not specify an `lchown` function,
2996+ /// and symlinks can be followed regardless of what permission bits are set.
2997+ ///
29832998/// # Errors
29842999///
29853000/// 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