1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-09-13 18:47:58 +00:00

Merge pull request #800 from Arcterus/master

uucore: don't follow symlinks when examining them (fixes #799)
This commit is contained in:
Michael Gehring 2016-01-10 13:26:55 +01:00
commit 5e5f17120b

View file

@ -31,7 +31,7 @@ fn resolve<P: AsRef<Path>>(original: P) -> Result<PathBuf> {
return Err(Error::new(ErrorKind::InvalidInput, "maximum links followed")); return Err(Error::new(ErrorKind::InvalidInput, "maximum links followed"));
} }
match fs::metadata(&result) { match fs::symlink_metadata(&result) {
Err(e) => return Err(e), Err(e) => return Err(e),
Ok(ref m) if !m.file_type().is_symlink() => break, Ok(ref m) if !m.file_type().is_symlink() => break,
Ok(..) => { Ok(..) => {