From ad9a980893020cb137a597598eeef159d2f5e9ae Mon Sep 17 00:00:00 2001 From: lace <> Date: Thu, 26 Jan 2006 18:45:06 +0000 Subject: [PATCH] Workaround FUSE/Linux-kernel to try ourselves to modprobe FUSE on ENODEV. - Bugreported by: John Pratt --- src/client/fuse/fusermount.c | 11 +++++++++++ 1 file changed, 11 insertions(+) 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) { -- 1.8.3.1