HomeFreeBSD

Temporarily use root credentials to mount snapshots in .zfs

Description

Temporarily use root credentials to mount snapshots in .zfs

When mounting a snapshot in the .zfs/snapshots control directory,
temporarily assume roots credentials to perform the VFS_MOUNT().

This allows regular users and users inside jails to access these
snapshots.

The regular usermount code is not helpful here, since it requires
that the user performing the mount own the mountpoint, which won't
be the case for .zfs/snapshot/<snapname>

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tony Nguyen <tony.nguyen@delphix.com>
Signed-off-by: Allan Jude <allan@klarasystems.com>
Sponsored-By: Modirum MDPay
Sponsored-By: Klara Inc.
Closes #11312

Details

Provenance
allanjudeAuthored on Sep 14 2021, 11:10 PM
GitHub <noreply@github.com>Committed on Sep 14 2021, 11:10 PM
Parents
rG6954c22f35cc: Use fallthrough macro
Branches
Unknown
Tags
Unknown