• 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
getgrouplist_darwin.go 1.25 KB