From a64725d1c5c2ec99b8e457bf4256dc1c0fc43e07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20L=C3=B3pez?= Date: Sun, 15 Jan 2023 12:11:53 -0300 Subject: [PATCH] slither-doctor: paths: follow symlinks Sometimes installed binaries are a symlink to some other path (e.g., in Homebrew packages) and we should not warn users if that is the case. Follow symlinks to find the real underlying paths and compare those instead. --- slither/tools/doctor/checks/paths.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/slither/tools/doctor/checks/paths.py b/slither/tools/doctor/checks/paths.py index d388847ef4..c18051679d 100644 --- a/slither/tools/doctor/checks/paths.py +++ b/slither/tools/doctor/checks/paths.py @@ -48,8 +48,8 @@ def check_path_config(name: str) -> Tuple[bool, Optional[Path], List[Path]]: binary_here = False if binary_path is not None: - binary_path = Path(binary_path) - this_code = Path(__file__) + binary_path = Path(binary_path).resolve() + this_code = Path(__file__).resolve() this_binary = list(filter(lambda x: path_is_relative_to(this_code, x[1]), possible_paths)) binary_here = len(this_binary) > 0 and all( path_is_relative_to(binary_path, script) for script, _ in this_binary