Skip to content

os/exec: environForSysProcAttr is never called as sysattr.Env is never nil [1.13 backport] #37433

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
gopherbot opened this issue Feb 25, 2020 · 3 comments
Labels
CherryPickApproved Used during the release process for point releases FrozenDueToAge
Milestone

Comments

@gopherbot
Copy link
Contributor

@ianlancetaylor requested issue #35314 to be considered for backport to the next 1.13 minor release.

I have no idea.

@gopherbot Please open backport issues

This may be security related on Windows systems.

@gopherbot gopherbot added the CherryPickCandidate Used during the release process for point releases label Feb 25, 2020
@gopherbot gopherbot added this to the Go1.13.9 milestone Feb 25, 2020
@cagedmantis cagedmantis modified the milestones: Go1.13.9, Go1.13.10 Mar 19, 2020
@andybons andybons added the CherryPickApproved Used during the release process for point releases label Mar 26, 2020
@gopherbot gopherbot removed the CherryPickCandidate Used during the release process for point releases label Mar 26, 2020
@gopherbot
Copy link
Contributor Author

Change https://golang.org/cl/226280 mentions this issue: [release-branch.go1.13] os/exec: use environment variables for user token when present

gopherbot pushed a commit that referenced this issue Mar 29, 2020
…oken when present

Builds upon the changes from #32000 which supported sourcing environment
variables for a new process from the environment of a Windows user token
when supplied.

But due to the logic of os/exec, the Env field of a process was
always non-nil when it reached that change.

This change moves the logic up to os/exec, specifically when
os.ProcAttr is being built for the os.StartProcess call, this
ensures that if a user token has been supplied and no Env slice has
been provided on the command it will be sourced from the user's
environment.

If no token is provided, or the program is compiled for any other
platform than Windows, the default environment will be sourced from
syscall.Environ().

For #35314
Fixes #37433

Change-Id: I4c1722e90b91945eb6980d5c5928183269b50487
GitHub-Last-Rev: 32216b7
GitHub-Pull-Request: #37402
Reviewed-on: https://go-review.googlesource.com/c/go/+/220587
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-on: https://go-review.googlesource.com/c/go/+/226280
@gopherbot
Copy link
Contributor Author

Closed by merging 6fcea1e to release-branch.go1.13.

@gopherbot
Copy link
Contributor Author

Change https://golang.org/cl/262517 mentions this issue: x/sys/unix: add linux/ppc support, for use with gccgo

@golang golang locked and limited conversation to collaborators Oct 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CherryPickApproved Used during the release process for point releases FrozenDueToAge
Projects
None yet
Development

No branches or pull requests

3 participants