Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/go: TestRespectSetgidDir can fail on *BSD #29160
TestRespectSetgidDir assumes it can create a temporary directory with setgid. However, on *BSD mkdir will inherit the parent directory group. If the test process does not have permission for the group it will be unable to setgid.
This was fixed for FreeBSD in go1.9 (#19596), but remains a potential problem for other BSD platforms (including Darwin).
In particular, I found this with /tmp on OpenBSD:
A process without wheel permissions will end up with a test temporary directory owned by "user:wheel" and fail to chmod setgid: