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

Open
Helflym opened this issue Mar 4, 2019 · 3 comments
Open

os/user: add AIX getgroups support #30563

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

Comments

@Helflym
Copy link
Contributor

@Helflym Helflym commented Mar 4, 2019

getgroups isn't yet available on AIX, as getgrouplist syscall doesn't exist on AIX.
Therefore, https://go-review.googlesource.com/c/go/+/164039 disables tests.

This is a tracking-bug.

@gopherbot
Copy link

@gopherbot gopherbot commented Mar 4, 2019

Change https://golang.org/cl/164039 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
Reviewed-on: https://go-review.googlesource.com/c/go/+/164039
Run-TryBot: Mikio Hara <mikioh.public.networking@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
@gopherbot
Copy link

@gopherbot gopherbot commented Sep 21, 2021

Change https://golang.org/cl/330753 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-on: https://go-review.googlesource.com/c/go/+/330753
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
@kolyshkin
Copy link
Contributor

@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
Labels
NeedsFix OS-AIX
Projects
None yet
Development

No branches or pull requests

4 participants