MCPcopy Index your code
hub / github.com/docker/docker-agent / detectShell

Function detectShell

pkg/tools/builtin/shell/shell.go:549–551  ·  view source on GitHub ↗

detectShell returns the appropriate shell and arguments based on the platform. It delegates to shellpath.DetectShell which uses absolute paths to prevent PATH hijacking (CWE-426).

()

Source from the content-addressed store, hash-verified

547// It delegates to shellpath.DetectShell which uses absolute paths to prevent
548// PATH hijacking (CWE-426).
549func detectShell() (shell string, argsPrefix []string) {
550 return shellpath.DetectShell()
551}
552
553// resolveWorkDir returns the effective working directory.
554func (h *shellHandler) resolveWorkDir(cwd string) string {

Callers 1

NewFunction · 0.85

Calls 1

DetectShellFunction · 0.92

Tested by

no test coverage detected