diff options
author | Ryan Moeller <freqlabs@FreeBSD.org> | 2020-06-16 21:30:30 +0000 |
---|---|---|
committer | Ryan Moeller <freqlabs@FreeBSD.org> | 2020-06-16 21:30:30 +0000 |
commit | 33b39b66158902ee1ed41c686ad6ae7b33bc7bd7 (patch) | |
tree | b581feeb73b5235a5ab92242c82dea2c5e85657d | |
parent | 512baba6a5c060c8a0eca291e0d0a379c1e784f9 (diff) |
Notes
-rw-r--r-- | sys/kern/vfs_export.c | 9 | ||||
-rw-r--r-- | sys/kern/vfs_mount.c | 5 |
2 files changed, 8 insertions, 6 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); diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 464bbbc6b77e6..8b7cacd986c45 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -70,9 +70,6 @@ __FBSDID("$FreeBSD$"); #include <machine/stdarg.h> -#include <rpc/types.h> -#include <rpc/auth.h> - #include <security/audit/audit.h> #include <security/mac/mac_framework.h> @@ -1131,8 +1128,6 @@ vfs_domount_update( switch (len) { case (sizeof(struct oexport_args)): bzero(&o2export, sizeof(o2export)); - o2export.ex_numsecflavors = 1; - o2export.ex_secflavors[0] = AUTH_SYS; /* FALLTHROUGH */ case (sizeof(o2export)): bcopy(bufp, &o2export, len); |