]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.22] os/exec: only use cachedLookExtensions if Cmd.Path is unmodified
authorDmitri Shuralyov <dmitshur@golang.org>
Thu, 4 Jul 2024 22:07:45 +0000 (18:07 -0400)
committerCarlos Amedee <carlos@golang.org>
Wed, 10 Jul 2024 19:24:54 +0000 (19:24 +0000)
commitea96074191e2fdd435c7f38ce0283bb868336122
treee7bcce443cf8cc6c63e2f23c33662a8cccbcefb2
parent8e1fdea8316d840fd07e9d6e026048e53290948b
[release-branch.go1.22] os/exec: only use cachedLookExtensions if Cmd.Path is unmodified

Caching the invocation of lookExtensions on an absolute path in Command
and reusing the cached result in Start is only viable if Cmd.Path isn't
set to a different value after Command returns.

For #66586.
For #68314.
Fixes #68331.

Change-Id: I57007850aca2011b11344180c00faded737617b5
Reviewed-on: https://go-review.googlesource.com/c/go/+/596875
Reviewed-by: qiu laidongfeng2 <2645477756@qq.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
(cherry picked from commit d0146bd85bb6870aa43a498b06ccb473af55cbe3)
Reviewed-on: https://go-review.googlesource.com/c/go/+/596976
src/os/exec/exec.go
src/os/exec/exec_test.go