Date: Wed, 15 Aug 2018 22:32:55 +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-10@freebsd.org Subject: svn commit: r337880 - stable/10/lib/libjail Message-ID: <201808152232.w7FMWtMf022834@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 { /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201808152232.w7FMWtMf022834>