• Kevin Burke's avatar
    os/user: fix darwin GetGroupIds for n > 256 · f100e0c2
    Kevin Burke authored
    If a Mac user has more than 256 groups, getGroupList returns -1 but
    does not correctly set n. We need to retry the syscall with an
    ever-increasing group size until we get all of the user's groups.
    
    The easiest way to test this change is to set n to a value lower than
    the current user's number of groups, test on a Mac and observe
    a failure, then apply the patch and test that it passes.
    
    Fixes #21067.
    
    Change-Id: I0f5c4eac1c465226a460bc0803eff791dcfd4200
    Reviewed-on: https://go-review.googlesource.com/51892Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    f100e0c2
Name
Last commit
Last update
..
cgo_lookup_unix.go Loading commit data...
cgo_unix_test.go Loading commit data...
getgrouplist_darwin.go Loading commit data...
getgrouplist_unix.go Loading commit data...
listgroups_solaris.go Loading commit data...
listgroups_unix.go Loading commit data...
lookup.go Loading commit data...
lookup_android.go Loading commit data...
lookup_plan9.go Loading commit data...
lookup_stubs.go Loading commit data...
lookup_unix.go Loading commit data...
lookup_unix_test.go Loading commit data...
lookup_windows.go Loading commit data...
user.go Loading commit data...
user_test.go Loading commit data...