Skip to content

Commit

Permalink
Modify sharenfs=on default behavior
Browse files Browse the repository at this point in the history
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,..."'.

Signed-off-by: Brian Behlendorf <[email protected]>
Issue #9397
  • Loading branch information
behlendorf committed Oct 7, 2019
1 parent 94bcf6f commit 0ebae16
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions lib/libshare/nfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion man/man8/zfs.8
Original file line number Diff line number Diff line change
Expand Up @@ -1992,7 +1992,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
Expand Down

0 comments on commit 0ebae16

Please sign in to comment.