From 62297e15597dc81a6b4492956466929eb02b26a3 Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Mon, 30 Oct 2023 17:12:31 +0100 Subject: [PATCH] Switch to fs::read_link --- src/linux/namespaces.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/linux/namespaces.rs b/src/linux/namespaces.rs index 13473ed..382f130 100644 --- a/src/linux/namespaces.rs +++ b/src/linux/namespaces.rs @@ -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()) }