winfsp / sshfs-win

SSHFS For Windows
https://winfsp.dev
Other
4.93k stars 252 forks source link

Unable to disconnect #20

Open DutchKillerbee opened 6 years ago

DutchKillerbee commented 6 years ago

First of all thanks for the great peace of work! We are replacing SMB in our organisation bi SFTP/SSH for some shares since our nopetya attack last year.

One thing is not working for me: Disconnection from explorer (right click: disconnect) or with using net use Z: /d The connection stays there. I do get a message Z: removed but it is still there. I am using Windows 10-64

[EDIT] found this in FAQ: You may have Dokany installed. Dokany installs its own Network Provider DLL that unfortunately interferes with the WinFsp handling of network drives. The solution is to change your system's Network Provider order and ensure that the WinFsp Network Provider runs before the Dokany one. Instructions on how to change the Network Provider order can be found in this http://blogs.interfacett.com/changing-the-network-provider-order-in-windows-10

Some minor second issue: When I rename the connection in explorer I am able to do this but only once. As soon as I try to rename it again I cannot rename it using more than 11 characters.

Am I the only one or more people are facing this issue. Thank KB

billziss-gh commented 6 years ago

@DutchKillerbee are you saying that disconnect does not work even though you do not have Dokany installed? I have never seen this but there maybe another "network provider" other than Dokany that interferes with WinFsp. The advice of putting WinFsp first in the provider order is still valid. Try it and see if it works.

Can you elaborate what you mean by "rename the connection" in Explorer? Please post steps to reproduce.

DutchKillerbee commented 6 years ago

@billziss-gh Sorry I was not clear but my disconnect problem is solved. I was using dokany. I simply changed the Network provider "priority"

Regarding the rename issue: When you right click in explore on your just created network connection there is an menu option to rename it. For example in you example drive Y : "billz@macbook-pro (\sshfs) (Y:)" When I rename it only 11 characteristics are allowed. This is strange since the original name is longer than 11.

billziss-gh commented 6 years ago

For example in you example drive Y : "billz@macbook-pro (\sshfs) (Y:)" When I rename it only 11 characteristics are allowed. This is strange since the original name is longer than 11.

Interesting indeed, especially because SSHFS and WinFsp are not really involved in this process (when SSHFS is mounted as a network drive); it happens all in the Windows shell.

I think the reason may be because the Windows shell is confused about what kind of file system is mounted: SSHFS reports that the file system name is FUSE-SSHFS. Explorer knows about NTFS, FAT and a few other file systems. When it sees a file system it does not know, it assumes that it has the same limits as FAT. FAT has a limit of 11 characters per volume label, which probably confuses Explorer.

These names are kept in the Windows registry. I was able to create a longer than 11 characters name by editing the registry:

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\##sshfs#billziss@macbook-pro]
"_LabelFromDesktopINI"=""
"_LabelFromReg"="1234567890123456"

This is not ideal, but it appears to overcome Explorer's confusion about the file system's identity.

DutchKillerbee commented 6 years ago

@billziss-gh Thanks for your feedback.