summaryrefslogtreecommitdiff
path: root/lib/libjail
diff options
context:
space:
mode:
authorAlan Somers <asomers@FreeBSD.org>2018-11-10 03:10:22 +0000
committerAlan Somers <asomers@FreeBSD.org>2018-11-10 03:10:22 +0000
commit98f8234b1363dddcd85f936ecde189eda150780b (patch)
tree6005987a40bd38fe7e541b9ec780e2772225da9e /lib/libjail
parent86af1d0241cae501932016c7359eeaba2f2afa4b (diff)
downloadsrc-test-98f8234b1363dddcd85f936ecde189eda150780b.tar.gz
src-test-98f8234b1363dddcd85f936ecde189eda150780b.zip
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
Notes
Notes: svn path=/head/; revision=340314
Diffstat (limited to 'lib/libjail')
-rw-r--r--lib/libjail/jail.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/libjail/jail.c b/lib/libjail/jail.c
index 3dd87b1072d1d..dc7fdf1479bd6 100644
--- a/lib/libjail/jail.c
+++ b/lib/libjail/jail.c
@@ -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);