X-Git-Url: http://git.openafs.org/?p=openafs.git;a=blobdiff_plain;f=src%2Fafs%2FLINUX%2Fosi_cred.c;h=266929c951a344af938afc9018535dd55b178a4b;hp=3599aa331380af15ac69c1b96aee8ae09e5f4408;hb=109927bf6f54b58b76ac48ba41c2012c74937fed;hpb=b7cc8bf2850c5650a9e47416af8bd488f9be9161 diff --git a/src/afs/LINUX/osi_cred.c b/src/afs/LINUX/osi_cred.c index 3599aa3..266929c 100644 --- a/src/afs/LINUX/osi_cred.c +++ b/src/afs/LINUX/osi_cred.c @@ -42,9 +42,7 @@ crfree(cred_t * cr) return; } -#if defined(AFS_LINUX26_ENV) put_group_info(cr->cr_group_info); -#endif kfree(cr); } @@ -61,13 +59,8 @@ crdup(cred_t * cr) tmp->cr_gid = cr->cr_gid; tmp->cr_rgid = cr->cr_rgid; -#if defined(AFS_LINUX26_ENV) get_group_info(cr->cr_group_info); tmp->cr_group_info = cr->cr_group_info; -#else - memcpy(tmp->cr_groups, cr->cr_groups, NGROUPS * sizeof(gid_t)); - tmp->cr_ngroups = cr->cr_ngroups; -#endif return tmp; } @@ -82,23 +75,19 @@ crref(void) cr->cr_gid = current_fsgid(); cr->cr_rgid = current_gid(); -#if defined(AFS_LINUX26_ENV) task_lock(current); get_group_info(current_group_info()); cr->cr_group_info = current_group_info(); task_unlock(current); -#else - memcpy(cr->cr_groups, current->groups, NGROUPS * sizeof(gid_t)); - cr->cr_ngroups = current->ngroups; -#endif + return cr; } - /* Set the cred info into the current task */ void crset(cred_t * cr) { + struct group_info *old_info; #if defined(STRUCT_TASK_HAS_CRED) struct cred *new_creds; @@ -119,9 +108,6 @@ crset(cred_t * cr) current->fsgid = cr->cr_gid; current->gid = cr->cr_rgid; #endif -#if defined(AFS_LINUX26_ENV) -{ - struct group_info *old_info; /* using set_current_groups() will sort the groups */ get_group_info(cr->cr_group_info); @@ -139,8 +125,3 @@ crset(cred_t * cr) put_group_info(old_info); } -#else - memcpy(current->groups, cr->cr_groups, NGROUPS * sizeof(gid_t)); - current->ngroups = cr->cr_ngroups; -#endif -}