diff --git a/lix/nix/doctor.cc b/lix/nix/doctor.cc index 01dcfcac1..05b5d5203 100644 --- a/lix/nix/doctor.cc +++ b/lix/nix/doctor.cc @@ -79,7 +79,8 @@ struct CmdDoctor : StoreCommand PathSet dirs; for (auto & dir : tokenizeString(getEnv("PATH").value_or(""), ":")) - if (pathExists(dir + "/nix-env")) + // Inaccessible-but-extant PATH elements can't be executed anyway. + if (pathAccessible(dir + "/nix-env")) dirs.insert(dirOf(canonPath(dir + "/nix-env", true))); if (dirs.size() != 1) {