]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
use-NGROUPS-MAX-instead-of-constant-for-curpag-getgroups-call-20011110
authorThomas Mueller <thomas.mueller@hrz.tu-chemnitz.de>
Sat, 10 Nov 2001 22:36:45 +0000 (22:36 +0000)
committerDerrick Brashear <shadow@dementia.org>
Sat, 10 Nov 2001 22:36:45 +0000 (22:36 +0000)
NGROUPS_MAX instead of 30 used so we get all groups from getgroups

src/pam/afs_util.c
src/sys/pagsh.c

index 67a9fd3538c74f603d0a3642f563627149d085de..872548766635e41fbb92ff90717a174480a1fe53 100644 (file)
@@ -166,7 +166,7 @@ out:
 /* get the current AFS pag for the calling process */
 static afs_int32 curpag()
 {
-   gid_t groups[30];
+   gid_t groups[NGROUPS_MAX];
    afs_uint32 g0, g1;
    afs_uint32 h, l, ret;
       
index 581d925e8b2cb511ee5d0dd34d0e5e77b4b57cff..de09c0e474250cd3872d811893b0a4a4db277ca2 100644 (file)
@@ -84,11 +84,11 @@ char **argv;
 
 static afs_uint32 curpag()
 {
-    afs_uint32 groups[30];
+    afs_uint32 groups[NGROUPS_MAX];
     afs_uint32 g0, g1;
     afs_uint32 h, l, ret;
 
-    if (getgroups(30, groups) < 2) return 0;
+    if (getgroups(sizeof groups/sizeof groups[0], groups) < 2) return 0;
 
     g0 = groups[0] & 0xffff;
     g1 = groups[1] & 0xffff;