diff options
| author | Hartmut Brandt <harti@FreeBSD.org> | 2007-06-14 20:07:35 +0000 |
|---|---|---|
| committer | Hartmut Brandt <harti@FreeBSD.org> | 2007-06-14 20:07:35 +0000 |
| commit | e62e610b7ded2cb4b8fa7d889f3046fed0f7cbf4 (patch) | |
| tree | 508cff6fe4b1e4fed7e9b6d7a150c1bf7c6af2e2 | |
| parent | 513edbb8b0956d316e547d81060e0cc023c4a4d3 (diff) | |
Notes
| -rw-r--r-- | lib/libc/rpc/auth_unix.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libc/rpc/auth_unix.c b/lib/libc/rpc/auth_unix.c index 3fcccd4a0619..5801015c25d1 100644 --- a/lib/libc/rpc/auth_unix.c +++ b/lib/libc/rpc/auth_unix.c @@ -189,15 +189,17 @@ authunix_create_default() char machname[MAXHOSTNAMELEN + 1]; uid_t uid; gid_t gid; - gid_t gids[NGRPS]; + gid_t gids[NGROUPS_MAX]; if (gethostname(machname, sizeof machname) == -1) abort(); machname[sizeof(machname) - 1] = 0; uid = geteuid(); gid = getegid(); - if ((len = getgroups(NGRPS, gids)) < 0) + if ((len = getgroups(NGROUPS_MAX, gids)) < 0) abort(); + if (len > NGRPS) + len = NGRPS; /* XXX: interface problem; those should all have been unsigned */ return (authunix_create(machname, (int)uid, (int)gid, len, (int *)gids)); |
