Date: Mon, 1 Jun 2020 18:43:51 +0000 (UTC) From: Ryan Moeller <freqlabs@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361699 - head/sys/kern Message-ID: <202006011843.051IhpMM085854@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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; + } }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202006011843.051IhpMM085854>