zfs/lib/libspl
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
..
asm-generic Support parallel build trees (VPATH builds) 2015-07-17 13:42:51 -07:00
asm-i386 Support parallel build trees (VPATH builds) 2015-07-17 13:42:51 -07:00
asm-x86_64 Support parallel build trees (VPATH builds) 2015-07-17 13:42:51 -07:00
include Add `zfs allow` and `zfs unallow` support 2016-06-07 09:16:52 -07:00
Makefile.am Add support for libtirpc 2016-04-28 09:27:40 -07:00
getexecname.c cstyle: Resolve C style issues 2013-12-18 16:46:35 -08:00
gethrestime.c cstyle: Resolve C style issues 2013-12-18 16:46:35 -08:00
gethrtime.c cstyle: Resolve C style issues 2013-12-18 16:46:35 -08:00
getmntany.c cstyle: Resolve C style issues 2013-12-18 16:46:35 -08:00
list.c Add linux libspl support 2010-08-31 13:41:59 -07:00
mkdirp.c Set errno for mkdirp() called with NULL path ptr 2014-04-09 13:32:22 -07:00
strlcat.c Add linux libspl support 2010-08-31 13:41:59 -07:00
strlcpy.c Add linux libspl support 2010-08-31 13:41:59 -07:00
strnlen.c Add linux libspl support 2010-08-31 13:41:59 -07:00
timestamp.c Set _DATE_FMT to '%+' if not defined in libspl/timestamp.c 2016-03-29 18:33:17 -07:00
zone.c cstyle: Resolve C style issues 2013-12-18 16:46:35 -08:00