Commit Graph

437 Commits

Author SHA1 Message Date
Benjamin Fleischer ccb6821019 Disable macOS specific FUSE API extensions
Some macOS specific features require FUSE API modifications and
extensions that break compatibility with the vanilla FUSE API. Setting
the compile-time flag FUSE_DARWIN_ENABLE_EXTENSIONS to 0, when building
a file system, disables those API extensions. By default, the macOS
specific API modifications and extensions are enabled.
2025-03-09 00:10:32 +01:00
Benjamin Fleischer ed0825440c Mountpoint does not have to exist on macOS
macFUSE will create the mounpoint (in case it does not exist) before
mounting the volume. This allows unprivileged users to mount volumes
under /Volumes.
2025-03-09 00:10:32 +01:00
Benjamin Fleischer a9eb71cb1c Remove conditional fuse_darwin.h include
The header file is no longer available in macFUSE 4.
2025-03-09 00:10:32 +01:00
Benjamin Fleischer b1715a5a62 Remove fuse_opt compatibility code
The fuse_opt compatibility code is no longer needed on macOS. Remove
it since it is not included on any other platform.
2025-03-09 00:10:32 +01:00
h4sh5 21fdcad6fb bump to upload-artifact@v4 2025-03-09 08:58:15 +10:00
Haoxi Tan ef94977c5a
Merge pull request #314 from manu0401/windows_openssh
Windows native OpenSSH fix
2024-11-30 08:25:19 +10:00
Emmanuel Dreyfus d78a624756 Windows native OpenSSH fix
Windows native OpenSSH has alternative behavior for standard I/O
descriptors, which can be selected through the OPENSSH_STDIO_MODE
environement variable. Setting it to "nonsock" is required for
sshfs compatibility.

