File write fails (0 byte file), unless --VolumePrefix is removed

Open
#286 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
c

Research direction

Reproduce the Windows 7 case with the documented winfsp-1.9.21096 and sshfs-win-3.7.21011 installers, using net use and echo 1 > x:\testfile. Inspect the HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\WinFsp\Services\sshfs.r\CommandLine value and the --VolumePrefix handling; done means the first file write succeeds without the workaround and the share unmounts normally.

Written by the indexing model from the issue text.

Description

I use:
Windows 7
winfsp-1.9.21096.msi
sshfs-win-3.7.21011-x86.msi

I connect to an ubuntu 20 system from windows 7 command line. x:\testfile does not exist.

> net use x: \\sshfs.r\user@ubuntu.lan\home\user userpassword
> echo 1 > x:\testfile
Access is denied.   (but a 0 byte testfile was created, try again:)
> echo 1 > x:\testfile
(Works.)

I delete the testfile, and edit the registry to append a blank --VolumePrefix= to overwrite the default one :
(which was --VolumePrefix=\sshfs.r\user@ubuntu.lan\home\user )

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\WinFsp\Services\sshfs.r\CommandLine 
svc %1 %2 %U --VolumePrefix=

I remount the X: share, and I can now "echo 1 > x:\testfile" and it works on the first try (file is created).
But I can't unmount the volume with "net use x: /delete", I must kill the sshfs processes.

Why is the default "--VolumePrefix" causing 0 byte files when creating a file? Is there any other workaround?

Dominant language
C
Stars
6.4k
Forks
315
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from winfsp/sshfs-win

All issues in winfsp/sshfs-win

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.