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

x/build: make sure builders always set $HOME and $USER #24884

Open
bradfitz opened this Issue Apr 16, 2018 · 3 comments

Comments

Projects
None yet
3 participants
@bradfitz
Member

bradfitz commented Apr 16, 2018

The builders don't always set $HOME and $USER.

Fix that, and revert the os/user testing hacks from https://go-review.googlesource.com/c/go/+/107300

@gopherbot gopherbot added this to the Unreleased milestone Apr 16, 2018

@gopherbot gopherbot added the Builders label Apr 16, 2018

@kardianos

This comment has been minimized.

Contributor

kardianos commented Apr 16, 2018

For all builders? or all non-windows builder?

@bradfitz

This comment has been minimized.

Member

bradfitz commented Apr 16, 2018

$HOME/$USER or equivalent for windows/plan9. But we happen to be fine already for Windows & Plan 9, so this is really only about the Unix builders.

@gopherbot

This comment has been minimized.

gopherbot commented Sep 8, 2018

Change https://golang.org/cl/134218 mentions this issue: os/user: retrieve username from /etc/passwd instead of $USER

gopherbot pushed a commit that referenced this issue Sep 9, 2018

os/user: retrieve Current username from /etc/passwd, not $USER
Per #27524 there are situations where the username for the
uid does not match the value in the $USER environment variable and it
seems sensible to choose the value in /etc/passwd when they disagree.

This may make the Current() call slightly more expensive, since we
read /etc/passwd with cgo disabled instead of just checking the
environment. However, we cache the result of Current() calls, so we
only invoke this cost once in the lifetime of the process.

Fixes #14626.
Fixes #27524.
Updates #24884.

Change-Id: I0dcd224cf7f61dd5292f3fcc363aa2e9656a2cb1
Reviewed-on: https://go-review.googlesource.com/134218
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment