Author: asomers
Date: Sat Nov 10 03:10:22 2018
New Revision: 340314
URL: https://svnweb.freebsd.org/changeset/base/340314

Log:
  libjail: fix handling of allow.mount.fusefs in jailparam_init
  
  fusefs is inconsistently named. The kernel module is named "fuse", but the
  mount helper is named "mount_fusefs" and the jail(8) parameter is named
  "allow.mount.fusefs". Special case it in libjail.
  
  Reviewed by:  jamie
  MFC after:    2 weeks
  Differential Revision:        https://reviews.freebsd.org/D17929

Modified:
  head/lib/libjail/jail.c

Modified: head/lib/libjail/jail.c
==============================================================================
--- head/lib/libjail/jail.c     Sat Nov 10 03:00:36 2018        (r340313)
+++ head/lib/libjail/jail.c     Sat Nov 10 03:10:22 2018        (r340314)
@@ -1050,10 +1050,18 @@ kldload_param(const char *name)
                kl = kldload(name);
        else if (strncmp(name, "allow.mount.", 12) == 0) {
                /* Load the matching filesystem */
-               kl = kldload(name + 12);
+               const char *modname;
+
+               if (strcmp("fusefs", name + 12) == 0 ||
+                   strcmp("nofusefs", name + 12) == 0) {
+                       modname = "fuse";
+               } else {
+                       modname = name + 12;
+               }
+               kl = kldload(modname);
                if (kl < 0 && errno == ENOENT &&
-                   strncmp(name + 12, "no", 2) == 0)
-                       kl = kldload(name + 14);
+                   strncmp(modname, "no", 2) == 0)
+                       kl = kldload(modname + 2);
        } else {
                errno = ENOENT;
                return (-1);
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to