From 98f8234b1363dddcd85f936ecde189eda150780b Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Sat, 10 Nov 2018 03:10:22 +0000 Subject: [PATCH] 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 --- lib/libjail/jail.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/libjail/jail.c b/lib/libjail/jail.c index 3dd87b1072d..dc7fdf1479b 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);