Home | History | Annotate | Download | only in librefuse
History log of /src/lib/librefuse/refuse_opt.c
RevisionDateAuthorComments
 1.23  22-Jan-2022  pho Increase the warning level to spot more mistakes
 1.22  04-Dec-2021  pho librefuse: Preparation of a proper API versioning; no more #ifdef woes in user code

The goal is to fully support FUSE API version 3.0 while maintaining
API/ABI compatibility with code written for 2.6 (or even older).

* <fuse.h> now emits a compiler warning if it's included without
defining FUSE_USE_VERSION. It had been silently defaulted to the
latest supported version prior to this change. This is permissive
compared to the original FUSE, as it emits an error instead.

* <fuse.h> now emits a warning if FUSE_USE_VERSION is higher than what
can be provided.

* Added a macro FUSE_MAKE_VERSION(maj, min). It was missing from
librefuse <fuse.h>.

No actual API updates have been made (yet).
 1.21  01-Dec-2021  pho Revert my previous change to struct fuse_opt

I should have thought twice before commiting it. Of course changing
the layout of a struct breaks ABI compatibility. Change the offset
back to fixed 32 bits.
 1.20  01-Dec-2021  pho Use correct types for the fields of struct fuse_opt

This change shouldn't make any behavioral differences in reality, but
compilers these days dislike converting -1U to int32_t implicitly,
which is indeed understandable.
 1.19  30-Oct-2021  nia refuse(3): Simplify reallocation logic with reallocarr.
 1.18  16-Nov-2016  pho Major rework of fuse_opt_parse(3) so that it supports all the functionality of the original function
 1.17  15-Nov-2016  pho fuse_opt_match(3): Support every form of templates, not just the simple strcmp case

Also it should return 1 for successful matches, not the way around.
 1.16  14-Nov-2016  pho Implement missing fuse_opt_add_opt(3) and fuse_opt_add_opt_escaped(3)
 1.15  01-Mar-2011  soda branches: 1.15.26;
fuse_opt_parse() was using uninitialized struct fuse_opt_option::data,
this bug made fuse_opt_proc_t not work, if it used first ``data'' argument,
and might cause memory corruption even.
 1.14  19-Jan-2009  lukem branches: 1.14.4;
fix -Wsign-compare issue
 1.13  05-Nov-2007  pooka branches: 1.13.12;
Header cleanup: don't need defs.h to do a few includes for us. Also,
use #include <> for global headers instead of #include "".
 1.12  06-Oct-2007  xtraeme Use a two clause license for all the code I contributed.

The envsys code will be changed later.
 1.11  17-May-2007  christos branches: 1.11.4;
More fixes:
- make sure that the args array is NULL terminated.
- make sure argc is initialized and argv is set to NULL after freeing.
- make the deep copy function an opt interface function.
 1.10  16-May-2007  christos - Always check strdup return. For now we are lazy and bail instead of cleaning
up.
- Use malloc and free instead of macros, delete macros.
- Merge the two copies of deep copy and free args that were slightly buggy
into one and use that one.

XXX: Lots of ints should be size_t.
XXX: Bailing on error is not a good thing for a library.
XXX: Defs.h should be eliminated completely. Not all files need all the headers.
 1.9  17-Apr-2007  agc The error return code from fuse_opt_add_arg() and fuse_opt_insert_arg() is
actually -1, not 1. Fix the broken sewing machine, and make it sew.
 1.8  17-Apr-2007  xtraeme Forgot to move the prototype in a comment to the correct place.
 1.7  17-Apr-2007  xtraeme Sync comments with reality.
 1.6  17-Apr-2007  xtraeme Wrap long lines.
 1.5  16-Apr-2007  agc Flesh out the args management a bit more:

+ put some meat into the add_arg and insert_arg functions
+ implement the free_args function
+ use 0 and 1 return values, instead of EXIT_SUCCESS and EXIT_FAILURE, in
internal functions (they bear no relation to shell exit values)
+ deep copy argument structures in refuse.c - we need to do this because
some FUSE file systems attempt to obliterate^Wcloak the argument vector
"for security reasons"
+ a side benefit of this is that we get the specific refuse file system
name back again:

[10:48:43] agc@inspiron1300 ...src/lib/librefuse 38 > df
Filesystem 1K-blocks Used Avail Capacity Mounted on
/dev/dk0 28101396 19318530 7377798 72% /
kernfs 1 1 0 100% /kern
procfs 4 4 0 100% /proc
ptyfs 1 1 0 100% /dev/pts
puffs:refuse:id3fs 0 0 0 100% /mnt
[10:48:51] agc@inspiron1300 ...src/lib/librefuse 39 >
 1.4  13-Mar-2007  agc Revert the most recent changes I made - they weren't ready for primetime.
 1.3  13-Mar-2007  agc + Only use EXIT_SUCCESS and EXIT_FAILURE for the return code to the
shell in the fuse_opt functions

+ add new debugging functions:
+ __fuse_debug(), which is used to set and retrieve the
debugging level, so that debugging information can be turned
on and off from the user-level filesystem, and
+ __fuse_pargs(), which prints out an argv vector

+ put the comment about pu_privdata back with the code it references

+ put the code to place the refuse name back into the fuse_new()
function - we have access to all the arguments there.

+ specifically include <fuse_opt.h> in <fuse.h> - this would seem to
be what FUSE itself does, judging by the number of fuse-based
filesystems I've patched to include <fuse_opt.h> specifically

+ do away with the forward reference to struct fuse_args in fuse.h,
since it is defined just after the forward reference without being
referenced in between

+ fill in the missing refuse_opt args functionality - add an arg to the
args structure in fuse_opt_add_arg() and fuse_opt_insert_arg(), and
free allocated memory in fuse_opt_free_args().

+ get rid of spurious forward declarations and prototypes.

+ if REFUSE_INHERIT_FS_CHARACTERISTICS is defined when refuse is built,
file systems inherit the vfs characteristics of their mountpoints. The
default value is NOT to inherit the vfs characteristics.

+ perform a deep copy of the fuse_args structure in fuse_mount() -
this is so that existing FUSE filesystems still DTRT when arguments
are zeroed out.
 1.2  28-Feb-2007  agc Minor cosmetic changes to clean up some lint.
 1.1  28-Feb-2007  xtraeme * Move fuse_opt* defs and prototypes into fuse_opt.h.
* Move fuse_opt* funcs from refuse.c into refuse_opt.c.

Implement fuse_opt_parse() and fuse_opt_match(). And make the other
functions just dummy, always returning 0 (I added debugging printfs
to see what the application is trying to do).

For now there are two things that do not work in fuse_opt:

* options accepting arguments, i.e -otimeout=%u or -ofile=%s.
* options without arguments are not enabled, just parsed.

At least now curlftpfs works, even with verbose mode! :-)

Ok'ed by pooka.
 1.11.4.1  06-Nov-2007  matt sync with HEAD
 1.13.12.1  20-Mar-2011  bouyer Pull up following revision(s) (requested by soda in ticket #1568):
lib/librefuse/refuse_opt.c: revision 1.15
fuse_opt_parse() was using uninitialized struct fuse_opt_option::data,
this bug made fuse_opt_proc_t not work, if it used first ``data'' argument,
and might cause memory corruption even.
 1.14.4.1  05-Mar-2011  bouyer Sync with HEAD
 1.15.26.1  07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)

RSS XML Feed