linux26-pag-copy-groups-always-20050113

FIXES 17226

always copy the group list on linux 2.6
This commit is contained in:
Johan Danielsson 2005-01-14 01:34:54 +00:00 committed by Derrick Brashear
parent 7854052b38
commit 0cea4432fc
2 changed files with 20 additions and 12 deletions

View File

@ -155,23 +155,24 @@ setpag(cred_t ** cr, afs_uint32 pagvalue, afs_uint32 * newpag,
#if defined(AFS_LINUX26_ENV)
struct group_info *group_info;
gid_t g0, g1;
struct group_info *tmp;
int i;
int need_space = 0;
AFS_STATCNT(setpag);
group_info = afs_getgroups(*cr);
if (group_info->ngroups < 2
|| afs_get_pag_from_groups(GROUP_AT(group_info, 0),
GROUP_AT(group_info, 1)) == NOPAG) {
GROUP_AT(group_info, 1)) == NOPAG)
/* We will have to make sure group_info is big enough for pag */
struct group_info *tmp;
int i;
tmp = groups_alloc(group_info->ngroups + 2);
for (i = 0; i < group_info->ngroups; ++i)
GROUP_AT(tmp, i + 2) = GROUP_AT(group_info, i);
put_group_info(group_info);
group_info = tmp;
}
need_space = 2;
tmp = groups_alloc(group_info->ngroups + need_space);
for (i = 0; i < group_info->ngroups; ++i)
GROUP_AT(tmp, i + need_space) = GROUP_AT(group_info, i);
group_info = tmp;
*newpag = (pagvalue == -1 ? genpag() : pagvalue);
afs_get_groups_from_pag(*newpag, &g0, &g1);

View File

@ -11,8 +11,15 @@ i[3456]86)
esac
;;
ia64)
echo ia64_linux24
;;
case $KVERS in
2.4*)
echo ia64_linux24
;;
2.6*)
echo ia64_linux26
;;
esac
;;
alpha)
case $KVERS in
2.2*)