See https://github.com/PowerShell/openssh-portable/pull/759
for details.
2024-11-20 16:00:40 +01:00
Haoxi Tan ddf1e42ce7
Merge pull request #306 from jpalus/fill-stat-info-from-cache
Fill stat info when returning cached data for readdir
2024-11-05 08:07:34 +10:00
Haoxi Tan 1a52814a4e
Merge branch 'master' into fill-stat-info-from-cache 2024-11-05 08:05:23 +10:00
Haoxi Tan c9bf8ad451
Merge pull request #305 from jpalus/fix-link-leak
Fix memleak in cache after readlink
2024-11-05 08:01:26 +10:00
Jan Palus 5f767dec5b
Fill stat info when returning cached data for readdir
Uncached and cached results for readdir were inconsistent -- the former
returned correct stat info for directory entries while the latter
didn't. That's because only names of entries were saved in cache without
stat info. In turn this leads to issues like
https://github.com/junegunn/fzf/issues/3832 since directory traversal
library (https://github.com/charlievieth/fastwalk in this case) relies
on proper stat info returned by readdir. Hence when unchached result was
returned it gave proper outcome, while with cached result it was wrong.

Cache stat info next to entry name to fix the issue. While file
attributes are saved in cache already, they use full path as key. To
avoid potentially plenty of allocations, string copying and cache
lookups to get each attr, let's keep a copy of stat struct independently
to be on the fast path.
2024-06-17 11:48:44 +02:00
Jan Palus 8bb9d33d16
Fix memleak in cache after readlink 2024-06-17 00:10:02 +02:00
Haoxi Tan eadf7f104a
Merge pull request #295 from libfuse/rm-rst
remove README.rst file since README.md file exists
2024-02-27 14:09:05 +10:00
h4sh5 1af815b7dc remove README.rst file since README.md file exists 2024-02-27 14:04:42 +10:00
Thomas Merz 683b8c2454
👷 use latest major version for actions/checkout (#289) 2023-12-22 18:05:32 +00:00
Haoxi Tan 70c8fd9031
Merge pull request #277 from g-easy/master
Implement connect to vsock.
2023-11-06 19:55:14 +10:00
h4sh 47a580dd77 test improvements 2023-09-23 23:05:21 +10:00
h4sh e5f4fcaad7 github action build+test 2023-09-23 23:00:12 +10:00
Haoxi Tan 8c97da5b16
Update README.md 2023-09-23 22:52:14 +10:00
Haoxi Tan 551752c3a5
No longer orphaned 2023-09-23 22:51:16 +10:00
Nikolaus Rath c91eb9a9a9 Released 3.7.3 2022-05-26 14:23:35 +01:00
Peter Wienemann 103c6ba68b
Fix typo: occured -> occurred (#280) 2022-03-07 19:41:43 +00:00
easy 3aa3efcb52 Implement connect to vsock.
"sshfs -o vsock=CID:PORT" will cause sshfs to connect directly to the
given vsock, bypassing ssh, and allowing high performance sshfs mounts
of a VM guest.
2022-02-15 14:45:26 +11:00
Matthew Berginski a2054a2b73
Typo Fix (#274) 2021-12-27 11:27:40 +00:00
Kim Brose fd02499b4c
add missing backtick (#270) 2021-10-30 13:04:15 +01:00
Antonio Rojas c2715f7453
Fix typo in ssh_opts (#269)
Add a missing comma that prevents using the PubkeyAcceptedKeyTypes option
2021-10-06 08:19:22 +01:00
Nikolaus Rath 1abde6e779 Clarify the need for libfuse3. 2021-09-24 13:36:56 +01:00
Cam Cope a181b9b60b
add .git-blame-ignore-revs (#261) 2021-08-30 18:08:07 +01:00
Cam Cope d54c7ecbd6
Fixup whitespace and configure CI to keep it that way 2021-08-30 15:35:33 +01:00
a1346054 803e0e65cf
Fix script issues identified through shellcheck (#258)
* Fix spelling

* Fix shellcheck-identified warnings in shell scripts
2021-08-25 14:45:42 +02:00
Nikolaus Rath 9700b35370 Released 3.7.2 2021-06-08 09:52:08 +01:00
Andrew Stone 6c1b92df81
Fix deadlock in conn cleanup (#244)
Calling through to request_free() from clean_req() causes deadlock since
sshfs.lock is already held by the caller of clean_req().
2021-02-25 12:13:30 +00:00
Nikolaus Rath d18869a307 Update to newer CI environment.
The current one causes build failures since recent pytest versions are incompatble with
Python 3.5.
2021-01-19 10:17:10 +00:00
Peter Belm dfd4cba385
Workaround for mkdir on existing directory (#242)
Added a secondary check so if a mkdir request fails with EPERM an access request will be tried - returning EEXIST if the access was successful. This matches the correct behaviour expected by applications such as git.

Co-authored-by: Peter Belm <peter.belm@dataalchemist.co.uk>
2021-01-19 10:13:09 +00:00
Nikolaus Rath 8059e2ce63 Released 3.7.1 2020-11-09 09:52:00 +00:00
Junichi Uekawa 9e01ffd161
Rename option to 'passive' and add some example in manual. (#232) 2020-11-02 10:51:48 +00:00
Fabrice Fontaine de0504e45b
sshfs.c: fix build with gcc 4.8 (#233)
Fix the following build failure with gcc 4.8:

../sshfs.c:1092:2: error: 'for' loop initial declarations are only allowed in C99 mode
  for (int i = 0; i < sshfs.max_conns; i++) {
  ^

This build failure has been added with
8822b60d9d

Fixes:
 - http://autobuild.buildroot.org/results/2dbdc579c55543175716d5f739cabe2ad0864ed6

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2020-11-02 09:31:23 +00:00
Junichi Uekawa 6625146af9
Update sshfs.rst (#220)
This / is probably meant to be a .
2020-09-04 12:06:30 +01:00
Simon Arlott 76ffb37444
Unset OLDPWD environment variable (#227)
If ssh is configured to use "Match exec" and the previous working
directory is the mount point, then the shell (bash) hangs calling
stat() on OLDPWD.

Unset OLDPWD so that this doesn't happen.

Fixes #206.
2020-09-03 08:13:24 +01:00
Nikolaus Rath a96e521474 Remove pointer to professional consulting offers
I do not want to offer this actively anymore.
2020-08-10 19:57:05 +01:00
bjoe2k4 11df8874dc
Fix typo in docs (#213) 2020-05-17 10:30:59 +01:00
Nikolaus Rath a7e1038203 Released 3.7.0 2020-01-03 11:04:02 +00:00
Dominique Martinet 8340a67b31 sftp_init_reply_ok: fix small memory leak (#198)
The leak was identified with ASAN: configure the project with
meson -Db_sanitize=address to reproduce.
2019-11-30 11:42:40 +00:00
Nikolaus Rath ab0e339e80 Protect changes to conn->req_count with mutex. 2019-11-27 20:35:38 +00:00
Nikolaus Rath b19e3b8001 Fix memory leak in conntab
References need to be counted per-path, rather than per connection.
2019-11-27 20:35:38 +00:00
Nikolaus Rath e910453156 Disable buflimit workaround by default.
The corresponding bug in OpenSSH has been fixed in
2007 (cf. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=365541#37), so this shouldn't
be needed anymore.
2019-11-27 10:30:35 +00:00
Nikolaus Rath 28c22270f8 Add missing mutex lock/unlocks when accessing conntab
(problem introduced in parent commit).
2019-11-27 09:42:30 +00:00
Timo Savola 8822b60d9d Add support for using multiple connections
The -o max_conns=N option causes multiple SSH processes and response processing threads to
be created. This means that e.g. reading a large file no longer blocks all access to the
filesystem.

The connection is chosen by checking the per-connection statistics:

  1. Choose connection with least outstanding requests; if it's a tie,
  2. choose connection with least directory handles; if it's a tie,
  3. choose connection with least file handles; if it's a tie,
  4. choose connection which has already been established.

The implementation assumes that the max_conns values will be small; it
uses linear search.

Example benchmark:

With single connection:

$ sshfs -o max_conns=1,workaround=nobuflimit ebox: mnt
$ cat mnt/tmp/bigfile > /dev/null &
$ time find mnt > /dev/null

real	1m50.432s
user	0m0.133s
sys	0m0.467s

With multiple connections:

$ ~/in-progress/sshfs/build/sshfs -o max_conns=5,workaround=nobuflimit ebox: mnt
$ cat mnt/tmp/bigfile > /dev/null &
$ time find mnt > /dev/null

real	1m15.338s
user	0m0.142s
sys	0m0.491s

This feature was implemented to large extend by Timo Savola <timo.savola@iki.fi>. Thanks
to CEA.fr for sponsoring the remaining work to complete this feature and integrate it into
SSHFS!
2019-11-24 12:01:01 +00:00
Nikolaus Rath 0f3ab4fd4f Drop reference counter for struct sshfs_file
Variables of this kind are created in sshfs_open_common() and freed
in sshfs_release(). Since sshfs_release() calls sshfs_flush(), there
can be no pending write requests before at the time of freeing, so
there is no need for reference counting.
2019-11-24 10:23:42 +00:00
Nikolaus Rath ddd968b025 Do not fail tests if connecting to localhost for first time. 2019-11-24 10:19:13 +00:00