svn commit: r361699 - head/sys/kern
Ryan Moeller
freqlabs at FreeBSD.org
Mon Jun 1 18:43:52 UTC 2020
Author: freqlabs
Date: Mon Jun 1 18:43:51 2020
New Revision: 361699
URL: https://svnweb.freebsd.org/changeset/base/361699
Log:
Assign default security flavor when converting old export args
vfs_export requires security flavors be explicitly listed when
exporting as of r360900.
Use the default AUTH_SYS flavor when converting old export args to
ensure compatibility with the legacy mount syscall.
Reported by: rmacklem
Reviewed by: rmacklem
Approved by: mav (mentor)
MFC after: 3 days
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D25045
Modified:
head/sys/kern/vfs_mount.c
Modified: head/sys/kern/vfs_mount.c
==============================================================================
--- head/sys/kern/vfs_mount.c Mon Jun 1 16:14:29 2020 (r361698)
+++ head/sys/kern/vfs_mount.c Mon Jun 1 18:43:51 2020 (r361699)
@@ -2343,10 +2343,22 @@ kernel_vmount(int flags, ...)
return (error);
}
+/*
+ * Convert the old export args format into new export args.
+ *
+ * The old export args struct does not have security flavors. Otherwise, the
+ * structs are identical. The default security flavor 'sys' is applied when
+ * the given args export the filesystem.
+ */
void
vfs_oexport_conv(const struct oexport_args *oexp, struct export_args *exp)
{
bcopy(oexp, exp, sizeof(*oexp));
- exp->ex_numsecflavors = 0;
+ if (exp->ex_flags & MNT_EXPORTED) {
+ exp->ex_numsecflavors = 1;
+ exp->ex_secflavors[0] = AUTH_SYS;
+ } else {
+ exp->ex_numsecflavors = 0;
+ }
}
More information about the svn-src-all
mailing list