aboutsummaryrefslogtreecommitdiffstats
path: root/lib/modules
AgeCommit message (Collapse)AuthorLines
2025-07-16Add statx supportJoanne Koong-0/+38
This commit adds libfuse support for FUSE_STATX requests on linux distributions. Currently, statx is only supported on linux. To make the interface a ergonomic as possible (eg using native 'struct statx' vs 'struct fuse_statx'), this implementation gates the 'struct statx' changes by #ifdef linux. Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
2025-06-27license: s/COPYING/GPL2.txt, s/COPYING.LIB/LGPL2.txtizxl007-2/+2
Signed-off-by: izxl007 <zeng.zheng@zte.com.cn>
2023-03-28Fix use-after-free warningMatthias Goergens-1/+2
When building, I get the following warning: ```bash $ ninja [18/71] Compiling C object lib/libfuse3.so.3.14.1.p/modules_iconv.c.o ../lib/modules/iconv.c: In function ‘iconv_convpath’: ../lib/modules/iconv.c:85:38: warning: pointer ‘newpath’ may be used after ‘realloc’ [-Wuse-after-free] 85 | p = tmp + (p - newpath); | ~~~^~~~~~~~~~ ../lib/modules/iconv.c:80:31: note: call to ‘realloc’ here 80 | tmp = realloc(newpath, newpathlen + 1); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [71/71] Linking target example/passthrough_hp ``` It's a false positive, I thinks. But it's also easy to silence this warning with a small refactor.
2023-01-28Install a the configure_file (config.h) and use in headersBernd Schubert-2/+2
This addresses: https://github.com/libfuse/libfuse/issues/724 HAVE_LIBC_VERSIONED_SYMBOLS configures the library if to use versioned symbols and is set at meson configuration time. External filesystems (the main target, actually) include fuse headers and the preprocessor then acts on HAVE_LIBC_VERSIONED_SYMBOLS. Problem was now that 'config.h' was not distributed with libfuse and so HAVE_LIBC_VERSIONED_SYMBOLS was never defined with external tools and the preprocessor did the wrong decision. This commit also increases the the minimal meson version, as this depends on meson feature only available in 0.50 <quote 'meson' > WARNING: Project specifies a minimum meson_ version '>= 0.42' but uses features which were added in newer versions: * 0.50.0: {'install arg in configure_file'} </quote> Additionally the config file has been renamed to "fuse_config.h" to avoid clashes - 'config.h' is not very specific.
2021-08-25remove executable file mode bit from source filesa1346054-0/+0
2021-06-16Fix: a potential crash on failure to setlocalelixiaokeng-4/+2
setlocale() can fail, returning NULL, which will lead to a crash in iconv_new(). Fix it like in iconv_help(). Signed-off-by: Lixiaokeng <lixiaokeng@huawei.com>
2020-07-10Fix: crash on failure to set locale (#529)Jérémie Galarneau-4/+9
setlocale() can fail, returning NULL, if the user has an invalid (or missing) locale set in the LANG environment variable. In my case, this happens when using VS Code's integrated terminal to launch a fuse-based filesystem. A bug (fix upcoming) results in VS Code setting an invalid locale. iconv_help() currently passes the return value of setlocale(...) directly to strdup() without checking if it is NULL, resulting in a crash. To reproduce, simply set LANG="something_invalid" and call fuse_lib_help(). Stack trace when the process receives `SIGSEGV`: (gdb) bt #0 0x00007fabd0fcc4b5 in __strlen_avx2 () from /usr/lib/libc.so.6 #1 0x00007fabd0ef9233 in strdup () from /usr/lib/libc.so.6 #2 0x00007fabd13b8128 in iconv_help () at ../lib/modules/iconv.c:641 #3 0x00007fabd13b81a8 in iconv_opt_proc (data=0x55580a6ee850, arg=0x55580a6edfb0 "-h", key=0, outargs=0x7ffeeb1a8ec8) at ../lib/modules/iconv.c:658 #4 0x00007fabd13af7d5 in call_proc (ctx=0x7ffeeb1a8ea0, arg=0x55580a6edfb0 "-h", key=0, iso=0) at ../lib/fuse_opt.c:161 #5 0x00007fabd13afaf1 in process_opt (ctx=0x7ffeeb1a8ea0, opt=0x7fabd13c3d40 <iconv_opts>, sep=0, arg=0x55580a6edfb0 "-h", iso=0) at ../lib/fuse_opt.c:233 #6 0x00007fabd13afd5a in process_gopt (ctx=0x7ffeeb1a8ea0, arg=0x55580a6edfb0 "-h", iso=0) at ../lib/fuse_opt.c:285 #7 0x00007fabd13b0117 in process_one (ctx=0x7ffeeb1a8ea0, arg=0x55580a6edfb0 "-h") at ../lib/fuse_opt.c:368 #8 0x00007fabd13b0190 in opt_parse (ctx=0x7ffeeb1a8ea0) at ../lib/fuse_opt.c:379 #9 0x00007fabd13b03d3 in fuse_opt_parse (args=0x7ffeeb1a8f70, data=0x55580a6ee850, opts=0x7fabd13c3d40 <iconv_opts>, proc=0x7fabd13b8186 <iconv_opt_proc>) at ../lib/fuse_opt.c:414 #10 0x00007fabd13b8226 in iconv_new (args=0x7ffeeb1a8f70, next=0x0) at ../lib/modules/iconv.c:680 #11 0x00007fabd13a5627 in print_module_help (name=0x7fabd13b9e1c "iconv", fac=0x7fabd13d48e0 <fuse_module_iconv_factory>) at ../lib/fuse.c:4692 #12 0x00007fabd13a56aa in fuse_lib_help (args=0x7ffeeb1a9238) at ../lib/fuse.c:4721 iconv_help() is modified to print an error when setlocale() fails. It then carries on printing the iconv module's help. Reading setlocale(3), it seems that the strdup() of the result was not necessary. Signed-off-by: Jérémie Galarneau <jeremie.galarneau@gmail.com>
2020-07-03Fixed minor print alignment issue in iconv_help(), replacing tab with space ↵Albert Chen-1/+1
(#519)
2020-07-01libfuse: Assign NULL to "old" to avoid free it twice (#522)winndows-0/+1
Assign NULL to "old" at the first free(), to avoid the possible 2nd free() for it. Signed-off-by: Liao Pingfang <liao.pingfang@zte.com.cn> Co-authored-by: Liao Pingfang <liao.pingfang@zte.com.cn>
2019-11-03Implement lseek operation (#457)Yuri Per-0/+28
2019-09-04Introduce callback for loggingStefan Hajnoczi-8/+8
Introduce an API for custom log handler functions. This allows libfuse applications to send messages to syslog(3) or other logging systems. See include/fuse_log.h for details. Convert libfuse from fprintf(stderr, ...) to log_fuse(level, ...). Most messages are error messages with FUSE_LOG_ERR log level. There are also some debug messages which now use the FUSE_LOG_DEBUG log level. Note that lib/mount_util.c is used by both libfuse and fusermount3. Since fusermount3 does not link against libfuse, we cannot call fuse_log() from lib/mount_util.c. This file will continue to use fprintf(stderr, ...) until someone figures out how to split it up. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2017-07-06Don't redefine FUSE_USE_VERSIONNikolaus Rath-4/+0
It's already set in meson.build as compiler flag.
2016-10-20Turn fuse_operations.nopath_flag into fuse_config.nullpath_okNikolaus Rath-4/+4
Modifying struct fuse_config in the init() handler is the canonical way to adjust file-system implementation specific settings. There is no need to have flags in struct fuse_operations.
2016-10-20Pass struct fuse_config to high-level init() handler.Nikolaus Rath-4/+6
2016-10-15Pass fuse_file_info to getattr, chown, chmod, truncate, utimens handlersNikolaus Rath-75/+29
This obsoletes the ftruncate & fgetattr handlers. Fixes #58.
2014-07-15libfuse: add flags to ->rename()Miklos Szeredi-4/+4
See renameat2() system call in linux-3.15 and later kernels.
2014-03-05libfuse: implement readdirplus for high-level APIEric Wong-6/+9
Reuse the old "readdir" callback, but add a flags argument, that has FUSE_READDIR_PLUS in case this is a "plus" version. Filesystems can safely ignore this flag, but if they want they can add optimizations based on it: i.e. only retrieve the full attributes in PLUS mode. The filler function is also given a flags argument and the filesystem can set FUSE_FILL_DIR_PLUS if all the attributes in "stat" are valid.
2013-07-26Print help on stdout instead of stderrMiklos Szeredi-2/+2
2013-07-24libfuse: remove "-D_FILE_OFFSET_BITS=64" from fuse.pcMiklos Szeredi-0/+4
add AC_SYS_LARGEFILE to your configure.ac instead.
2012-07-20Remove compatibility path handlingMiklos Szeredi-2/+0
This means that now NULL is a valid path for operations that take a file descriptor if the file was unlinked and hard_remove option is specified.
2012-07-19Start of 3.0 seriesMiklos Szeredi-2/+2
Change the version numbers. This is going to be a new major version of the library breaking backward compatibility on the binary level as well as the source level.
2012-07-04libfuse: mark some data constantMiklos Szeredi-4/+4
2011-07-06Add ->flock() operation to low and high level interfacesMiklos Szeredi-0/+26
This fixes problems with emulating flock() with POSIX locking. Reported by Sebastian Pipping. As with lock/setlk/getlk most filesystems don't need to implement this, as the kernel takes care of file locking. The only reason to implement locking operations is for network filesystems which want file locking to work between clients.
2011-03-30Fix a possible resource leak (free the old up)Laszlo Papp-0/+4
2010-11-10add read_buf method to high level APIMiklos Szeredi-8/+8
Add a new read_buf() method to the highlevel API. This allows returning a generic buffer from the read method, which in turn allows zero copy reads.
2010-11-10add write_buf method to high level APIMiklos Szeredi-7/+7
Add new write_buf() method to the highlevel API. Similarly to the lowlevel write_buf() method, this allows implementing zero copy writes.
2010-06-15* Add a nopath option and flag, indicating that path argumentMiklos Szeredi-0/+2
need not be calculated for the following operations: read, write, flush, release, fsync, readdir, releasedir, fsyncdir, ftruncate, fgetattr, lock, ioctl and poll.
2008-02-08Support receiving file handle from kernel in GETATTR request; Allow ↵Miklos Szeredi-120/+150
operations with a NULL path argument, if the filesystem supports it
2007-12-12change indentingMiklos Szeredi-965/+969
2007-10-16Clarify licence version to be "LGPLv2" for the libraryMiklos Szeredi-2/+2
2007-05-11update flush changesMiklos Szeredi-1/+1
2007-04-28docMiklos Szeredi-3/+17
2007-02-03Add filesystem stacking support to high level APIMiklos Szeredi-0/+1356