aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorLines
2020-11-06ioctl_client.c: fix potential fd leakage problemZhiqiang Liu-3/+8
In ioctl_client.c, fd is not closed before return, thus it will cause fd leakage problem. Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com> Signed-off-by: Haotian Li <lihaotian9@huawei.com>
2020-11-06mount.fuse.c: fix potential memory leak in main funcZhiqiang Liu-2/+11
In mount.fuse.c, there are several memory leak problems in main func. For example, setuid_name is allocated by calling xstrdup func, however it is not freed before calling execl func. Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com> Signed-off-by: Haotian Li <lihaotian9@huawei.com>
2020-11-06mount.fuse.c: fix potential accessing NULL pointerZhiqiang Liu-1/+1
In mount.fuse.c, pwd is set by calling getpwnam func. If the matching entry is not found or an error occurs in getpwnam func, pwd will be NULL. So we need to check whether pwd is NULL before accessing it. Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com> Signed-off-by: Haotian Li <lihaotian9@huawei.com>
2020-11-06buffer.c: check whether buf is NULL in fuse_bufvec_advance funcZhiqiang Liu-0/+3
In fuse_bufvec_advance func, calling fuse_bufvec_current func may return NULL, so we should check whether buf is NULL before using it. Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com> Signed-off-by: Haotian Liu <lihaotian9@huawei.com>
2020-11-04Fix incorrect date in ChangelogLilo Huang-1/+1
It should be 2020 rather than 2010. Thanks.
2020-10-29remove fuse_mutex_initRosen Penev-20/+6
This seems to have been added before 2006 to fix a uclibc bug. It doesn't seem to be the case anymore so just get rid of it. Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-10-29remove old uclibc hackRosen Penev-2/+1
This actually prevents sshfs linking to it as fuse_new becomes unavailable. According to the git history, this seems to predate 2006. Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-10-09Released 3.10.0Nikolaus Rath-5/+10
2020-10-03Fix typo "retuned" -> "returned" (#553)ferivoz-2/+2
2020-09-20Allow caching symlinks in kernel page cache. (#551)Etienne Dublé-1/+20
This commit defines a new capability called `FUSE_CAP_CACHE_SYMLINKS`. It is off by default but you can now enable it by setting this flag in in the `want` field of the `fuse_conn_info` structure. When enabled, the kernel will save symlinks in its page cache, by making use of the feature introduced in kernel 4.20: https://github.com/torvalds/linux/commit/5571f1e65486be025f73fa6aa30fb03725d362a2
2020-09-14Fix compilation for compilers not supporting __has_attributeTom Callaway-2/+6
2020-09-12Update Travis to Ubuntu BionicTom Callaway-7/+17
2020-09-11Implement GCC 10 style symbol versioning (#545)Tom Callaway-10/+38
2020-09-09Updated example code to work with new API (#547)AKowshik-18/+42
2020-08-28Added TSAN suppression file.Nikolaus Rath-0/+5
2020-08-28Suppress some bogus thread sanitizer warnings.Nikolaus Rath-1/+9
2020-08-10Remove pointer to professional consulting offersNikolaus Rath-7/+0
I do not want to offer this actively anymore.
2020-08-09Fix-up changelog.Nikolaus Rath-0/+10
2020-08-09Released 3.9.4Nikolaus Rath-1/+16
2020-08-09fuse_send_data_iov(): correctly calculate total buffer size.Nikolaus Rath-1/+1
Fixes: #538.
2020-08-09Define fuse_session_loop_mt as a macro on uclibc and MacOS (#532)asafkahlon-0/+6
On uclibc and MacOS we don't use versioned symbols. Hence, there's no definition for fuse_session_loop_mt on those cases and the linker won't be able to resolve calls to fuse_session_loop_mt() Signed-off-by: Asaf Kahlon <asafka7@gmail.com>
2020-08-09Fixed typo in command to compile program (#536)AKowshik-1/+1
2020-08-09Doc fixes (#537)Junichi Uekawa-4/+4
* Add fallocate to list of operations that may omit path. * earlier versions is 10+ years old. Document is not obvious how old it is. Add it. * Update manpage link
2020-08-09Fix FreeBSD CI (#539)Li-Wen Hsu-2/+2
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-10fuse_lowlevel: Move assert for se before dereferencing it with se->debug (#530)winndows-2/+1
Move assert for se before dereferencing it with se->debug. Signed-off-by: Liao Pingfang <liao.pingfang@zte.com.cn> Co-authored-by: Liao Pingfang <liao.pingfang@zte.com.cn>
2020-07-03Fixed minor print alignment issue in iconv_help(), replacing tab with space ↵Albert Chen-1/+1
(#519)
2020-07-03Fix the typo "filed" -> "field" in fuse manpage (#524)winndows-1/+1
Fix the typo "filed" -> "field" in fuse manpage. Signed-off-by: Liao Pingfang <liao.pingfang@zte.com.cn> Co-authored-by: Liao Pingfang <liao.pingfang@zte.com.cn>
2020-07-03README: Correct the directory name from 'examples' to 'example' (#526)winndows-1/+1
Correct the directory name from 'examples' to 'example' in readme. Signed-off-by: Liao Pingfang <liao.pingfang@zte.com.cn> Co-authored-by: Liao Pingfang <liao.pingfang@zte.com.cn>
2020-07-03docs: Replace `mesonconf` with `meson configure` (#528)Craig Chi-4/+4
Fixes #527
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>
2020-06-22Typo fixed. (#520)Seunghoon Yeon-1/+1
2020-06-12Released 3.9.2Nikolaus Rath-1/+11
2020-05-15fix format in test (#515)Rosen Penev-1/+1
Fixes warning under 32-bit.
2020-05-15Avoid closing se->fd twice in fuse_lowlevel.c (#516)Fabian Vogt-0/+1
If fuse_session_unmount is called before fuse_session_destroy, both would try to close(se->fd). Avoid that by resetting it in fuse_session_unmount.
2020-05-14passthrough_ll: remove symlink fallbacks (#514)Miklos Szeredi-139/+14
* passthrough_ll/hp: remove symlink fallbacks Path lookup in the kernel has special rules for looking up magic symlinks under /proc. If a filesystem operation is instructed to follow symlinks (e.g. via AT_SYMLINK_FOLLOW or lack of AT_SYMLINK_NOFOLLOW), and the final component is such a proc symlink, then the target of the magic symlink is used for the operation, even if the target itself is a symlink. I.e. path lookup is always terminated after following a final magic symlink. I was erronously assuming that in the above case the target symlink would also be followed, and so workarounds were added for a couple of operations to handle the symlink case. Since the symlink can be handled simply by following the proc symlink, these workardouds are not needed. Signed-off-by: Miklos Szeredi <mszeredi@redhat.com> Co-authored-by: Miklos Szeredi <mszeredi@redhat.com>
2020-04-20Do not require C++ compiler for buildingFabrice Fontaine-2/+2
Fixes: - http://autobuild.buildroot.org/results/a6e64213f2910b2b81e79cb1e96e558413d7f70a Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2020-03-19Released 3.9.1Nikolaus Rath-11/+15
2020-03-13Fix issue preventing using splice with reads (#505)Jean-Yves VET-8/+6
Context: SPLICE_WRITE is not used with regular buffers (i.e. when they are not file-descriptor backed buffers). There is a bug which assumes file descriptors are used. If the amount of data associated with those FD is lower than twice the page size, SPLICE_WRITE is not utilized. With regular buffers the aggregated size was always 0. Because vmsplice (splice user pages to/from a pipe) is called before splice in fuse_lowlevel.c, regular buffers would also work with splice. This patch prevents to fallback to non-splice enabled copies when itheir is no FD involved.
2020-03-13Align help options (#500)Andrew Gaul-1/+1
2020-03-13State GPL version in comment (#485)Dr. David Alan Gilbert-23/+23
IN a bunch of comments we say 'under the terms of the GNU GPL', make it clear this is GPLv2 (as LICENSE says). Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2020-02-24passthrough_ll: Remove unneeded variable assignment (#501)philmd-2/+0
Fix warning reported by Clang static code analyzer: example/passthrough_ll.c:390:5: warning: Value stored to 'saverr' is never read saverr = ENOMEM; ^ ~~~~~~ Fixes: 4a92a82f2e2 Reported-by: Clang Static Analyzer Reviewed-by: Ján Tomko <jtomko@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
2020-02-24Travis-CI: Fix ImportError: No module named 'zipp' (#502)philmd-0/+1
Upgrade pip to fix [*]: [66/66] Linking target example/passthrough_hp. Traceback (most recent call last): File "/usr/lib/python3.5/runpy.py", line 174, in _run_module_as_main mod_name, mod_spec, code = _get_module_details(mod_name, _Error) File "/usr/lib/python3.5/runpy.py", line 133, in _get_module_details return _get_module_details(pkg_main_name, error) File "/usr/lib/python3.5/runpy.py", line 109, in _get_module_details __import__(pkg_name) File "/usr/local/lib/python3.5/dist-packages/pytest/__init__.py", line 6, in <module> from _pytest.assertion import register_assert_rewrite File "/usr/local/lib/python3.5/dist-packages/_pytest/assertion/__init__.py", line 7, in <module> from _pytest.assertion import rewrite File "/usr/local/lib/python3.5/dist-packages/_pytest/assertion/rewrite.py", line 24, in <module> from _pytest.assertion import util File "/usr/local/lib/python3.5/dist-packages/_pytest/assertion/util.py", line 14, in <module> import _pytest._code File "/usr/local/lib/python3.5/dist-packages/_pytest/_code/__init__.py", line 2, in <module> from .code import Code # noqa File "/usr/local/lib/python3.5/dist-packages/_pytest/_code/code.py", line 28, in <module> import pluggy File "/usr/local/lib/python3.5/dist-packages/pluggy/__init__.py", line 16, in <module> from .manager import PluginManager, PluginValidationError File "/usr/local/lib/python3.5/dist-packages/pluggy/manager.py", line 11, in <module> import importlib_metadata File "/usr/local/lib/python3.5/dist-packages/importlib_metadata/__init__.py", line 9, in <module> import zipp ImportError: No module named 'zipp' The command "test/travis-build.sh" exited with 1. [*] https://travis-ci.org/libfuse/libfuse/builds/651523034 Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
2020-02-04Include limits.h because of PATH_MAX usage. (#498)maxice8-0/+1
Fixes build with musl libc on Alpine Linux.
2020-01-31Update comment for the copy_file_range operation (#497)Florian Weimer-3/+4
copy_file_range was first implemented with copy-based emulation in glibc 2.27, but the emulation was subsequently removed again because correct emulation depends on why the application attempted to make a copy. Therefore, file systems cannot rely on low-level userspace performing emulation.
2020-01-30examples: mark ops variables constant (#496)zsugabubus-13/+13
2020-01-27Remove trailing comma in enums (#494)zsugabubus-6/+6
They are illegal in C89/90.
2020-01-25Fixes 477, optional src_dir in tst_(rmdir,unlink) (#493)Anthony Rebello-8/+20
tst_rmdir and tst_unlink now pass for passthrough_hp. Previously, tst_rmdir and tst_unlink created the directory / file using src_dir, causing the test to fail as the cache was stale. Now, the src_dir is optional. When cache is enabled, tst_rmdir and tst_unlink do not provide a src_dir, forcing the test to use mnt_dir itself.
2020-01-24passthrough_ll: Use cache_readdir for directory open (#492)Misono Tomohiro-1/+1
Upstreamed from: https://www.redhat.com/archives/virtio-fs/2020-January/msg00106.html Since keep_cache(FOPEN_KEEP_CACHE) has no effect for directory as described in fuse_common.h, use cache_readdir(FOPEN_CACHE_DIR) for diretory open when cache=always mode. Signed-off-by: Misono Tomohiro <misono.tomohiro@jp.fujitsu.com>
2020-01-06passthrough_ll: pass correct errno to fuse_reply_err()Dr. David Alan Gilbert-1/+1
fuse_reply_err() expects the error code, not its negative. Upstreamed from https://www.redhat.com/archives/virtio-fs/2020-January/msg00000.html. Original commit message: lo_copy_file_range() passes -errno to fuse_reply_err() and then fuse_reply_err() changes it to errno again, so that subsequent fuse_send_reply_iov_nofree() catches the wrong errno.(i.e. reports "fuse: bad error value: ..."). Make fuse_send_reply_iov_nofree() accept the correct -errno by passing errno directly in lo_copy_file_range(). Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com> Reviewed-by: Eryu Guan <eguan@linux.alibaba.com> Co-authored-by: Xiao Yang <ice_yangxiao@163.com>