]> Cypherpunks repositories - gostls13.git/commit
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)
committerGopher Robot <gobot@golang.org>
Sun, 7 Jul 2024 16:40:57 +0000 (16:40 +0000)
commitd0146bd85bb6870aa43a498b06ccb473af55cbe3
tree3ac1e5b81db7ff1b77b487fc305c46b90accc152
parentad77cefeb2f5b3f1cef4383e974195ffc8610236
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.
Fixes #68314.

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>
src/os/exec/exec.go
src/os/exec/exec_test.go