Catch up to dynamically-sized cr_groups in FBSD80
authorBen Kaduk <kaduk@mit.edu>
Tue, 23 Mar 2010 02:35:51 +0000 (22:35 -0400)
committerDerrick Brashear <shadow@dementia.org>
Mon, 29 Mar 2010 04:34:31 +0000 (21:34 -0700)
commit7c6f94b365169cd643cbe03a23d14b2e35d429af
treedad57e24ca33884e1a90f2f7c7d761a89794ae1a
parent326ff2aa68082a804ffef7fb1187a26962be924e
Catch up to dynamically-sized cr_groups in FBSD80

In FreeBSD 8.0 and later, (struct ucred)->cr_groups is a pointer
to a dynamically-allocated array, and NGROUPS is now 1024 by default
(tuneable at boot).
Don't put a gid_t[NGROUPS] on the stack for the FBSD80_ENV case.
Also avoid keeping a function-local ucred structure (in
afs_osi_proc2cred()), by bypassing that function entirely
(though this accesses the process credentials directly, which may
require locking; thread credentials accesses can be safely done
lock-free).  Add an osi_Panic() to ensure that it stays that way.
Don't pretend that we have a useful afs_osi_cred to export.
Don't blindly overwrite NGROUPS past cr_groups.

Change-Id: I76295164a24bddf2782ab2fa662acd0e1b4855d6
Reviewed-on: http://gerrit.openafs.org/1665
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
src/afs/FBSD/osi_file.c
src/afs/FBSD/osi_groups.c
src/afs/afs_osi_gcpags.c
src/afs/afs_pioctl.c
src/afs/afs_user.c