aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Leidinger <netchild@FreeBSD.org>2024-01-17 12:32:39 +0000
committerAlexander Leidinger <netchild@FreeBSD.org>2024-01-17 12:38:00 +0000
commit0b49e504a32d90ccd6785841bced2ca8c93a87e6 (patch)
tree6f5e2778dfd3fbeb6f0ea99681eac42a7d1f4a12
parent6caa19a08b846f437f22920f61795e598cdf9f5e (diff)
rc.d/jail: add legacy compatibility for zfs.dataset
Evaluate the jail_${jailname}_zfs_dataset variable for legacy jail managers. This variable can take a space separated list of datasets. The singular was used specially to allow unmaintained jail managers like ezjail to use this (simply rename jail_${jailname}_zfs_datasets in the ezjail config to jail_${jailname}_zfs_dataset).
-rwxr-xr-xlibexec/rc/rc.d/jail7
1 files changed, 7 insertions, 0 deletions
diff --git a/libexec/rc/rc.d/jail b/libexec/rc/rc.d/jail
index f12dae280bb0..e24d6f8e21e0 100755
--- a/libexec/rc/rc.d/jail
+++ b/libexec/rc/rc.d/jail
@@ -268,6 +268,13 @@ parse_options()
extract_var $_jv enforce_statfs enforce_statfs - 2
extract_var $_jv osreldate osreldate
extract_var $_jv osrelease osrelease
+
+ _zfs_dataset="$(eval echo \$jail_${_jv}_zfs_dataset)"
+ if [ -n "$_zfs_dataset" ]; then
+ for ds in $_zfs_dataset; do
+ echo " zfs.dataset += ${ds};"
+ done
+ fi
for _p in $_parameters; do
echo " ${_p%\;};"
done