]> Cypherpunks repositories - gostls13.git/commit
os/exec: fix incorrect expansion of ".." in LookPath on plan9
authorRichard Miller <millerresearch@gmail.com>
Thu, 7 Aug 2025 10:15:23 +0000 (11:15 +0100)
committerDamien Neil <dneil@google.com>
Wed, 13 Aug 2025 21:55:23 +0000 (14:55 -0700)
commit674c5f0edd82b5d1dd5cb44eb4b85830245c151e
treedc168e629bcae3886057e17de625c74663a571f2
parent9bbea0f21a4539ea365d4804131b17d3b963c4f7
os/exec: fix incorrect expansion of ".." in LookPath on plan9

The correction in CL 685755 is incomplete for plan9, where path
search is performed even on file strings containing "/". By
applying filepath.Clean to the argument of validateLookPath,
we can check for bogus file strings containing ".." where the
later call to filepath.Join would transform a path like
"badfile/dir/.." to "badfile" even where "dir" isn't a directory
or doesn't exist.

For #74466
Fixes #74892

Change-Id: I3f8b73a1de6bc7d8001b1ca8e74b78722408548e
Reviewed-on: https://go-review.googlesource.com/c/go/+/693935
Reviewed-by: David du Colombier <0intro@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
src/os/exec/lp_plan9.go