OpenBSD CVS

CVS log for src/lib/libfuse/fuse_opt.c


[BACK] Up to [local] / src / lib / libfuse

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.27 / (download) - annotate - [select for diffs], Sun Jan 16 20:06:18 2022 UTC (2 years, 4 months ago) by naddy
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, HEAD
Changes since 1.26: +4 -7 lines
Diff to previous 1.26 (colored)

libfuse: fix -Wunused-but-set-variable warning

ok tb@

Revision 1.26 / (download) - annotate - [select for diffs], Tue May 15 11:57:32 2018 UTC (6 years ago) by helg
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.25: +2 -2 lines
Diff to previous 1.25 (colored)

Use memset(3) instead of bzero(3) for consistency and as per POSIX
recommendation.

Revision 1.25 / (download) - annotate - [select for diffs], Fri Dec 15 16:40:33 2017 UTC (6 years, 5 months ago) by jca
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.24: +6 -1 lines
Diff to previous 1.24 (colored)

Export only symbols to what's declared in fuse.h/fuse_opt.h

While here, use guenther's magic recipe to avoid the PLT when calling
exported symbols from within the library.

ok kettenis@ for v1, ok guenther@ helg@

Revision 1.24 / (download) - annotate - [select for diffs], Thu Dec 14 13:23:30 2017 UTC (6 years, 5 months ago) by jca
Branch: MAIN
Changes since 1.23: +2 -1 lines
Diff to previous 1.23 (colored)

fuse_opt_add_opt_escaped needs to allocate space for the terminating NUL

Spotted by malloc.conf -> S, ok helg@

Revision 1.23 / (download) - annotate - [select for diffs], Wed Dec 13 12:23:48 2017 UTC (6 years, 5 months ago) by helg
Branch: MAIN
Changes since 1.22: +2 -5 lines
Diff to previous 1.22 (colored)

If the list of templates 'o' passed to fuse_opt_parse(3) is NULL then
the processing function should be called in the same way as if no match
was found.

ok mpi@

Revision 1.22 / (download) - annotate - [select for diffs], Mon Dec 11 12:38:54 2017 UTC (6 years, 5 months ago) by helg
Branch: MAIN
Changes since 1.21: +7 -9 lines
Diff to previous 1.21 (colored)

sscanf(3) is now used to parse templates that contain format specifiers
(e.g. %u, %o) other than %s. This aligns libfuse with the Linux reference
implementation.


ok mpi@

Revision 1.21 / (download) - annotate - [select for diffs], Mon Dec 11 12:31:00 2017 UTC (6 years, 5 months ago) by helg
Branch: MAIN
Changes since 1.20: +54 -46 lines
Diff to previous 1.20 (colored)

Update to fuse_opt_parse(3) so that all option templates are now matched for
the supplied option. This allows the following templates to be supplied to set
multiple members of a struct at the same time. e.g.

#define FUSE_LIB_OPT(t, p, v) { t, offsetof(struct fuse_config, p), v }

static const struct fuse_opt fuse_lib_opts[] = {
      FUSE_LIB_OPT("gid=",      set_gid, 1),
      FUSE_LIB_OPT("gid=%u",        gid, 0),
      FUSE_OPT_END
};

If "-ogid=1000" is passed to fuse_opt_parse(3) it will set both:

fuse_config.set_gid=1
fuse_config.gid=1000


ok mpi@

Revision 1.20 / (download) - annotate - [select for diffs], Mon Dec 11 12:01:55 2017 UTC (6 years, 5 months ago) by helg
Branch: MAIN
Changes since 1.19: +19 -57 lines
Diff to previous 1.19 (colored)

The fuse_opt_match(3) library function does not match options correctly.
libfuse supports option templates of the following form that can be used
to automatically parse arguments supplied on the command line.

"-p "       argument that takes an option e.g -p 22 or -p22
"-p %x"     argument that takes an option parsed like sscanf(3)
"cache=yes" matches -ocache=yes or -o cache=yes
"cache=%s"  matches -ocache=<string> or -o cache=<string>
"cache="    matches same as above but value is passed to option proc
"noatime"   matches -onoatime or -o atime

For example, it does not match options of the form "-p 22" or
"cache=yes" to the corresponding templates "-p " and "cache=yes".  This
patch fixes that and updates the regression tests accordingly.

ok mpi@

Revision 1.19 / (download) - annotate - [select for diffs], Thu Nov 16 12:56:58 2017 UTC (6 years, 6 months ago) by helg
Branch: MAIN
Changes since 1.18: +101 -45 lines
Diff to previous 1.18 (colored)

Add support for:
    multiple options after -o.
    arguments that require options e.g. -p 22
    %s, %lu, %u option templates

ok mpi@

Revision 1.18 / (download) - annotate - [select for diffs], Wed Jan 4 12:01:22 2017 UTC (7 years, 4 months ago) by stsp
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.17: +1 -1 lines
Diff to previous 1.17 (colored)

Revert fuse_opt.c r1.17. It broke exfat-fuse and perhaps other plugins.
http://marc.info/?l=openbsd-ports&m=148170738917809&w=2
reported by yasuoka@

Revision 1.17 / (download) - annotate - [select for diffs], Wed Nov 23 09:53:16 2016 UTC (7 years, 6 months ago) by mpi
Branch: MAIN
Changes since 1.16: +2 -2 lines
Diff to previous 1.16 (colored)

Empty strings are invalid arguments.

