DockerCLI/cli
Tibor Vass 48d30b5b32 Use golang.org/x/sys/execabs
On Windows, the os/exec.{Command,CommandContext,LookPath} functions
resolve command names that have neither path separators nor file extension
(e.g., "git") by first looking in the current working directory before
looking in the PATH environment variable.
Go maintainers intended to match cmd.exe's historical behavior.

However, this is pretty much never the intended behavior and as an abundance of precaution
this patch prevents that when executing commands.
Example of commands that docker.exe may execute: `git`, `docker-buildx` (or other cli plugin), `docker-credential-wincred`, `docker`.

Note that this was prompted by the [Go 1.15.7 security fixes](https://blog.golang.org/path-security), but unlike in `go.exe`,
the windows path lookups in docker are not in a code path allowing remote code execution, thus there is no security impact on docker.

Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 8d199d5bba)
Signed-off-by: Tibor Vass <tibor@docker.com>
2021-01-28 22:27:59 +00:00
..
command Use golang.org/x/sys/execabs 2021-01-28 22:27:59 +00:00
compose Support ulimits in docker stack deploy 2020-09-10 14:59:02 +02:00
config Use golang.org/x/sys/execabs 2021-01-28 22:27:59 +00:00
connhelper Use golang.org/x/sys/execabs 2021-01-28 22:27:59 +00:00
context context: Ensure context name is valid on import 2021-01-28 22:27:59 +00:00
debug updated vendoring 2017-09-01 19:41:06 -04:00
flags bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-23 00:28:55 +01:00
manifest bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-23 00:28:55 +01:00
registry/client try http for docker manifest --insecure 2020-03-24 23:42:33 +08:00
streams update docker, replace github.com/docker/pkg/term, github.com/docker/pkg/mount 2020-04-22 17:16:13 +02:00
trust bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-23 00:28:55 +01:00
version Move versioning variables to a separate package. 2019-01-29 11:26:40 +00:00
winresources Add windows resources to binary. 2017-05-15 18:03:03 -04:00
cobra.go Help link: remove color, add "bold" style, and white-space 2020-12-14 14:28:29 +01:00
cobra_test.go bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-23 00:28:55 +01:00
error.go Import docker/docker/cli 2017-04-17 17:40:59 -04:00
required.go Disable unparam linter: cli/required.go:102:16: `pluralize` - `word` always receives `"argument"` (unparam) 2019-10-31 19:22:22 +01:00
required_test.go Replace deprecated Cobra command.SetOutput() with command.SetOut() 2020-05-07 14:25:59 +02:00