]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Temporarily use root credentials to mount snapshots in .zfs
authorAllan Jude <allan@klarasystems.com>
Tue, 14 Sep 2021 23:10:00 +0000 (19:10 -0400)
committerGitHub <noreply@github.com>
Tue, 14 Sep 2021 23:10:00 +0000 (17:10 -0600)
commit4a1195ca5041cbff2a6b025a31937fef84876c52
treec1180a399497e2cec7f8c9e878bc747d704b0211
parent6954c22f35cc8182f76bd18ab259a7d3eaf40b65
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
module/os/freebsd/spl/spl_vfs.c