Skip to content
This repository has been archived by the owner on Feb 20, 2020. It is now read-only.

Commit

Permalink
Create environment for process user, if not current user
Browse files Browse the repository at this point in the history
  • Loading branch information
petemoore committed Mar 23, 2018
1 parent 4ab5b9e commit 5f77a59
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions process/process_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ func (r *Result) Crashed() bool {
}

func NewCommand(commandLine []string, workingDirectory string, env []string, loginInfo *subprocess.LoginInfo, deadline time.Time) (*Command, error) {
if loginInfo != nil && loginInfo.HUser != 0 {
environment, err := win32.CreateEnvironment(&env, loginInfo.HUser)
if err != nil {
return nil, err
}
env = *environment
}
var cancel context.CancelFunc
var ctx context.Context
if deadline.IsZero() {
Expand Down

0 comments on commit 5f77a59

Please sign in to comment.