linux-pag-deal-with-no-groups-20020926
authorNick Ingolia <ingolia@mit.edu>
Thu, 26 Sep 2002 07:33:16 +0000 (07:33 +0000)
committerDerrick Brashear <shadow@dementia.org>
Thu, 26 Sep 2002 07:33:16 +0000 (07:33 +0000)
If ngroups in the parent is 0, but the first two elements of the groups
array represent a valid PAG (perhaps because they weren't zeroed), then
set_pag_in_parent won't add 2 to ngroups and the parent process won't
join the PAG.

src/afs/LINUX/osi_groups.c

index 922fddf..e031bd4 100644 (file)
@@ -42,7 +42,7 @@ int set_pag_in_parent(int pag, int g0, int g1)
     gp = current->p_pptr->groups;
 
 
-    if (afs_get_pag_from_groups(gp[0], gp[1]) == NOPAG) {
+    if ((ngroups < 2) || (afs_get_pag_from_groups(gp[0], gp[1]) == NOPAG)) {
        /* We will have to shift grouplist to make room for pag */
        if (ngroups + 2 > NGROUPS) {
            return EINVAL;