Commit Graph

1764 Commits

Author SHA1 Message Date
Amir Goldstein e4e615af0e Do not run unlinked files test on passthrough_hp with old kernels
test_syscalls unlinked testfiles check fails on passthourhg_hp without
the kernel commit "fuse: fix illegal access to inode with reused nodeid"
queued for kernel 5.14 [1].

Make this check opt-in and do not run it with kernel version before 5.14.

[1] https://lore.kernel.org/linux-fsdevel/CAJfpegtGKjeK8E5QsHKF0=re1J9wVHuGRVgg9NDJ_OOwQdCUNg@mail.gmail.com/

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
2021-06-23 11:46:19 +01:00
lixiaokeng 4d2860a9f5 Fix: a potential crash on failure to setlocale
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>
2021-06-16 18:25:14 +01:00
Amir Goldstein 0f2cdd389c passthrough_hp: excercise reusing inode numbers
Before last unlink() release the reference on inode.fd to allow reuse
of underlying fs inode number, mark the server inode "deleted" and bump
it's generation counter.

When same inode number is found on lookup(), the server inode object will
be reused as well.

Skip this when inode has an open file and when writeback cache is enabled.

This will be used to verify inode reuse bug fix in the kernel.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
2021-06-14 09:13:12 +01:00
Amir Goldstein 7bd58ebe84 test/test_syscalls.c: check unlinked testfiles at the end of the test
On some tests on regular files, open an O_PATH fd of the testfile and
record it along side the size and mode and inode.

At the end of all tests, use recorded testfiles info to re-check the size
mode and inode of the unlinked testfiles.

With O_PATH fd, the server does not have to keep the inode alive so FUSE
inode may be stale or bad.  Therefore, ESTALE and EIO are valid results
for fstat() on the old testfile fd's, but returning the wrong size or
mode is an invalid result.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
2021-06-14 09:13:12 +01:00
Amir Goldstein 3b44599685 test/test_syscalls.c: refactor fcheck_* helpers
Avoid multiple fstat() calls and consolidate all fcheck_* helpers
into fcheck_stat().

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
2021-06-14 09:13:12 +01:00
Amir Goldstein e55463e8a5 test/test_syscalls.c: use unique filename per test
Generate unique filename per test (only for regular file for now).
Make sure to unlink the unique filename after each test.

