diff options
author | Miklos Szeredi <miklos@szeredi.hu> | 2006-08-18 19:26:23 +0000 |
---|---|---|
committer | Miklos Szeredi <miklos@szeredi.hu> | 2006-08-18 19:26:23 +0000 |
commit | 543087d48121b8628e875108aaa190af88dc4496 (patch) | |
tree | 0b7ca6f0cca2e9771ecb0e87f8dff87e188e3a94 /util | |
parent | 3ded1a3176bb803e016e79d0e6db5e1f3ea30473 (diff) |
fusermount improvement
Diffstat (limited to 'util')
-rw-r--r-- | util/fusermount.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/util/fusermount.c b/util/fusermount.c index 6d3ef97..89ecb2c 100644 --- a/util/fusermount.c +++ b/util/fusermount.c @@ -841,14 +841,23 @@ static int try_open_fuse_device(char **devp) static int open_fuse_device(char **devp) { - int fd = try_open_fuse_device(devp); - if (fd >= 0) + int fd; + + if (getuid() == 0) { + fd = try_open_fuse_device(devp); + if (fd >= -1) + return fd; + + system("modprobe fuse"); + } + + fd = try_open_fuse_device(devp); + if (fd >= -1) return fd; - if (fd == -2) - fprintf(stderr, - "%s: fuse device not found, try 'modprobe fuse' first\n", - progname); + fprintf(stderr, "%s: fuse device not found, try 'modprobe fuse' first\n", + progname); + return -1; } |