int afs_osicred_initialized = 0;
+#ifndef AFS_FBSD80_ENV /* cr_groups is now malloc()'d */
afs_ucred_t afs_osi_cred;
+#endif
afs_lock_t afs_xosi; /* lock is for tvattr */
extern struct osi_dev cacheDev;
extern struct mount *afs_cacheVfsp;
setpag(struct proc *proc, struct ucred **cred, afs_uint32 pagvalue,
afs_uint32 * newpag, int change_parent)
{
+#ifdef AFS_FBSD80_ENV
+ gid_t *gidset;
+ int gidset_len = ngroups_max;
+#else
gid_t gidset[NGROUPS];
+ int gidset_len = NGROUPS;
+#endif
int ngroups, code;
int j;
AFS_STATCNT(setpag);
- ngroups = afs_getgroups(*cred, NGROUPS, gidset);
+#ifdef AFS_FBSD80_ENV
+ gidset = osi_Alloc(gidset_len * sizeof(gid_t));
+#endif
+ ngroups = afs_getgroups(*cred, gidset_len, gidset);
if (afs_get_pag_from_groups(gidset[1], gidset[2]) == NOPAG) {
/* We will have to shift grouplist to make room for pag */
- if (ngroups + 2 > NGROUPS) {
+ if (ngroups + 2 > gidset_len) {
return (E2BIG);
}
for (j = ngroups - 1; j >= 1; j--) {
*newpag = (pagvalue == -1 ? genpag() : pagvalue);
afs_get_groups_from_pag(*newpag, &gidset[1], &gidset[2]);
code = afs_setgroups(proc, cred, ngroups, gidset, change_parent);
+#ifdef AFS_FBSD80_ENV
+ osi_Free(gidset, gidset_len * sizeof(gid_t));
+#endif
return code;
}
#ifdef AFS_AIX_ENV
newcred->cr_ngrps = 2;
#elif !defined(AFS_LINUX26_ENV) && !defined(AFS_SUN510_ENV)
-# if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_LINUX22_ENV)
+# if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_LINUX22_ENV) || defined(AFS_FBSD80_ENV)
newcred->cr_ngroups = 2;
# else
for (i = 2; i < NGROUPS; i++)
afs_GCPAGs_perproc_count++;
+#if defined(AFS_FBSD80_ENV)
+ pcred = pproc->p_ucred; /* XXX locking (or just use thread creds) */
+#else
pcred = afs_osi_proc2cred(pproc);
+#endif
if (!pcred)
return;