]> Cypherpunks repositories - gostls13.git/commit
os/user: use getgrouplist on illumos && cgo
authorKir Kolyshkin <kolyshkin@gmail.com>
Thu, 11 Sep 2025 16:57:00 +0000 (09:57 -0700)
committerGopher Robot <gobot@golang.org>
Fri, 26 Sep 2025 19:11:42 +0000 (12:11 -0700)
commit3e4540b49d3066ee3fd57f3456506f6d09d0129b
treee4b1bdfbd41e4bf16b728d77e2f33d73b4bf7d0d
parent15fbe3480b1c44113e9cdb26008da9f66d4e57b2
os/user: use getgrouplist on illumos && cgo

The getgrouplist call is available on Illumos since December 2020:

    https://github.com/illumos/illumos-gate/commit/f2c438c5058c64b7373448f239156bf60009abcb

We can assume it is available for users now. Let's switch to using it
when cgo is enabled.

Since neither LUCY nor legacy trybots provide illumos, I tested this
locally in a OpenIndiana VM, with and without osusergo, with cgo enabled
and disabled.

This is a continuation of CL 315278.

Fixes #14709

Change-Id: I922049e7ea5f450f6900914b30967e522e56cfc9
Reviewed-on: https://go-review.googlesource.com/c/go/+/702975
Reviewed-by: Andrew Stormont <andyjstormont@gmail.com>
Auto-Submit: Damien Neil <dneil@google.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Kirill Kolyshkin <kolyshkin@gmail.com>
TryBot-Bypass: Kirill Kolyshkin <kolyshkin@gmail.com>
src/os/user/cgo_listgroups_unix.go
src/os/user/getgrouplist_unix.go
src/os/user/listgroups_unix.go
src/os/user/listgroups_unix_test.go