2014-04-30 02:42:09 +00:00
|
|
|
dnl #
|
|
|
|
dnl # 2.6.39 API change,
|
|
|
|
dnl # The is_owner_or_cap() macro was renamed to inode_owner_or_capable(),
|
|
|
|
dnl # This is used for permission checks in the xattr and file attribute call
|
|
|
|
dnl # paths.
|
|
|
|
dnl #
|
2021-05-22 00:38:17 +00:00
|
|
|
dnl # 5.12 API change,
|
|
|
|
dnl # inode_owner_or_capable() now takes struct user_namespace *
|
|
|
|
dnl # to support idmapped mounts
|
|
|
|
dnl #
|
2019-10-01 19:50:34 +00:00
|
|
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OWNER_OR_CAPABLE], [
|
|
|
|
ZFS_LINUX_TEST_SRC([inode_owner_or_capable], [
|
2014-04-30 02:42:09 +00:00
|
|
|
#include <linux/fs.h>
|
|
|
|
],[
|
|
|
|
struct inode *ip = NULL;
|
|
|
|
(void) inode_owner_or_capable(ip);
|
2019-10-01 19:50:34 +00:00
|
|
|
])
|
2021-03-20 04:00:59 +00:00
|
|
|
|
2023-04-10 21:15:36 +00:00
|
|
|
ZFS_LINUX_TEST_SRC([inode_owner_or_capable_userns], [
|
2021-03-20 04:00:59 +00:00
|
|
|
#include <linux/fs.h>
|
|
|
|
],[
|
|
|
|
struct inode *ip = NULL;
|
|
|
|
(void) inode_owner_or_capable(&init_user_ns, ip);
|
|
|
|
])
|
2023-04-10 21:15:36 +00:00
|
|
|
|
|
|
|
ZFS_LINUX_TEST_SRC([inode_owner_or_capable_mnt_idmap], [
|
|
|
|
#include <linux/fs.h>
|
|
|
|
#include <linux/mnt_idmapping.h>
|
|
|
|
],[
|
|
|
|
struct inode *ip = NULL;
|
|
|
|
(void) inode_owner_or_capable(&nop_mnt_idmap, ip);
|
|
|
|
])
|
2019-10-01 19:50:34 +00:00
|
|
|
])
|
|
|
|
|
|
|
|
AC_DEFUN([ZFS_AC_KERNEL_INODE_OWNER_OR_CAPABLE], [
|
|
|
|
AC_MSG_CHECKING([whether inode_owner_or_capable() exists])
|
|
|
|
ZFS_LINUX_TEST_RESULT([inode_owner_or_capable], [
|
2014-04-30 02:42:09 +00:00
|
|
|
AC_MSG_RESULT(yes)
|
2021-03-20 04:00:59 +00:00
|
|
|
AC_DEFINE(HAVE_INODE_OWNER_OR_CAPABLE, 1,
|
|
|
|
[inode_owner_or_capable() exists])
|
|
|
|
], [
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
|
|
|
|
AC_MSG_CHECKING(
|
|
|
|
[whether inode_owner_or_capable() takes user_ns])
|
2023-04-10 21:15:36 +00:00
|
|
|
ZFS_LINUX_TEST_RESULT([inode_owner_or_capable_userns], [
|
2021-03-20 04:00:59 +00:00
|
|
|
AC_MSG_RESULT(yes)
|
2023-04-10 21:15:36 +00:00
|
|
|
AC_DEFINE(HAVE_INODE_OWNER_OR_CAPABLE_USERNS, 1,
|
2021-03-20 04:00:59 +00:00
|
|
|
[inode_owner_or_capable() takes user_ns])
|
|
|
|
],[
|
2023-04-10 21:15:36 +00:00
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
AC_MSG_CHECKING(
|
|
|
|
[whether inode_owner_or_capable() takes mnt_idmap])
|
|
|
|
ZFS_LINUX_TEST_RESULT([inode_owner_or_capable_mnt_idmap], [
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
AC_DEFINE(HAVE_INODE_OWNER_OR_CAPABLE_IDMAP, 1,
|
|
|
|
[inode_owner_or_capable() takes mnt_idmap])
|
|
|
|
], [
|
|
|
|
ZFS_LINUX_TEST_ERROR([capability])
|
|
|
|
])
|
2021-03-20 04:00:59 +00:00
|
|
|
])
|
2014-04-30 02:42:09 +00:00
|
|
|
])
|
|
|
|
])
|