cmd/go: TestRespectSetgidDir can fail on *BSD #29160
Labels
FrozenDueToAge
GoCommand
cmd/go
NeedsFix
The path to resolution is known, but the work has not been done.
Testing
An issue that has been verified to require only test changes, not just a test failure.
Milestone
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:
mkdir(2)
documentation for each BSD:Darwin: https://github.com/apple/darwin-xnu/blob/master/bsd/man/man2/mkdir.2#L65
NetBSD: http://netbsd.gw.com/cgi-bin/man-cgi?mkdir+2+NetBSD-current
OpenBSD: http://man.openbsd.org/mkdir.2
FreeBSD: https://www.freebsd.org/cgi/man.cgi?query=mkdir&sektion=2
DragonFly: https://www.dragonflybsd.org/cgi/web-man?command=mkdir§ion=2
The text was updated successfully, but these errors were encountered: