mirror_zfs/lib/libzfs
Brian Behlendorf f74b821a66 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
2016-06-07 09:16:52 -07:00
..
.gitignore Add a pkgconfig file 2014-08-28 07:59:43 -07:00
libzfs_changelist.c Remove ZFC_IOC_*_MINOR ioctl()s 2013-12-16 09:15:57 -08:00
libzfs_config.c Illumos 6659 - nvlist_free(NULL) is a no-op 2016-04-27 15:58:23 -07:00
libzfs_core.pc.in Add a pkgconfig file 2014-08-28 07:59:43 -07:00
libzfs_dataset.c Add zfs allow and zfs unallow support 2016-06-07 09:16:52 -07:00
libzfs_diff.c Illumos 4448 - zfs diff misprints unicode characters 2016-02-05 13:04:58 -08:00
libzfs_fru.c cstyle: Resolve C style issues 2013-12-18 16:46:35 -08:00
libzfs_graph.c Illumos #3464 2013-09-04 16:01:24 -07:00
libzfs_import.c Fixes bug in fix_paths() 2016-05-12 12:36:28 -07:00
libzfs_iter.c Illumos 5427 - memory leak in libzfs when doing rollback 2015-07-10 12:09:32 -07:00
libzfs_mount.c Make zfs mount according to relatime config in dataset 2016-04-05 18:55:59 -07:00
libzfs_pool.c Make zpool list -vp print individual vdev sizes parsable. 2016-05-18 10:15:32 -07:00
libzfs_sendrecv.c OpenZFS 6879 - Incorrect endianness swap 2016-05-09 11:22:00 -07:00
libzfs_status.c Read spl_hostid module parameter before gethostid() 2015-02-04 16:44:53 -08:00
libzfs_util.c Add -lhHpw options to "zpool iostat" for avg latency, histograms, & queues 2016-05-12 12:36:32 -07:00
libzfs.pc.in Add a pkgconfig file 2014-08-28 07:59:43 -07:00
Makefile.am Add support for devid and phys_path keys in vdev disk labels 2016-03-31 13:45:53 -07:00