svn commit: r337879 - stable/11/lib/libjail
Jamie Gritton
jamie at FreeBSD.org
Wed Aug 15 22:32:44 UTC 2018
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 {
/*
More information about the svn-src-stable
mailing list