From c300afd293fddef85bd76b23f5c2dd1bb62cd70d Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Sun, 13 Oct 2019 19:13:26 -0700 Subject: [PATCH] Modify sharenfs=on default behavior While it may sometimes be convenient to export an NFS filesystem with no_root_squash it should not be the default behavior. Align the default behavior with the Linux NFS server defaults. To restore the previous behavior use 'zfs set sharenfs="no_root_squash,..."'. Reviewed-by: loli10K Reviewed-by: Richard Laager Signed-off-by: Brian Behlendorf Closes #9397 Closes #9425 --- lib/libshare/nfs.c | 5 +++-- man/man8/zfs.8 | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/libshare/nfs.c b/lib/libshare/nfs.c index 5c8976e15aa6..7cc5ae43f500 100644 --- a/lib/libshare/nfs.c +++ b/lib/libshare/nfs.c @@ -387,9 +387,10 @@ get_linux_shareopts(const char *shareopts, char **plinux_opts) *plinux_opts = NULL; - /* default options for Solaris shares */ + /* no_subtree_check - Default as of nfs-utils v1.1.0 */ (void) add_linux_shareopt(plinux_opts, "no_subtree_check", NULL); - (void) add_linux_shareopt(plinux_opts, "no_root_squash", NULL); + + /* mountpoint - Restrict exports to ZFS mountpoints */ (void) add_linux_shareopt(plinux_opts, "mountpoint", NULL); rc = foreach_nfs_shareopt(shareopts, get_linux_shareopts_cb, diff --git a/man/man8/zfs.8 b/man/man8/zfs.8 index 229b0ba69bf0..1572ac982652 100644 --- a/man/man8/zfs.8 +++ b/man/man8/zfs.8 @@ -1977,7 +1977,7 @@ If the property is set to .Sy on , the dataset is shared using the default options: .Pp -.Em sec=sys,rw,crossmnt,no_subtree_check,no_root_squash +.Em sec=sys,rw,crossmnt,no_subtree_check .Pp See .Xr exports 5