linux26-pag-copy-groups-always-20050113
authorJohan Danielsson <joda@pdc.kth.se>
Fri, 14 Jan 2005 01:34:54 +0000 (01:34 +0000)
committerDerrick Brashear <shadow@dementia.org>
Fri, 14 Jan 2005 01:34:54 +0000 (01:34 +0000)
FIXES 17226

always copy the group list on linux 2.6

src/afs/LINUX/osi_groups.c
src/packaging/Debian/kern-sysname

index 26fd2d2..33ea307 100644 (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);
index 6c51c9b..00964eb 100644 (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*)