Page MenuHomeFreeBSD

libjail: fix handling of allow.mount.fusefs in jailparam_init
ClosedPublic

Authored by asomers on Nov 9 2018, 7:01 PM.

Details

Summary

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.

Test Plan

Tested by hand on head. Started a jail with allow.mount.fusefs=1 and fuse(4)
not loaded. Relied on libjail to kldload fuse.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

It works with allow.mount.fusefs, but not with allow.mount.nofusefs (which will still try to kldload "fusefs"). Comparing the fs name to both "fusefs" and "nofusefs" should be all that's needed.

Of course, stupid me. But I'm having trouble testing it. What's the proper way to pass the "nofuse" option on the jail(8) command line? Neither allow.mount.nofusefs nor allow.mount.nofusefs=1 work.

It's allow.mount.nofusefs. It should (currently) work once the kld is loaded, but the new strcmp will need to be added to make it work before it's loaded.

lib/libjail/jail.c
1055 ↗(On Diff #50224)

This only needs to be a strcmp, since "fusefs" is at the end of the parameter name.

Handle allow.mount.nofusefs too

This revision is now accepted and ready to land.Nov 10 2018, 2:47 AM
This revision was automatically updated to reflect the committed changes.