sshfs-win icon indicating copy to clipboard operation
sshfs-win copied to clipboard

Access denied on overwrite

Open laurensbl opened this issue 5 years ago • 2 comments

I stumbled upon a rather weird bug:

  • Copying an already existing file with Total Commander (TC) to an SSHFS-drive gives "Access denied on file ". No overwrite dialog, can only abort the action, no overwrite takes place.
  • Copying with Windows Explorer (drag&drop, copy-paste) the overwrite-dialog is displayed as expected and choosing "Copy and Replace" does actually replace the file on the SSHFS-drive. Copy-paste also works fine from TC.
  • Editing the file on the SSHFS-drive also works fine (changes are saved correctly), tested with Notepad and Notepad++.

It seems to have to do something with the method used for copying: The manual of TC states that it uses the Windows function CopyFileEx. When changing the copy method via TCs options I get the following results:

  • using CopyFileEx: Error "Access denied on file ".
  • using the default built in copy method (via ReadFile/WriteFile): file is overwritten without any confirmation dialog showing first, I do get the confirmation dialog when copying to a local drive using this method.
  • using the "copy+paste via Explorer" method I get the confirmation and the file is overwritten correctly (same as manual copy-paste as mentioned above).

This problem doesn't occur when connecting to the remote filesystem with TCs Secure FTP plugin and SFTP Drive V2 from /n software (https://www.nsoftware.com/). It doesn't seem to be caused by a permissions issue on the remote filesystem as I can copy, overwrite (using copy-paste), edit and delete it without any problems. Even chmodded the file to 777 and it made no difference. Connecting to remote filesystem as root user.

Running TC as Administrator (elevated) doesn't make a difference either.

This issue could belong to WinFsp, I don't know so I file it here.

Windows 7 SP1 fully updated Total Commander v9.51 sshfs-win-3.5.20024-x64 winfsp-1.7.20038

laurensbl avatar Apr 22 '20 08:04 laurensbl

I have a very similar issue.

When I try to copy a file over, first message is an Access Denied and Total Commander does ask me what to do (Skip, Retry, etc...). At this moment, the file is already created on the server but with size 0 and 700 permissions (to the correct user). If I hit "Retry" in TC, then it is copied fine.

If I try from Explorer, I get a message that the file already exists (again, at this moment, it is created with size 0 on the server). If I select Copy/Replace, then it proceeds to copy.

Windows 7 SP1 Total Commander v8.52a sshfs-win-3.5.20024-x64.msi winfsp-1.6.20027.msi

I started it with:

set CYGFUSE=WinFsp
set PATH=C:\Program Files\SSHFS-Win\bin
sshfs -f -o idmap=user viulian@server: Z:

viulian avatar May 12 '20 06:05 viulian

same problem here, any fixes anyone?

retro81 avatar Jul 13 '21 14:07 retro81