Skip to content
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

os/user: add AIX getgroups support #30563

Helflym opened this issue Mar 4, 2019 · 3 comments

os/user: add AIX getgroups support #30563

Helflym opened this issue Mar 4, 2019 · 3 comments
NeedsFix OS-AIX


Copy link

@Helflym Helflym commented Mar 4, 2019

getgroups isn't yet available on AIX, as getgrouplist syscall doesn't exist on AIX.
Therefore, disables tests.

This is a tracking-bug.

Copy link

@gopherbot gopherbot commented Mar 4, 2019

Change mentions this issue: os/user: allow build on aix/ppc64 with cgo

@bradfitz bradfitz added NeedsFix OS-AIX labels Mar 5, 2019
gopherbot pushed a commit that referenced this issue Mar 19, 2019
This commit adds C support for os/user package for aix/ppc64.

Updates #30563

Change-Id: Id07646998a7243b1335b85b5d4fe5bc4114e2a88
Run-TryBot: Mikio Hara <>
TryBot-Result: Gobot Gobot <>
Reviewed-by: Brad Fitzpatrick <>
Copy link

@gopherbot gopherbot commented Sep 21, 2021

Change mentions this issue: os/user: implement go native GroupIds

gopherbot pushed a commit that referenced this issue Sep 21, 2021
Currently, GroupIds (a method that returns supplementary group IDs
for a user) is not implemented when cgo is not available, or osusergo
build tag is set, or the underlying OS lacks getgrouplist(3).

This adds a native Go implementation of GroupIds (which parses
/etc/group) for such cases, together with some tests.

This implementation is used:
 - when cgo is not available;
 - when osusergo build tag is set;
 - on AIX (which lacks getgrouplist(3));
 - on Illumos (which only recently added getgrouplist(3)).

This commit moves listgroups_unix.go to cgo_listgroups_unix.go, and adds
listgroups_unix.go which implements the feature.

NOTE the +build equivalent of go:build expression in listgroups_unix.go
is not provided as it is going to be bulky. Go 1.17 already prefers
go:build over +build, and no longer fail if a file contains go:build
without +build, so the absence of +build is not a problem even with Go
1.17, and this code is targeted for Go 1.18.

Updates #14709
Updates #30563

Change-Id: Icc95cda97ee3bcb03ef028b16eab7d3faba9ffab
Reviewed-by: Ian Lance Taylor <>
Reviewed-by: Tobias Klauser <>
Run-TryBot: Ian Lance Taylor <>
TryBot-Result: Go Bot <>
Copy link

@kolyshkin kolyshkin commented Sep 22, 2021

So, AIX does not have getgrouplist but it does have getgrset and getgrset_r. Alas I don't have any experience with AIX but it seems it might be possible to use it if cgo is enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
NeedsFix OS-AIX
None yet

No branches or pull requests

4 participants