mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-23 19:04:45 +03:00
Linux 4.10 compat: has_capability()
Stock kernels older than 4.10 do not export the has_capability()
function which is required by commit e59a377. To avoid breaking
the build on older kernels revert to the safe legacy behavior and
return EACCES when privileges cannot be checked.
Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
Reviewed-by: Matt Ahrens <matt@delphix.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #10565
Closes #10573
This commit is contained in:
@@ -30,6 +30,18 @@
|
||||
|
||||
verify_runnable "both"
|
||||
|
||||
#
|
||||
# The has_capability() function was first exported in the 4.10 Linux kernel
|
||||
# then backported to some LTS kernels. Prior to this change there was no
|
||||
# mechanism to perform the needed permission check. Therefore, this test
|
||||
# is expected to fail on older kernels and is skipped.
|
||||
#
|
||||
if is_linux; then
|
||||
if [[ $(linux_version) -lt $(linux_version "4.10") ]]; then
|
||||
log_unsupported "Requires has_capability() kernel function"
|
||||
fi
|
||||
fi
|
||||
|
||||
function setup
|
||||
{
|
||||
# We can't delegate 'mount' privs under Linux: to avoid issues with
|
||||
|
||||
@@ -31,6 +31,18 @@
|
||||
|
||||
verify_runnable "both"
|
||||
|
||||
#
|
||||
# The has_capability() function was first exported in the 4.10 Linux kernel
|
||||
# then backported to some LTS kernels. Prior to this change there was no
|
||||
# mechanism to perform the needed permission check. Therefore, this test
|
||||
# is expected to fail on older kernels and is skipped.
|
||||
#
|
||||
if is_linux; then
|
||||
if [[ $(linux_version) -lt $(linux_version "4.10") ]]; then
|
||||
log_unsupported "Requires has_capability() kernel function"
|
||||
fi
|
||||
fi
|
||||
|
||||
function setup
|
||||
{
|
||||
# We can't delegate 'mount' privs under Linux: to avoid issues with
|
||||
|
||||
Reference in New Issue
Block a user