mirror of
https://git.openafs.org/openafs.git
synced 2025-01-31 05:27:44 +00:00
afs: Make ONEGROUP_ENV not Linux-specific
The functionality in AFS_LINUX26_ONEGROUP_ENV does not really need to be Linux-specific (it's just only implemented for Linux right now). Rename it to AFS_PAG_ONEGROUP_ENV, and remove some Linux-specific checks when checking for "onegroup" PAG GIDs. [mmeffie@sinenomine.net: Move AFS_PAG_ONEGROUP_ENV to param.h] Reviewed-on: https://gerrit.openafs.org/11978 Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Tested-by: BuildBot <buildbot@rampaginggeek.com> (cherry picked from commit ee08dbe37d9db4fe314bd88b9280bf73c92c37bd) Change-Id: Ifef8f833599eca4241b41035142e74f32e6efa99 Reviewed-on: https://gerrit.openafs.org/12525 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Reviewed-by: Mark Vitale <mvitale@sinenomine.net> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
This commit is contained in:
parent
4097d8c44c
commit
4096ee7a75
@ -26,7 +26,7 @@
|
|||||||
#include "afs/nfsclient.h"
|
#include "afs/nfsclient.h"
|
||||||
#include "osi_compat.h"
|
#include "osi_compat.h"
|
||||||
|
|
||||||
#ifdef AFS_LINUX26_ONEGROUP_ENV
|
#ifdef AFS_PAG_ONEGROUP_ENV
|
||||||
|
|
||||||
static afs_uint32
|
static afs_uint32
|
||||||
afs_linux_pag_from_groups(struct group_info *group_info) {
|
afs_linux_pag_from_groups(struct group_info *group_info) {
|
||||||
|
@ -15,11 +15,6 @@
|
|||||||
#ifndef OSI_MACHDEP_H_
|
#ifndef OSI_MACHDEP_H_
|
||||||
#define OSI_MACHDEP_H_
|
#define OSI_MACHDEP_H_
|
||||||
|
|
||||||
#include <linux/version.h>
|
|
||||||
#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 */
|
/* Only needed for xdr.h in glibc 2.1.x */
|
||||||
#ifndef quad_t
|
#ifndef quad_t
|
||||||
# define quad_t __quad_t
|
# define quad_t __quad_t
|
||||||
|
@ -448,7 +448,7 @@ extern afs_ucred_t afs_osi_cred, *afs_osi_credp;
|
|||||||
#define osi_curcred() (u.u_cred)
|
#define osi_curcred() (u.u_cred)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef AFS_LINUX26_ONEGROUP_ENV
|
#ifdef AFS_PAG_ONEGROUP_ENV
|
||||||
#define AFS_NUMPAGGROUPS 1
|
#define AFS_NUMPAGGROUPS 1
|
||||||
#else
|
#else
|
||||||
#define AFS_NUMPAGGROUPS 2
|
#define AFS_NUMPAGGROUPS 2
|
||||||
|
@ -382,7 +382,7 @@ afs_setpag_val(int pagval)
|
|||||||
return (code);
|
return (code);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef AFS_LINUX26_ONEGROUP_ENV
|
#ifndef AFS_PAG_ONEGROUP_ENV
|
||||||
int
|
int
|
||||||
afs_getpag_val(void)
|
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_uint32
|
||||||
afs_get_pag_from_groups(gid_t g0a, gid_t g1a)
|
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;
|
*g1p = g1 + 0x3f00;
|
||||||
}
|
}
|
||||||
#else
|
#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);
|
AFS_STATCNT(afs_get_groups_from_pag);
|
||||||
*g0p = pag;
|
*g0p = pag;
|
||||||
|
@ -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[0] = g0;
|
||||||
newcred->cr_groupset.gs_union.un_groups[1] = g1;
|
newcred->cr_groupset.gs_union.un_groups[1] = g1;
|
||||||
#elif defined(AFS_LINUX26_ENV)
|
#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 */
|
afs_set_cr_group_info(newcred, groups_alloc(1)); /* nothing sets this */
|
||||||
l = (((g0-0x3f00) & 0x3fff) << 14) | ((g1-0x3f00) & 0x3fff);
|
l = (((g0-0x3f00) & 0x3fff) << 14) | ((g1-0x3f00) & 0x3fff);
|
||||||
h = ((g0-0x3f00) >> 14);
|
h = ((g0-0x3f00) >> 14);
|
||||||
|
@ -817,14 +817,14 @@ ktc_curpag(void)
|
|||||||
afs_uint32 g0, g1;
|
afs_uint32 g0, g1;
|
||||||
afs_uint32 h, l, ret;
|
afs_uint32 h, l, ret;
|
||||||
int ngroups;
|
int ngroups;
|
||||||
#ifdef AFS_LINUX26_ENV
|
#ifdef AFS_PAG_ONEGROUP_ENV
|
||||||
int i;
|
int i;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ngroups = getgroups(sizeof groups / sizeof groups[0], groups);
|
ngroups = getgroups(sizeof groups / sizeof groups[0], groups);
|
||||||
|
|
||||||
#ifdef AFS_LINUX26_ENV
|
#ifdef AFS_PAG_ONEGROUP_ENV
|
||||||
/* check for AFS_LINUX26_ONEGROUP_ENV PAGs */
|
/* Check for one-group PAGs. */
|
||||||
for (i = 0; i < ngroups; i++) {
|
for (i = 0; i < ngroups; i++) {
|
||||||
if (((groups[i] >> 24) & 0xff) == 'A') {
|
if (((groups[i] >> 24) & 0xff) == 'A') {
|
||||||
return groups[i];
|
return groups[i];
|
||||||
|
@ -13,6 +13,8 @@
|
|||||||
#ifndef UKERNEL
|
#ifndef UKERNEL
|
||||||
|
|
||||||
/* This section for kernel libafs compiles only */
|
/* This section for kernel libafs compiles only */
|
||||||
|
#include <linux/version.h>
|
||||||
|
|
||||||
#define AFS_LINUX20_ENV 1
|
#define AFS_LINUX20_ENV 1
|
||||||
#define AFS_LINUX22_ENV 1
|
#define AFS_LINUX22_ENV 1
|
||||||
#define AFS_LINUX24_ENV 1
|
#define AFS_LINUX24_ENV 1
|
||||||
@ -28,6 +30,9 @@
|
|||||||
#define AFS_USERSPACE_IP_ADDR 1
|
#define AFS_USERSPACE_IP_ADDR 1
|
||||||
#define RXK_LISTENER_ENV 1
|
#define RXK_LISTENER_ENV 1
|
||||||
#define AFS_GCPAGS 1 /* Set to Userdisabled, allow sysctl to override */
|
#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_FFS 1 /* Use system's ffs */
|
||||||
#define AFS_HAVE_STATVFS 0 /* System doesn't support statvfs */
|
#define AFS_HAVE_STATVFS 0 /* System doesn't support statvfs */
|
||||||
#define AFS_VM_RDWR_ENV 1 /* read/write implemented via VM */
|
#define AFS_VM_RDWR_ENV 1 /* read/write implemented via VM */
|
||||||
|
@ -133,7 +133,7 @@ os_haspag(void)
|
|||||||
gid_t *groups;
|
gid_t *groups;
|
||||||
afs_uint32 g0, g1;
|
afs_uint32 g0, g1;
|
||||||
afs_uint32 h, l, pag;
|
afs_uint32 h, l, pag;
|
||||||
# ifdef AFS_LINUX26_ENV
|
# ifdef AFS_PAG_ONEGROUP_ENV
|
||||||
int i;
|
int i;
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
@ -143,8 +143,8 @@ os_haspag(void)
|
|||||||
return 0;
|
return 0;
|
||||||
ngroups = getgroups(ngroups, groups);
|
ngroups = getgroups(ngroups, groups);
|
||||||
|
|
||||||
/* Check for AFS_LINUX26_ONEGROUP_ENV PAGs. */
|
/* Check for one-group PAGs. */
|
||||||
# ifdef AFS_LINUX26_ENV
|
# ifdef AFS_PAG_ONEGROUP_ENV
|
||||||
for (i = 0; i < ngroups; i++)
|
for (i = 0; i < ngroups; i++)
|
||||||
if (((groups[i] >> 24) & 0xff) == 'A') {
|
if (((groups[i] >> 24) & 0xff) == 'A') {
|
||||||
free(groups);
|
free(groups);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user