In message <[email protected]>, Ryan Moeller 
writes:
> 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, th
> e
> + * 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;

#include <rpc/rpc.h> will be needed for this.

This of course opens a new can of worms with regard to namespace pollution.

> +     } else {
> +             exp->ex_numsecflavors = 0;
> +     }
>  }
>


-- 
Cheers,
Cy Schubert <[email protected]>
FreeBSD UNIX:  <[email protected]>   Web:  https://FreeBSD.org
NTP:           <[email protected]>    Web:  https://nwtime.org

        The need of the many outweighs the greed of the few.


_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to