Skip to content

Commit

Permalink
Switch to fs::read_link
Browse files Browse the repository at this point in the history
  • Loading branch information
cd-work committed Oct 30, 2023
1 parent 0a1fccc commit 62297e1
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/linux/namespaces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,5 @@ fn normalize_path(path: &Path) -> PathBuf {

/// Check if a path contains any symlinks.
fn path_has_symlinks(path: &Path) -> bool {
path.ancestors()
.flat_map(|path| path.symlink_metadata().ok())
.any(|metadata| metadata.is_symlink())
path.ancestors().any(|path| path.read_link().is_ok())
}

0 comments on commit 62297e1

Please sign in to comment.