Author: jamie
Date: Wed Aug 15 22:32:55 2018
New Revision: 337880
URL: https://svnweb.freebsd.org/changeset/base/337880

Log:
  Load filesystem modules associated with allow.mount permissions.
  
  PR:           192092

Modified:
  stable/10/lib/libjail/jail.c

Modified: stable/10/lib/libjail/jail.c
==============================================================================
--- stable/10/lib/libjail/jail.c        Wed Aug 15 22:32:43 2018        
(r337879)
+++ stable/10/lib/libjail/jail.c        Wed Aug 15 22:32:55 2018        
(r337880)
@@ -513,7 +513,18 @@ jailparam_set(struct jailparam *jp, unsigned njp, int 
                                }
                                jiov[i - 1].iov_base = nname;
                                jiov[i - 1].iov_len = strlen(nname) + 1;
-                               
+                       }
+                       /*
+                        * Load filesystem modules associated with allow.mount
+                        * permissions.  Ignore failure, since the module may
+                        * be static, and even a failure to load is not a jail
+                        * error.
+                        */
+                       if (strncmp(jp[j].jp_name, "allow.mount.", 12) == 0) {
+                               if (kldload(jp[j].jp_name + 12) < 0 &&
+                                   errno == ENOENT &&
+                                   strncmp(jp[j].jp_name + 12, "no", 2) == 0)
+                                       (void)kldload(jp[j].jp_name + 14);
                        }
                } else {
                        /*
_______________________________________________
svn-src-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-unsubscr...@freebsd.org"

Reply via email to