Skip to content

Commit

Permalink
Check for toolchains names with slashes and use the slow path in that…
Browse files Browse the repository at this point in the history
… case.
  • Loading branch information
ehuss committed Apr 8, 2023
1 parent 93e939f commit f9386d9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/cargo/util/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1664,6 +1664,11 @@ impl Config {
//
// First, we must be running under rustup in the first place.
let toolchain = self.get_env_os("RUSTUP_TOOLCHAIN")?;
// This currently does not support toolchain paths.
// This also enforces UTF-8.
if toolchain.to_str()?.contains(&['/', '\\']) {
return None;
}
// If the tool on PATH is the same as `rustup` on path, then
// there is pretty good evidence that it will be a proxy.
let tool_resolved = paths::resolve_executable(Path::new(tool)).ok()?;
Expand Down

0 comments on commit f9386d9

Please sign in to comment.