go/src/os
Russ Cox 6c65a4ab8e [release-branch.go1.18] os/exec: return clear error for missing cmd.Path
Following up on CL 403694, there is a bit of confusion about
when Path is and isn't set, along with now the exported Err field.
Catch the case where Path and Err (and lookPathErr) are all unset
and give a helpful error.

Updates #52574
Followup after #43724.

Fixes #53057
Fixes CVE-2022-30580

Change-Id: I03205172aef3801c3194f5098bdb93290c02b1b6
Reviewed-on: https://go-review.googlesource.com/c/go/+/403759
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
(cherry picked from commit 960ffa98ce)
Reviewed-on: https://go-review.googlesource.com/c/go/+/408577
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Roland Shoemaker <roland@golang.org>
2022-05-27 14:57:10 +00:00
..
exec [release-branch.go1.18] os/exec: return clear error for missing cmd.Path 2022-05-27 14:57:10 +00:00
signal os/signal: reset SIGURG in TestSignal 2021-11-23 21:39:32 +00:00
testdata
user all: gofmt -w -r 'interface{} -> any' src 2021-12-13 18:45:54 +00:00
dir.go
dir_darwin.go
dir_plan9.go
dir_unix.go all: gofmt -w -r 'interface{} -> any' src 2021-12-13 18:45:54 +00:00
dir_windows.go
dirent_aix.go
dirent_dragonfly.go
dirent_freebsd.go
dirent_js.go
dirent_linux.go
dirent_netbsd.go
dirent_openbsd.go
dirent_solaris.go
endian_big.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
endian_little.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
env.go
env_test.go all: gofmt -w -r 'interface{} -> any' src 2021-12-13 18:45:54 +00:00
env_unix_test.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
error.go
error_errno.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
error_plan9.go
error_posix.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
error_test.go
error_unix_test.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
error_windows_test.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
example_test.go os: add examples for Mkdir and MkdirAll 2022-02-08 23:38:05 +00:00
exec.go all: gofmt -w -r 'interface{} -> any' src 2021-12-13 18:45:54 +00:00
exec_plan9.go all: gofmt -w -r 'interface{} -> any' src 2021-12-13 18:45:54 +00:00
exec_posix.go all: gofmt -w -r 'interface{} -> any' src 2021-12-13 18:45:54 +00:00
exec_unix.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
exec_unix_test.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
exec_windows.go
executable.go
executable_darwin.go
executable_dragonfly.go
executable_freebsd.go
executable_path.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
executable_plan9.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
executable_procfs.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
executable_solaris.go
executable_sysctl.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
executable_test.go
executable_windows.go
export_linux_test.go
export_test.go
export_unix_test.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
export_windows_test.go
fifo_test.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
file.go os: clarify that File.{Read,Write} use the buffer 2021-11-09 20:08:48 +00:00
file_plan9.go os: document error returned by pending I/O operations on Close 2021-12-12 14:36:22 +00:00
file_posix.go os: document error returned by pending I/O operations on Close 2021-12-12 14:36:22 +00:00
file_unix.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
file_windows.go
getwd.go
os_test.go [release-branch.go1.18] os: eliminate arbitrary sleep in Kill tests 2022-02-16 21:38:42 +00:00
os_unix_test.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
os_windows_test.go
path.go
path_plan9.go
path_test.go os: enable TestMkdirAllWithSymlink on darwin/arm64 2022-01-02 14:27:32 +00:00
path_unix.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
path_windows.go
path_windows_test.go
pipe2_bsd.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
pipe2_illumos.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
pipe_bsd.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
pipe_linux.go
pipe_test.go os: enable TestClosedPipeRace* on FreeBSD 2021-12-14 20:25:03 +00:00
proc.go
rawconn.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
rawconn_test.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
read_test.go
readfrom_linux.go
readfrom_linux_test.go
readfrom_stub.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
removeall_at.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
removeall_noat.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
removeall_test.go
stat.go
stat_aix.go
stat_darwin.go
stat_dragonfly.go
stat_freebsd.go
stat_js.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
stat_linux.go
stat_netbsd.go
stat_openbsd.go
stat_plan9.go all: gofmt -w -r 'interface{} -> any' src 2021-12-13 18:45:54 +00:00
stat_solaris.go
stat_test.go
stat_unix.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
stat_windows.go
sticky_bsd.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
sticky_notbsd.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
str.go
sys.go
sys_aix.go
sys_bsd.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
sys_js.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
sys_linux.go
sys_plan9.go
sys_solaris.go
sys_unix.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
sys_windows.go
tempfile.go os: don't repeat dir argument in CreateTemp error 2022-02-07 07:14:28 +00:00
tempfile_test.go
timeout_test.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
types.go
types_plan9.go all: gofmt -w -r 'interface{} -> any' src 2021-12-13 18:45:54 +00:00
types_unix.go all: gofmt -w -r 'interface{} -> any' src 2021-12-13 18:45:54 +00:00
types_windows.go all: gofmt -w -r 'interface{} -> any' src 2021-12-13 18:45:54 +00:00
wait_unimp.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
wait_wait6.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
wait_waitid.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00