realpath variable was renamed to basepath_r to fix build warning
on conflicting symbols with realpath() function.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
2021-06-14 09:13:12 +01:00
Nikolaus Rath 49d416b505 Released 3.10.4 2021-06-09 09:13:01 +01:00
asafkahlon 8352abc666 Add an option to disable building tests (#533)
Signed-off-by: Asaf Kahlon <asafka7@gmail.com>
2021-06-09 09:07:25 +01:00
Christian Menges 79286adbe5 Cuse example: Fix memory leak (#607)
* cuse example: fix memory leak

* Travis CI: re-enable leak checking
2021-06-09 09:04:41 +01:00
Sergey Fedoseev 711ea8fa8c fix typo in man (#609) 2021-06-09 09:04:08 +01:00
Amir Goldstein dad2789473 test/test_syscalls.c: fix test failure on xfs src dir (#611)
rename dir loop test fails when test tmp dir is xfs with an error
 test_rename_dir_loop() - rename : File exists

That is because xfs returns EEXIST for the case of renaming over
a non-empty directory.

According to rename(2) man page, EEXIST and ENOTEMPTY are both valid
error code in this case.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
2021-06-02 10:23:06 +01:00
Junichi Uekawa 09f054744a Define FUSE_USE_VERSION in Doxygen. (#608)
We currently do not pass anything in PREDEFINED and that means
FUSE_USE_VERSION is undefined.

Add that definition so that Doxygen built-in C pre-processor can use
FUSE_USE_VERSION value to find the correct comment to parse.
2021-05-19 09:32:14 +01:00
Christian Menges f078bbf2cb Fix memory leaks in examples (#604) 2021-05-09 11:12:01 +01:00
Christian Menges 61ed2bca90 Bump cxxopts from 2.2.0 to 2.2.1 (#602) 2021-05-09 10:00:57 +01:00
rfjakob 7e537a95ff doc: Add "fuse (4)" to SEE ALSO sections in man pages (#601)
fuse (4) is an excellent introduction to the FUSE protocol,
and it lists fusermount (1) and mount.fuse (8) in its
SEE ALSO section.

I (the author of gocryptfs) was not aware of this man
page till March 2021, which suggest that it should be
made more discoverable.

So link back to fuse (4) in our SEE ALSO sections.
2021-05-08 14:15:55 +01:00
Junichi Uekawa 01d8ebe436 Fix doxygen warnings. (#600)
Some parameters were undocumented, and @file does not mean to expand current file name.
2021-05-07 10:43:30 +01:00
Junichi Uekawa f0207c4786 fusermount3.1: refer to mount.fuse3 (#599)
mount.fuse was renamed to mount.fuse3.
2021-05-05 10:51:08 +01:00
Manuel Jacob a7ae35d4b5 Add missing exceptions to fuse_reply_err() documentation. (#597)
Co-authored-by: Manuel Jacob <test>
2021-04-23 08:31:37 +01:00
Heiko Becker f3cb4daad7 Fix a few meson warnings (#596)
* Use meson's warning_level instead of passing -Wflags

"-Wall" is included by default and level 2 adds "-Wextra". Avoids a
warning from meson.

Signed-off-by: Heiko Becker <heirecka@exherbo.org>

* Set the C++ language standard through a meson option

Avoids a warning from meson.

Signed-off-by: Heiko Becker <heirecka@exherbo.org>
2021-04-13 18:54:10 +01:00
Nikolaus Rath a05ed7aa91 Added ChangeLog template for next release. 2021-04-12 11:21:11 +01:00
Nikolaus Rath bd643a32cf Released 3.10.3 2021-04-12 11:18:08 +01:00
Hookey d8f5fe0b31 Remove unused fuse_worker bufsize (#590)
Not used since https://github.com/libfuse/libfuse/commit/561d7054d856eea6c2d634093546d6af773dada9
2021-04-12 11:08:50 +01:00
Tobias Nießen b982a8d45d Fix typo in fuse_lowlevel.h (#593) 2021-03-30 13:37:30 +01:00
Andrew Gaul 72ff9609ac Fix typos (#592) 2021-03-25 08:40:27 +00:00
Jean-Pierre André 3dec359766 Fix returning d_ino and d_type by readdir(3) in non-plus mode
When not using the readdir_plus mode, the d_type was not returned,
and the use_ino flag was not used for returning d_ino.

This patch fixes the returned values for d_ino and d_type by readdir(3)

The test for the returned value of d_ino has been adjusted to also
take the d_type into consideration and to check the returned values in
both basic readdir and readdir_plus modes. This is done by executing
the passthrough test twice.

Co-authored-by: Jean-Pierre André <jpandre@users.sourceforge.net>
2021-03-18 09:52:30 +00:00
Nikolaus Rath 62bd35cc1a Released 3.10.2 2021-02-05 09:07:28 +00:00
Martin Pärtel 884b57886b Fix returning inode numbers from readdir() in offset==0 mode. (#584)
- Test added for all passthrough examples.
- passthrough.c uses offset==0 mode. The others don't.
- passthrough.c changed to set FUSE_FILL_DIR_PLUS to make the test pass.
- This fixes #583.
2021-02-03 09:53:21 +00:00
Stephen Kitt ce22e48a8c Ignore "-o nonempty" (#582)
Commit 0bef21e854 removed "-o nonempty" since mounting over
non-empty directories is always allowed. But this broke tools which
specify "-o nonempty". Since the expected behaviour is the same
anyway, ignoring the "nonempty" option seems safe, and allows programs
specifying "-o nonempty" to continue working with fusermount3.

This would fix https://bugs.debian.org/939767

Signed-off-by: Stephen Kitt <steve@sk2.org>
2021-01-28 21:51:10 +00:00
Laurent Bigonville 1ffa33f76a Fix FTBFS on kfreebsd (#581)
kfreebsd is a FreeBSD kernel and a GNU libc

The only macro defined in that case is __FreeBSD_kernel__

Fix #580
2021-01-17 10:49:07 +00:00
John Baber-Lucero 1ab776b800 Fix a few typos in README.md. (#579)
* Fix a few typos in README.md.

* Change recommendation to mandate for meson and ninja

Co-authored-by: John Baber-Lucero <git@frundle.com>
2021-01-12 10:41:35 +00:00
Feverfew 916322d931 Fix typo (#578) 2021-01-10 11:50:28 +00:00
richardweinberger c041da9d41 fusermount: Check for argv[0] being present (#577)
It is perfectly legal to execute a program with argc == 0 and therefore
no argv.
fusermount needs to check for this case, otherwise it will pass a NULL
poiunter to strdup() and cause undefined behavior.
Especially since fusermount is setuid root, we need to extra be careful.

Signed-off-by: Richard Weinberger <richard@nod.at>
2021-01-08 10:07:02 +00:00
Alan Somers 272e8447b2 Fix FUSE_COPY_FILE_RANGE in the passthrough example (#575)
Only close the file descriptors if they were just opened.  Otherwise,
the second FUSE_COPY_FILE_RANGE operation on any given file will fail
with EBADF.
2021-01-01 19:34:58 +00:00
Sargun Dhillon 7819d2f04c util/fusermount.c: Assume the kernel supports UMOUNT_NOFOLLOW (#574)
UMOUNT_NOFOLLOW was added in Kernel 2.6.34. It's been 10 years since it's been added
Kernel 5.9, and 5.10 break this check mechanism[1]. Let's deprecate it.

[1]: https://lore.kernel.org/linux-fsdevel/20201223102604.2078-1-sargun@sargun.me/

Signed-off-by: Sargun Dhillon <sargun@sargun.me>
2020-12-27 11:17:46 +00:00
Kangjing "Chaser" Huang 20abadd1ce Add exfat to whitelist (#573) 2020-12-19 10:43:19 +00:00
Nikolaus Rath f8622039d6 Released 3.10.1 2020-12-07 09:52:02 +00:00
Rethan 10285c2dd4 examples/cuse_client: add include file to eliminate compiler warning (#568)
Compiler warning about close(fd), add include file to fix.

Signed-off-by: haoyixing <haoyixing@kuaishou.com>
Co-authored-by: haoyixing <haoyixing@kuaishou.com>
2020-11-24 09:28:13 +00:00
human d77aa6f9e1 fix errno comparison
this affected `-o remember` in single-thread mode, it could prematurely
exit if a signal was received

 # start an example filesystem from example/
 ./passthrough -f -s -o remember=5 ./mnt

 # make the poll() call return with EINTR
 pkill -PIPE passthrough
2020-11-17 11:06:32 +00:00
Zhiqiang Liu 3c5b51c359 buffer.c: correct return value when buf is NULL
In commit b95aba82 ("buffer.c: check whether buf is
NULL in fuse_bufvec_advance func"), if fuse_bufvec_current
func returns NULL, it returns 1 directly. Actually,
we should return 0 when buf is NULL.

Fixes: b95aba82 ("buffer.c: check whether buf is NULL in fuse_bufvec_advance func")
Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
Signed-off-by: Haotian Li <lihaotian9@huawei.com>
2020-11-11 09:32:56 +00:00
Zhiqiang Liu 4dc1267898 test/test_syscalls.c: fix potential fd leakage problems
In test_syscalls.c, several funcs have potential fd leakage
problems. This patch will fix them.

Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
Signed-off-by: Haotian Li <lihaotian9@huawei.com>
2020-11-06 19:26:03 +00:00
Zhiqiang Liu 5bc4fffe9c example/cuse_client.c: fix fd leakage problem
In cuse_client.c, fd should be closed before return.
Otherwise, it will cause fd leakage problem.

Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
Signed-off-by: Haotian Li <lihaotian9@huawei.com>
2020-11-06 19:26:03 +00:00
Zhiqiang Liu ce2f3be2fd ioctl_client.c: fix potential fd leakage problem
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-06 19:26:03 +00:00
Zhiqiang Liu 4c4153c3a7 mount.fuse.c: fix potential memory leak in main func
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-06 19:26:03 +00:00
Zhiqiang Liu ad923849da mount.fuse.c: fix potential accessing NULL pointer
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-06 19:26:03 +00:00
Zhiqiang Liu b95aba823b buffer.c: check whether buf is NULL in fuse_bufvec_advance func
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-06 19:26:03 +00:00
Lilo Huang fd3bc916f0 Fix incorrect date in Changelog
It should be 2020 rather than 2010. Thanks.
2020-11-04 18:32:54 +00:00
Rosen Penev 0fda68d9b8 remove fuse_mutex_init
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-29 10:59:23 +00:00
Rosen Penev 51ed467675 remove old uclibc hack
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-29 10:59:23 +00:00
Nikolaus Rath 9c765877d8 Released 3.10.0 2020-10-09 10:47:25 +01:00
ferivoz fdc4d0f549 Fix typo "retuned" -> "returned" (#553) 2020-10-03 13:14:00 +01:00