Fix a regression introduced when merging the two options parsers.

ok stsp@

Revision 1.16 / (download) - annotate - [select for diffs], Tue May 24 20:55:32 2016 UTC (8 years ago) by okan
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.15: +3 -2 lines
Diff to previous 1.15 (colored)

NUL-terminate argv when parsing options, following other
implementations; fixes issue when exec*() is used for
fuse_args, notably in sshfs; from Hiltjo Posthuma and
reminded by ray.

ok mpi@

Revision 1.15 / (download) - annotate - [select for diffs], Mon Oct 19 17:24:07 2015 UTC (8 years, 7 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.14: +2 -2 lines
Diff to previous 1.14 (colored)

missing deref on char check. from David Binderman

Revision 1.14 / (download) - annotate - [select for diffs], Mon Aug 24 15:31:36 2015 UTC (8 years, 9 months ago) by mpi
Branch: MAIN
Changes since 1.13: +6 -4 lines
Diff to previous 1.13 (colored)

When an option is not recognized call the processing function with
FUSE_OPT_KEY_OPT, while here fix the last argument of a call in
fuse_opt_parse().

Diff from ThiƩbaud Weksteen <thiebaud AT weksteen DOT fr>, thanks!

ok syl@, ajacoutot@

Revision 1.13 / (download) - annotate - [select for diffs], Tue Jul 7 13:03:58 2015 UTC (8 years, 10 months ago) by ajacoutot
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.12: +8 -1 lines
Diff to previous 1.12 (colored)

Unbreak option parsing:
fuse_opt_pase is called with an opaque void * and struct fuse_opt. If val has a
positive value and off != -1, we modify the opaque void * at the offset off to
put it val.
This matches what the GNU libfuse does.

fixes (at least) simple-mtpfs option parsing
diff from slacker syl@, thanks!

"it can't get worse than not working" mikeb@
ok miod@ sthen@

Revision 1.12 / (download) - annotate - [select for diffs], Fri Feb 6 23:21:58 2015 UTC (9 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.11: +3 -2 lines
Diff to previous 1.11 (colored)

SIZE_MAX is standard, we should be using it in preference to the
obsolete SIZE_T_MAX.  OK miod@ beck@

Revision 1.11 / (download) - annotate - [select for diffs], Wed Oct 8 04:50:10 2014 UTC (9 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.10: +2 -2 lines
Diff to previous 1.10 (colored)

use reallocarray(); ok doug

Revision 1.10 / (download) - annotate - [select for diffs], Tue May 20 13:22:06 2014 UTC (10 years ago) by syl
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.9: +29 -9 lines
Diff to previous 1.9 (colored)

Add support for -o XXX or -oXXX options in libfuse.

inputs from tedu@, ok tedu@

Revision 1.9 / (download) - annotate - [select for diffs], Tue Apr 15 08:48:11 2014 UTC (10 years, 1 month ago) by syl
Branch: MAIN
Changes since 1.8: +3 -3 lines
Diff to previous 1.8 (colored)

Init outargs only once, and fix a bad bzero().

Spotted by jsg@, ok jsg@

Revision 1.8 / (download) - annotate - [select for diffs], Tue Jan 21 22:26:11 2014 UTC (10 years, 4 months ago) by jca
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.7: +5 -5 lines
Diff to previous 1.7 (colored)

Mark fuse_opt_parse()'s third argument as a point to const, to match the
reference FUSE implementation.  ok syl@

Revision 1.7 / (download) - annotate - [select for diffs], Mon Nov 4 19:54:18 2013 UTC (10 years, 6 months ago) by syl
Branch: MAIN
Changes since 1.6: +2 -2 lines
Diff to previous 1.6 (colored)

fuse_opt_insert_arg() can take empty string as argument.

unbreak ntfs-3g.
ok pirofti@

Revision 1.6 / (download) - annotate - [select for diffs], Sat Nov 2 09:00:49 2013 UTC (10 years, 7 months ago) by syl
Branch: MAIN
Changes since 1.5: +73 -35 lines
Diff to previous 1.5 (colored)

Update the fuse_opt to have option like -h working.

ok ajacoutot@

Revision 1.5 / (download) - annotate - [select for diffs], Thu Jul 11 11:41:12 2013 UTC (10 years, 10 months ago) by syl
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.4: +224 -45 lines
Diff to previous 1.4 (colored)

Merge fuse_opt code with stsp@ fuse_opt code.

ok tedu@

Revision 1.4 / (download) - annotate - [select for diffs], Wed Jun 12 22:44:42 2013 UTC (10 years, 11 months ago) by tedu
Branch: MAIN
Changes since 1.3: +6 -6 lines
Diff to previous 1.3 (colored)

style for loops

Revision 1.3 / (download) - annotate - [select for diffs], Wed Jun 12 22:42:52 2013 UTC (10 years, 11 months ago) by tedu
Branch: MAIN
Changes since 1.2: +10 -8 lines
Diff to previous 1.2 (colored)

correct realloc usage

Revision 1.2 / (download) - annotate - [select for diffs], Wed Jun 12 22:38:08 2013 UTC (10 years, 11 months ago) by tedu
Branch: MAIN
Changes since 1.1: +3 -2 lines
Diff to previous 1.1 (colored)

style

Revision 1.1 / (download) - annotate - [select for diffs], Wed Jun 12 22:36:06 2013 UTC (10 years, 11 months ago) by tedu
Branch: MAIN

fuse_opt support from Sylvestre

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.