diff --git a/src/afs/LINUX/osi_groups.c b/src/afs/LINUX/osi_groups.c index ed6ab5ad80..de3671c3ac 100644 --- a/src/afs/LINUX/osi_groups.c +++ b/src/afs/LINUX/osi_groups.c @@ -26,7 +26,7 @@ #include "afs/nfsclient.h" #include "osi_compat.h" -#ifdef AFS_LINUX26_ONEGROUP_ENV +#ifdef AFS_PAG_ONEGROUP_ENV static afs_uint32 afs_linux_pag_from_groups(struct group_info *group_info) { diff --git a/src/afs/LINUX/osi_machdep.h b/src/afs/LINUX/osi_machdep.h index 4448fdcfdb..7b457ca603 100644 --- a/src/afs/LINUX/osi_machdep.h +++ b/src/afs/LINUX/osi_machdep.h @@ -15,11 +15,6 @@ #ifndef OSI_MACHDEP_H_ #define OSI_MACHDEP_H_ -#include -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,4) -# define AFS_LINUX26_ONEGROUP_ENV 1 -#endif - /* Only needed for xdr.h in glibc 2.1.x */ #ifndef quad_t # define quad_t __quad_t diff --git a/src/afs/afs_osi.h b/src/afs/afs_osi.h index d31f2ac6fe..a96f3ce15a 100644 --- a/src/afs/afs_osi.h +++ b/src/afs/afs_osi.h @@ -448,7 +448,7 @@ extern afs_ucred_t afs_osi_cred, *afs_osi_credp; #define osi_curcred() (u.u_cred) #endif -#ifdef AFS_LINUX26_ONEGROUP_ENV +#ifdef AFS_PAG_ONEGROUP_ENV #define AFS_NUMPAGGROUPS 1 #else #define AFS_NUMPAGGROUPS 2 diff --git a/src/afs/afs_osi_pag.c b/src/afs/afs_osi_pag.c index 9b8c5b52f3..f722e62277 100644 --- a/src/afs/afs_osi_pag.c +++ b/src/afs/afs_osi_pag.c @@ -382,7 +382,7 @@ afs_setpag_val(int pagval) return (code); } -#ifndef AFS_LINUX26_ONEGROUP_ENV +#ifndef AFS_PAG_ONEGROUP_ENV int afs_getpag_val(void) { @@ -535,7 +535,7 @@ afs_DestroyReq(struct vrequest *av) } } -#ifndef AFS_LINUX26_ONEGROUP_ENV +#ifndef AFS_PAG_ONEGROUP_ENV afs_uint32 afs_get_pag_from_groups(gid_t g0a, gid_t g1a) { @@ -582,7 +582,8 @@ afs_get_groups_from_pag(afs_uint32 pag, gid_t * g0p, gid_t * g1p) *g1p = g1 + 0x3f00; } #else -void afs_get_groups_from_pag(afs_uint32 pag, gid_t *g0p, gid_t *g1p) +void +afs_get_groups_from_pag(afs_uint32 pag, gid_t *g0p, gid_t *g1p) { AFS_STATCNT(afs_get_groups_from_pag); *g0p = pag; diff --git a/src/afs/afs_pioctl.c b/src/afs/afs_pioctl.c index 19a48650e0..071f7af5cf 100644 --- a/src/afs/afs_pioctl.c +++ b/src/afs/afs_pioctl.c @@ -4561,7 +4561,7 @@ HandleClientContext(struct afs_ioctl *ablob, int *com, newcred->cr_groupset.gs_union.un_groups[0] = g0; newcred->cr_groupset.gs_union.un_groups[1] = g1; #elif defined(AFS_LINUX26_ENV) -# ifdef AFS_LINUX26_ONEGROUP_ENV +# ifdef AFS_PAG_ONEGROUP_ENV afs_set_cr_group_info(newcred, groups_alloc(1)); /* nothing sets this */ l = (((g0-0x3f00) & 0x3fff) << 14) | ((g1-0x3f00) & 0x3fff); h = ((g0-0x3f00) >> 14); diff --git a/src/auth/ktc.c b/src/auth/ktc.c index 4630410f9c..d0decba279 100644 --- a/src/auth/ktc.c +++ b/src/auth/ktc.c @@ -817,14 +817,14 @@ ktc_curpag(void) afs_uint32 g0, g1; afs_uint32 h, l, ret; int ngroups; -#ifdef AFS_LINUX26_ENV +#ifdef AFS_PAG_ONEGROUP_ENV int i; #endif ngroups = getgroups(sizeof groups / sizeof groups[0], groups); -#ifdef AFS_LINUX26_ENV - /* check for AFS_LINUX26_ONEGROUP_ENV PAGs */ +#ifdef AFS_PAG_ONEGROUP_ENV + /* Check for one-group PAGs. */ for (i = 0; i < ngroups; i++) { if (((groups[i] >> 24) & 0xff) == 'A') { return groups[i]; diff --git a/src/config/param.linux26.h b/src/config/param.linux26.h index 3e69ee3159..78fa75a38b 100644 --- a/src/config/param.linux26.h +++ b/src/config/param.linux26.h @@ -13,6 +13,8 @@ #ifndef UKERNEL /* This section for kernel libafs compiles only */ +#include + #define AFS_LINUX20_ENV 1 #define AFS_LINUX22_ENV 1 #define AFS_LINUX24_ENV 1 @@ -28,6 +30,9 @@ #define AFS_USERSPACE_IP_ADDR 1 #define RXK_LISTENER_ENV 1 #define AFS_GCPAGS 1 /* Set to Userdisabled, allow sysctl to override */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,4) +# define AFS_PAG_ONEGROUP_ENV 1 +#endif #define AFS_HAVE_FFS 1 /* Use system's ffs */ #define AFS_HAVE_STATVFS 0 /* System doesn't support statvfs */ #define AFS_VM_RDWR_ENV 1 /* read/write implemented via VM */ diff --git a/src/kopenafs/kopenafs.c b/src/kopenafs/kopenafs.c index dde7b6bca5..02b3f94731 100644 --- a/src/kopenafs/kopenafs.c +++ b/src/kopenafs/kopenafs.c @@ -133,7 +133,7 @@ os_haspag(void) gid_t *groups; afs_uint32 g0, g1; afs_uint32 h, l, pag; -# ifdef AFS_LINUX26_ENV +# ifdef AFS_PAG_ONEGROUP_ENV int i; # endif @@ -143,8 +143,8 @@ os_haspag(void) return 0; ngroups = getgroups(ngroups, groups); - /* Check for AFS_LINUX26_ONEGROUP_ENV PAGs. */ -# ifdef AFS_LINUX26_ENV + /* Check for one-group PAGs. */ +# ifdef AFS_PAG_ONEGROUP_ENV for (i = 0; i < ngroups; i++) if (((groups[i] >> 24) & 0xff) == 'A') { free(groups);