summaryrefslogtreecommitdiff
path: root/sys/kern/vfs_export.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/vfs_export.c')
-rw-r--r--sys/kern/vfs_export.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/kern/vfs_export.c b/sys/kern/vfs_export.c
index 445c09900893b..3297298712783 100644
--- a/sys/kern/vfs_export.c
+++ b/sys/kern/vfs_export.c
@@ -61,6 +61,9 @@ __FBSDID("$FreeBSD$");
#include <netinet/in.h>
#include <net/radix.h>
+#include <rpc/types.h>
+#include <rpc/auth.h>
+
static MALLOC_DEFINE(M_NETADDR, "export_host", "Export host address structure");
#if defined(INET) || defined(INET6)
@@ -303,7 +306,7 @@ vfs_export(struct mount *mp, struct export_args *argp)
return (EINVAL);
if ((argp->ex_flags & MNT_EXPORTED) != 0 &&
- (argp->ex_numsecflavors <= 0
+ (argp->ex_numsecflavors < 0
|| argp->ex_numsecflavors >= MAXSECFLAVORS))
return (EINVAL);
@@ -341,6 +344,10 @@ vfs_export(struct mount *mp, struct export_args *argp)
mp->mnt_flag |= MNT_EXPUBLIC;
MNT_IUNLOCK(mp);
}
+ if (argp->ex_numsecflavors == 0) {
+ argp->ex_numsecflavors = 1;
+ argp->ex_secflavors[0] = AUTH_SYS;
+ }
if ((error = vfs_hang_addrlist(mp, nep, argp)))
goto out;
MNT_ILOCK(mp);