mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2025-01-31 04:14:21 +03:00
config: remove HAVE_GROUP_INFO_GID
Sponsored-by: https://despairlabs.com/sponsor/ Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Tony Hutter <hutter2@llnl.gov> Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de> Signed-off-by: Rob Norris <robn@despairlabs.com> Closes #16479
This commit is contained in:
parent
5d537c7660
commit
c9c1262b67
@ -1,22 +0,0 @@
|
|||||||
dnl #
|
|
||||||
dnl # 4.9 API change
|
|
||||||
dnl # group_info changed from 2d array via >blocks to 1d array via ->gid
|
|
||||||
dnl #
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_GROUP_INFO_GID], [
|
|
||||||
ZFS_LINUX_TEST_SRC([group_info_gid], [
|
|
||||||
#include <linux/cred.h>
|
|
||||||
],[
|
|
||||||
struct group_info gi __attribute__ ((unused)) = {};
|
|
||||||
gi.gid[0] = KGIDT_INIT(0);
|
|
||||||
])
|
|
||||||
])
|
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_GROUP_INFO_GID], [
|
|
||||||
AC_MSG_CHECKING([whether group_info->gid exists])
|
|
||||||
ZFS_LINUX_TEST_RESULT([group_info_gid], [
|
|
||||||
AC_MSG_RESULT(yes)
|
|
||||||
AC_DEFINE(HAVE_GROUP_INFO_GID, 1, [group_info->gid exists])
|
|
||||||
],[
|
|
||||||
AC_MSG_RESULT(no)
|
|
||||||
])
|
|
||||||
])
|
|
@ -52,7 +52,6 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [
|
|||||||
ZFS_AC_KERNEL_SRC_WAIT
|
ZFS_AC_KERNEL_SRC_WAIT
|
||||||
ZFS_AC_KERNEL_SRC_INODE_TIMES
|
ZFS_AC_KERNEL_SRC_INODE_TIMES
|
||||||
ZFS_AC_KERNEL_SRC_INODE_LOCK
|
ZFS_AC_KERNEL_SRC_INODE_LOCK
|
||||||
ZFS_AC_KERNEL_SRC_GROUP_INFO_GID
|
|
||||||
ZFS_AC_KERNEL_SRC_RW
|
ZFS_AC_KERNEL_SRC_RW
|
||||||
ZFS_AC_KERNEL_SRC_TIMER_SETUP
|
ZFS_AC_KERNEL_SRC_TIMER_SETUP
|
||||||
ZFS_AC_KERNEL_SRC_SUPER_USER_NS
|
ZFS_AC_KERNEL_SRC_SUPER_USER_NS
|
||||||
@ -185,7 +184,6 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [
|
|||||||
ZFS_AC_KERNEL_WAIT
|
ZFS_AC_KERNEL_WAIT
|
||||||
ZFS_AC_KERNEL_INODE_TIMES
|
ZFS_AC_KERNEL_INODE_TIMES
|
||||||
ZFS_AC_KERNEL_INODE_LOCK
|
ZFS_AC_KERNEL_INODE_LOCK
|
||||||
ZFS_AC_KERNEL_GROUP_INFO_GID
|
|
||||||
ZFS_AC_KERNEL_RW
|
ZFS_AC_KERNEL_RW
|
||||||
ZFS_AC_KERNEL_TIMER_SETUP
|
ZFS_AC_KERNEL_TIMER_SETUP
|
||||||
ZFS_AC_KERNEL_SUPER_USER_NS
|
ZFS_AC_KERNEL_SUPER_USER_NS
|
||||||
|
@ -74,26 +74,13 @@ crgetngroups(const cred_t *cr)
|
|||||||
|
|
||||||
gi = cr->group_info;
|
gi = cr->group_info;
|
||||||
rc = gi->ngroups;
|
rc = gi->ngroups;
|
||||||
#ifndef HAVE_GROUP_INFO_GID
|
|
||||||
/*
|
|
||||||
* For Linux <= 4.8,
|
|
||||||
* crgetgroups will only returns gi->blocks[0], which contains only
|
|
||||||
* the first NGROUPS_PER_BLOCK groups.
|
|
||||||
*/
|
|
||||||
if (rc > NGROUPS_PER_BLOCK) {
|
|
||||||
WARN_ON_ONCE(1);
|
|
||||||
rc = NGROUPS_PER_BLOCK;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
return (rc);
|
return (rc);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Return an array of supplemental gids. The returned address is safe
|
* Return an array of supplemental gids. The returned address is safe
|
||||||
* to use as long as the caller has taken a reference with crhold().
|
* to use as long as the caller has taken a reference with crhold().
|
||||||
*
|
|
||||||
* Linux 4.9 API change, group_info changed from 2d array via ->blocks to 1d
|
|
||||||
* array via ->gid.
|
|
||||||
*/
|
*/
|
||||||
gid_t *
|
gid_t *
|
||||||
crgetgroups(const cred_t *cr)
|
crgetgroups(const cred_t *cr)
|
||||||
@ -102,12 +89,8 @@ crgetgroups(const cred_t *cr)
|
|||||||
gid_t *gids = NULL;
|
gid_t *gids = NULL;
|
||||||
|
|
||||||
gi = cr->group_info;
|
gi = cr->group_info;
|
||||||
#ifdef HAVE_GROUP_INFO_GID
|
|
||||||
gids = KGIDP_TO_SGIDP(gi->gid);
|
gids = KGIDP_TO_SGIDP(gi->gid);
|
||||||
#else
|
|
||||||
if (gi->nblocks > 0)
|
|
||||||
gids = KGIDP_TO_SGIDP(gi->blocks[0]);
|
|
||||||
#endif
|
|
||||||
return (gids);
|
return (gids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user