mirror_zfs/lib/libzfs
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
..
os Add Linux namespace delegation support 2022-06-10 09:51:46 -07:00
.gitignore Clean up lib dependencies 2020-07-10 14:26:00 -07:00
libzfs_changelist.c Replace libzfs sharing _nfs() and _smb() APIs with protocol lists 2022-05-12 09:26:42 -07:00
libzfs_config.c libzfs: don't NULL-check infallible allocations 2022-03-30 15:30:16 -07:00
libzfs_crypto.c libzfs: Define the defecto standard errbuf size 2022-06-09 15:24:24 -07:00
libzfs_dataset.c libzfs: Define the defecto standard errbuf size 2022-06-09 15:24:24 -07:00
libzfs_diff.c libzfs: Define the defecto standard errbuf size 2022-06-09 15:24:24 -07:00
libzfs_impl.h libzfs: Define the defecto standard errbuf size 2022-06-09 15:24:24 -07:00
libzfs_import.c libzfs: import: zpool_clear_label: bool for boolean status 2022-04-13 11:37:18 -07:00
libzfs_iter.c libzfs: don't NULL-check infallible allocations 2022-03-30 15:30:16 -07:00
libzfs_mount.c libzfs: zfs_unshare: minor cleanup 2022-05-12 09:27:04 -07:00
libzfs_pool.c libzfs: Rename msg bufs to errbuf for consistency 2022-06-09 15:24:51 -07:00
libzfs_sendrecv.c libzfs: Define the defecto standard errbuf size 2022-06-09 15:24:24 -07:00
libzfs_status.c libzfs: Convert to fnvpair functions 2022-03-14 15:44:56 -07:00
libzfs_util.c Add Linux namespace delegation support 2022-06-10 09:51:46 -07:00
libzfs.abi Add Linux namespace delegation support 2022-06-10 09:51:46 -07:00
libzfs.pc.in Spruce up pkg-config files for libzfs/libzfs_core 2020-09-04 11:11:18 -07:00
libzfs.suppr Library ABI tracking with abigail 2020-11-17 09:18:52 -08:00
Makefile.am Replace EXTRA_DIST with dist_noinst_DATA 2022-05-26 09:24:50 -07:00
THIRDPARTYLICENSE.openssl Fix typos in lib/ 2019-09-02 17:53:27 -07:00
THIRDPARTYLICENSE.openssl.descrip Encryption patch follow-up 2017-10-11 16:54:48 -04:00