Hi @tech,

Two fixes for libfuse and option parsing. According to the official 
implementation, when an option is not recognised, the processing function
should be called with the key FUSE_OPT_KEY_OPT [1]. Additionally, fix the
last argument of a call in fuse_opt_parse.

Thanks,
Thiébaud

[1] http://fuse.sourceforge.net/doxygen/fuse__opt_8h.html

Index: lib/libfuse/fuse_opt.c
===================================================================
RCS file: /cvs/src/lib/libfuse/fuse_opt.c,v
retrieving revision 1.12
diff -u -p -r1.12 fuse_opt.c
--- lib/libfuse/fuse_opt.c      6 Feb 2015 23:21:58 -0000       1.12
+++ lib/libfuse/fuse_opt.c      16 Aug 2015 06:08:00 -0000
@@ -259,8 +259,10 @@ parse_opt(const struct fuse_opt *o, cons
        }
 
        if (!found) {
-               printf("fuse: unknown option %s\n", val);
-               return (-1);
+               ret = f(data, val, FUSE_OPT_KEY_OPT, arg);
+               if (ret == 1)
+                       fuse_opt_add_arg(arg, val);
+               return (ret);
        }
 
        return (ret);
@@ -293,7 +295,7 @@ fuse_opt_parse(struct fuse_args *args, v
 
                /* not - and not -- */
                if (arg[0] != '-') {
-                       ret = f(data, arg, FUSE_OPT_KEY_NONOPT, 0);
+                       ret = f(data, arg, FUSE_OPT_KEY_NONOPT, &outargs);
 
                        if (ret == 1)
                                fuse_opt_add_arg(&outargs, arg);
                                                                

Reply via email to