golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
121.36k stars 17.38k forks source link

os/exec: modifications to Path ignored when *Cmd is created using Command with an absolute path on Windows [1.22 backport] #68331

Closed gopherbot closed 1 week ago

gopherbot commented 1 week ago

@dmitshur requested issue #68314 to be considered for backport to the next 1.22 minor release.

@gopherbot Please backport to Go 1.22. Only Go 1.22 needs the fix, as this isn't an issue in Go 1.2​1.

This is a regression that can cause wrong binaries to be executed on Windows, with no workaround other than changing user code.

gopherbot commented 1 week ago

Change https://go.dev/cl/596976 mentions this issue: [release-branch.go1.22] os/exec: only use cachedLookExtensions if Cmd.Path is unmodified

cagedmantis commented 1 week ago

Approved. This is a regression that can cause wrong binaries to be executed on Windows, with no workaround other than changing user code.

gopherbot commented 1 week ago

Closed by merging ea96074191e2fdd435c7f38ce0283bb868336122 to release-branch.go1.22.