]> git.proxmox.com Git - mirror_zfs.git/commit - tests/runfiles/linux.run
Add `zfs allow` and `zfs unallow` support
authorBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 7 Jun 2016 16:16:52 +0000 (09:16 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 7 Jun 2016 16:16:52 +0000 (09:16 -0700)
commitf74b821a6696fef9e9953aae05941e99bf83800e
tree1f04aa261cc8f20a38e60f8e289cbf6daadde078
parent2627e7524581f5189599df6daccf830e23e89a69
Add `zfs allow` and `zfs unallow` support

ZFS allows for specific permissions to be delegated to normal users
with the `zfs allow` and `zfs unallow` commands.  In addition, non-
privileged users should be able to run all of the following commands:

  * zpool [list | iostat | status | get]
  * zfs [list | get]

Historically this functionality was not available on Linux.  In order
to add it the secpolicy_* functions needed to be implemented and mapped
to the equivalent Linux capability.  Only then could the permissions on
the `/dev/zfs` be relaxed and the internal ZFS permission checks used.

Even with this change some limitations remain.  Under Linux only the
root user is allowed to modify the namespace (unless it's a private
namespace).  This means the mount, mountpoint, canmount, unmount,
and remount delegations cannot be supported with the existing code.  It
may be possible to add this functionality in the future.

This functionality was validated with the cli_user and delegation test
cases from the ZFS Test Suite.  These tests exhaustively verify each
of the supported permissions which can be delegated and ensures only
an authorized user can perform it.

Two minor bug fixes were required for test-running.py.  First, the
Timer() object cannot be safely created in a `try:` block when there
is an unconditional `finally` block which references it.  Second,
when running as a normal user also check for scripts using the
both the .ksh and .sh suffixes.

Finally, existing users who are simulating delegations by setting
group permissions on the /dev/zfs device should revert that
customization when updating to a version with this change.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes #362
Closes #434
Closes #4100
Closes #4394
Closes #4410
Closes #4487
78 files changed:
cmd/zfs/zfs_main.c
cmd/zpool/zpool_main.c
include/sys/Makefile.am
include/sys/policy.h [new file with mode: 0644]
include/sys/zfs_context.h
lib/libspl/include/Makefile.am
lib/libspl/include/priv.h [deleted file]
lib/libzfs/libzfs_dataset.c
lib/libzpool/kernel.c
man/man8/zfs.8
module/zfs/Makefile.in
module/zfs/dmu_objset.c
module/zfs/dmu_send.c
module/zfs/dsl_dataset.c
module/zfs/policy.c [new file with mode: 0644]
module/zfs/zfs_acl.c
module/zfs/zfs_ctldir.c
module/zfs/zfs_fuid.c
module/zfs/zfs_ioctl.c
scripts/common.sh.in
scripts/zconfig.sh
tests/runfiles/linux.run
tests/test-runner/cmd/test-runner.py
tests/zfs-tests/include/libtest.shlib
tests/zfs-tests/tests/functional/cli_user/misc/cleanup.ksh
tests/zfs-tests/tests/functional/cli_user/misc/misc.cfg
tests/zfs-tests/tests/functional/cli_user/misc/setup.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zdb_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zfs_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zfs_allow_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zfs_clone_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zfs_create_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zfs_destroy_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zfs_get_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zfs_inherit_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zfs_mount_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zfs_promote_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zfs_receive_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zfs_rename_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zfs_rollback_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zfs_send_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zfs_set_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zfs_share_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zfs_snapshot_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zfs_unallow_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zfs_unmount_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zfs_unshare_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zfs_upgrade_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zpool_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zpool_add_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zpool_attach_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zpool_clear_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zpool_create_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zpool_destroy_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zpool_detach_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zpool_export_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zpool_get_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zpool_history_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zpool_import_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zpool_import_002_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zpool_offline_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zpool_online_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zpool_remove_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zpool_replace_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zpool_scrub_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zpool_set_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zpool_status_001_neg.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zpool_upgrade_001_neg.ksh
tests/zfs-tests/tests/functional/delegate/cleanup.ksh
tests/zfs-tests/tests/functional/delegate/delegate.cfg
tests/zfs-tests/tests/functional/delegate/delegate_common.kshlib
tests/zfs-tests/tests/functional/delegate/setup.ksh
tests/zfs-tests/tests/functional/delegate/zfs_allow_001_pos.ksh
tests/zfs-tests/tests/functional/delegate/zfs_allow_002_pos.ksh
tests/zfs-tests/tests/functional/delegate/zfs_allow_010_pos.ksh
tests/zfs-tests/tests/functional/delegate/zfs_allow_012_neg.ksh
tests/zfs-tests/tests/functional/delegate/zfs_unallow_008_neg.ksh
udev/rules.d/90-zfs.rules.in