Linux: Fix set_cr_group_info and cr_group_info
authorSimon Wilkinson <sxw@inf.ed.ac.uk>
Sat, 12 Jun 2010 21:59:23 +0000 (22:59 +0100)
committerDerrick Brashear <shadow@dementia.org>
Sun, 13 Jun 2010 00:19:26 +0000 (17:19 -0700)
Commit dc85abca renamed set_cr_group_info to afs_set_cr_group_info
and cr_group_info to afs_cr_group_info, but didn't catch all call
sites. In particular, those in the NFS translator, in non-keyring
code paths, and in the 2.4 code, were missed.

Thanks to Adam Megacz for the bug report on openafs-info.

Change-Id: I71f8cc27d499c98d164d05e02f7d5b2c5d4c1933
Reviewed-on: http://gerrit.openafs.org/2127
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

src/afs/LINUX/osi_gcpags.c
src/afs/LINUX/osi_nfssrv.c
src/afs/LINUX24/osi_machdep.h
src/afs/afs_pioctl.c

index 86c7199..36f5cdd 100644 (file)
@@ -105,10 +105,10 @@ afs_osi_proc2cred(afs_proc_t * pr)
 #if defined(AFS_LINUX26_ENV)
 #if defined(STRUCT_TASK_STRUCT_HAS_CRED)
        get_group_info(pr->cred->group_info);
-       set_cr_group_info(&cr, pr->cred->group_info);
+       afs_set_cr_group_info(&cr, pr->cred->group_info);
 #else
        get_group_info(pr->group_info);
-       set_cr_group_info(&cr, pr->group_info);
+       afs_set_cr_group_info(&cr, pr->group_info);
 #endif
 #else
        cr.cr_ngroups = pr->ngroups;
index 4faec6c..4c0553b 100644 (file)
@@ -122,12 +122,12 @@ svcauth_afs_accept(struct svc_rqst *rqstp, u32 *authp)
     ns->client_addrlen = rqstp->rq_addrlen;
     ns->client_uid     = afs_cr_uid(&rqstp->rq_cred);
     ns->client_gid     = afs_cr_gid(&rqstp->rq_cred);
-    if (cr_group_info(&rqstp->rq_cred)->ngroups > 0)
-       ns->client_g0   = GROUP_AT(cr_group_info(&rqstp->rq_cred), 0);
+    if (afs_cr_group_info(&rqstp->rq_cred)->ngroups > 0)
+       ns->client_g0   = GROUP_AT(afs_cr_group_info(&rqstp->rq_cred), 0);
     else
        ns->client_g0   = -1;
-    if (cr_group_info(&rqstp->rq_cred)->ngroups > 1)
-       ns->client_g1   = GROUP_AT(cr_group_info(&rqstp->rq_cred), 1);
+    if (afs_cr_group_info(&rqstp->rq_cred)->ngroups > 1)
+       ns->client_g1   = GROUP_AT(afs_cr_group_info(&rqstp->rq_cred), 1);
     else
        ns->client_g1   = -1;
 
@@ -140,8 +140,8 @@ svcauth_afs_accept(struct svc_rqst *rqstp, u32 *authp)
     credp = crget();
     afs_set_cr_uid(credp, afs_cr_uid(&rqstp->rq_cred));
     afs_set_cr_gid(credp, afs_cr_gid(&rqstp->rq_cred));
-    get_group_info(cr_group_info(&rqstp->rq_cred));
-    set_cr_group_info(credp, cr_group_info(&rqstp->rq_cred));
+    get_group_info(afs_cr_group_info(&rqstp->rq_cred));
+    afs_set_cr_group_info(credp, afs_cr_group_info(&rqstp->rq_cred));
 
     /* avoid creating wildcard entries by mapping anonymous
      * clients to afs_nobody */
index 63babdc..bab702f 100644 (file)
@@ -168,9 +168,9 @@ typedef struct afs_cred {           /* maps to task field: */
 typedef struct afs_cred afs_ucred_t;
 typedef struct task_struct afs_proc_t;
 
-#define cr_group_info(cred) ((cred)->cr_group_info)
+#define afs_cr_group_info(cred) ((cred)->cr_group_info)
 static inline void
-set_cr_group_info(afs_ucred_t *cred, struct group_info *group_info) {
+afs_set_cr_group_info(afs_ucred_t *cred, struct group_info *group_info) {
     cred->cr_group_info = group_info;
 }
 
index 76aaaf6..2f46e17 100644 (file)
@@ -4491,15 +4491,15 @@ HandleClientContext(struct afs_ioctl *ablob, int *com,
     newcred->cr_groupset.gs_union.un_groups[1] = g1;
 #elif defined(AFS_LINUX26_ENV)
 # ifdef AFS_LINUX26_ONEGROUP_ENV
-    set_cr_group_info(newcred, groups_alloc(1)); /* nothing sets this */
+    afs_set_cr_group_info(newcred, groups_alloc(1)); /* nothing sets this */
     l = (((g0-0x3f00) & 0x3fff) << 14) | ((g1-0x3f00) & 0x3fff);
     h = ((g0-0x3f00) >> 14);
     h = ((g1-0x3f00) >> 14) + h + h + h;
-    GROUP_AT(cr_group_info(newcred), 0) = ((h << 28) | l);
+    GROUP_AT(afs_cr_group_info(newcred), 0) = ((h << 28) | l);
 # else
-    set_cr_group_info(newcred, groups_alloc(2));
-    GROUP_AT(cr_group_info(newcred), 0) = g0;
-    GROUP_AT(cr_group_info(newcred), 1) = g1;
+    afs_set_cr_group_info(newcred, groups_alloc(2));
+    GROUP_AT(afs_cr_group_info(newcred), 0) = g0;
+    GROUP_AT(afs_cr_group_info(newcred), 1) = g1;
 # endif
 #elif defined(AFS_SUN510_ENV)
     gids[0] = g0;