Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Aug 2018 22:32:44 +0000 (UTC)
From:      Jamie Gritton <jamie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r337879 - stable/11/lib/libjail
Message-ID:  <201808152232.w7FMWixM022768@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jamie
Date: Wed Aug 15 22:32:43 2018
New Revision: 337879
URL: https://svnweb.freebsd.org/changeset/base/337879

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

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

Modified: stable/11/lib/libjail/jail.c
==============================================================================
--- stable/11/lib/libjail/jail.c	Wed Aug 15 22:25:05 2018	(r337878)
+++ stable/11/lib/libjail/jail.c	Wed Aug 15 22:32:43 2018	(r337879)
@@ -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 {
 			/*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201808152232.w7FMWixM022768>