mirror_zfs/contrib/pyzfs/libzfs_core
Will Andrews 4ed5e25074 Add Linux namespace delegation support
This allows ZFS datasets to be delegated to a user/mount namespace
Within that namespace, only the delegated datasets are visible
Works very similarly to Zones/Jailes on other ZFS OSes

As a user:
```
 $ unshare -Um
 $ zfs list
no datasets available
 $ echo $$
1234
```

As root:
```
 # zfs list
NAME                            ZONED  MOUNTPOINT
containers                      off    /containers
containers/host                 off    /containers/host
containers/host/child           off    /containers/host/child
containers/host/child/gchild    off    /containers/host/child/gchild
containers/unpriv               on     /unpriv
containers/unpriv/child         on     /unpriv/child
containers/unpriv/child/gchild  on     /unpriv/child/gchild

 # zfs zone /proc/1234/ns/user containers/unpriv
```

Back to the user namespace:
```
 $ zfs list
NAME                             USED  AVAIL     REFER  MOUNTPOINT
containers                       129M  47.8G       24K  /containers
containers/unpriv                128M  47.8G       24K  /unpriv
containers/unpriv/child          128M  47.8G      128M  /unpriv/child
```

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Will Andrews <will.andrews@klarasystems.com>
Signed-off-by: Allan Jude <allan@klarasystems.com>
Signed-off-by: Mateusz Piotrowski <mateusz.piotrowski@klarasystems.com>
Co-authored-by: Allan Jude <allan@klarasystems.com>
Co-authored-by: Mateusz Piotrowski <mateusz.piotrowski@klarasystems.com>
Sponsored-by: Buddy <https://buddy.works>
Closes #12263
2022-06-10 09:51:46 -07:00
..
bindings Add const to nvlist functions to properly expose their real behavior 2021-12-06 18:19:13 -07:00
test tests: clean out more temporary files 2022-04-01 18:03:21 -07:00
__init__.py Replace ZFS on Linux references with OpenZFS 2020-10-08 20:10:13 -07:00
_constants.py Add Linux namespace delegation support 2022-06-10 09:51:46 -07:00
_error_translation.py Change the error handling for invalid property values 2020-08-01 08:41:31 -07:00
_libzfs_core.py Implement bookmark copying 2020-02-11 13:19:12 -08:00
_nvlist.py Fix typos in contrib/ 2019-08-30 09:44:43 -07:00
ctypes.py pyzfs: python3 support (library 2/2) 2019-01-06 10:39:41 -08:00
exceptions.py Fix cstyle warnings 2020-03-17 15:42:27 -07:00