Skip to content

os/exec: on Windows use NeedCurrentDirectoryForExePathW for LookPath behavior #43947

Closed
@dolmen

Description

@dolmen

In os/exec.LookPath use Windows function NeedCurrentDirectoryForExePathW to check if the environment is hardened to protect against resolution of command path in the current directory.

Note that this proposal is different from just looking at the existence of a NoDefaultCurrentDirectoryInExePath environment variable because the function doesn't just look in the process environment variables but might also look in registry settings.

This is related to:

Credit goes to @KalleOlaviNiemitalo for his/her comment in #38736.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions