From: lace <> Date: Thu, 26 Jan 2006 18:45:06 +0000 (+0000) Subject: Workaround FUSE/Linux-kernel to try ourselves to modprobe FUSE on ENODEV. X-Git-Tag: captive-1_1_7~2 X-Git-Url: http://git.jankratochvil.net/?p=captive.git;a=commitdiff_plain;h=ad9a980893020cb137a597598eeef159d2f5e9ae;ds=sidebyside Workaround FUSE/Linux-kernel to try ourselves to modprobe FUSE on ENODEV. - Bugreported by: John Pratt --- diff --git a/src/client/fuse/fusermount.c b/src/client/fuse/fusermount.c index 65b60dc..9ceadc1 100644 --- a/src/client/fuse/fusermount.c +++ b/src/client/fuse/fusermount.c @@ -792,6 +792,17 @@ static int try_open(const char *dev, char **devp, int silent) if ((group = getgrnam("fuse")) && !chown(dev, 0, group->gr_gid)) fd = open(dev, O_RDWR); } + if (fd == -1 && errno == ENODEV) { + const char *cmd = "/sbin/modprobe fuse"; + + if (!system(cmd)) + fprintf(stderr, "%s: Notice: Loaded Linux kernel module FUSE: %s\n", + progname, cmd); + else + fprintf(stderr, "%s: Warning: \"%s\" cannot be opened and even failed: %s\n", + progname, dev, cmd); + fd = open(dev, O_RDWR); + } if (fd != -1) { *devp = strdup(dev); if (*devp == NULL) {