Skip to content

syscall, os/exec: Support running child process as different user on Windows #35653

@mappu

Description

@mappu

What version of Go are you using (go version)?

$ go version
go version go1.13.4 windows/amd64

Does this issue reproduce with the latest release?

n/a

What operating system and processor architecture are you using (go env)?

n/a

What did you do?

Try to launch a process as a different user. Found syscall.Credential can be supplied as a SysProcAttr to exec.Cmd.

What did you expect to see?

Ability to launch process as different user, on all supported OSes.

What did you see instead?

syscall.Credential only supports UID/GID and only works on Unix-like systems. There's no option for Windows (based on either CreateProcessWithLogonW call, or LogonUser/CreateProcessAsUserW pair call).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions