From d4d69bcdca8f712179d0b49a267840a696514944 Mon Sep 17 00:00:00 2001 From: lace <> Date: Thu, 29 Dec 2005 02:49:09 +0000 Subject: [PATCH] +Sanity check on the obsolete LUFS options. - Suggested by: Frederic L. W. Meunier Suggest rather even the fusermount(8) upgrade on fuse_setup() failure. --- src/client/fuse/main.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/src/client/fuse/main.c b/src/client/fuse/main.c index 06ad27a..705b6a8 100644 --- a/src/client/fuse/main.c +++ b/src/client/fuse/main.c @@ -106,7 +106,10 @@ struct fuse *capfuse_fuse; &capfuse_mountpoint, /* mountpoint */ &capfuse_multithreaded, /* multithreaded */ &capfuse_fd))) /* fd */ - g_error(_("FUSE fuse_setup() failed - you may need Linux kernel 2.6.14 or higher with its 'fuse.ko' enabled")); + g_error(_( + "FUSE fuse_setup() failed!\n" + "You may need Linux kernel 2.6.14 or higher with its 'fuse.ko' enabled.\n" + "You may also need to install or upgrade 'fuse' package to your system.")); if (fuse_loop(capfuse_fuse)) { /* Do not: g_error(_("FUSE fuse_loop() error")); * as it is caused on each umount(8). @@ -215,9 +218,9 @@ char *s,quote; } if (poptParseArgvString(opt_o_spaced,&opt_o_argc,&opt_o_argv)) g_error(_("Error splitting arguments of the space-reparsed '-o': %s"),opt_o_spaced); - /* Pre-dash "ro"/"rw" to let libcaptive to be aware of the mode. */ + /* Adjust the options for all the subsystems eating the same string vector. */ for (csp=opt_o_argv;*csp;csp++) { - /* Unsupported options not valid for fusermount(8) and causing: + /* Unsupported mount(8) options not valid for fusermount(8) and causing: * fusermount: mount failed: Invalid argument */ if (0 || !strcmp(*csp,"defaults") @@ -228,10 +231,26 @@ char *s,quote; csp--; continue; } + /* Pre-dash "ro"/"rw" to let libcaptive to be aware of the mode. + * We will put the final "ro"/"rw" there again from 'captive_options.rwmode' later. */ if (!strcmp(*csp,"ro")) *csp="--ro"; if (!strcmp(*csp,"rw")) *csp="--rw"; + /* LUFS "uid" and "gid" options should map to FUSE well, I hope. */ +#define STRNCMP_CONST(mem,string) strncmp((mem),(string),strlen((string))) + if (0 + || !STRNCMP_CONST(*csp,"fmask=") + || !STRNCMP_CONST(*csp,"dmask=") + || !STRNCMP_CONST(*csp,"channels=") + || !STRNCMP_CONST(*csp,"root=") + || !strcmp(*csp,"own_fs") + || !strcmp(*csp,"quiet") + || !STRNCMP_CONST(*csp,"dir_cache_ttl=") + ) + g_error(_("Seen obsolete LUFS option \"%s\" - please update your \"/etc/fstab\" for FUSE options instead"), + *csp); +#undef STRNCMP_CONST } } -- 1.8.3.1