diff options
author | Russ Cox <rsc@golang.org> | 2009-05-18 14:56:25 -0700 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2009-05-18 14:56:25 -0700 |
commit | c40d14204290410ba56a30eb0457e37a71dae82e (patch) | |
tree | 6c3a2aa8f01afb98c00460b5e1b5afffd4657f5d /src | |
parent | 1f172900086e32da2f38992c2e6a199bc2423857 (diff) | |
download | golang-c40d14204290410ba56a30eb0457e37a71dae82e.tar.gz |
Getgroups max on Linux is bigger than I thought.
R=iant
DELTA=3 (2 added, 0 deleted, 1 changed)
OCL=28994
CL=29003
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/os/user.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/os/user.go b/src/lib/os/user.go index 1549abdcd..194aa50e4 100644 --- a/src/lib/os/user.go +++ b/src/lib/os/user.go @@ -44,7 +44,9 @@ func Getgroups() ([]int, os.Error) { return nil, ErrnoToError(err); } - if r1 < 0 || r1 > 1024 { // the current max is 16; 1024 is a future-proof sanity check + // Sanity check group count. + // On Linux, max is 1<<16; on BSD, OS X, max is 16. + if r1 < 0 || r1 > 1<<20 { return nil, EINVAL; } a := make([]int, r1); |