pkg / sftp

SFTP support for the go.crypto/ssh package
BSD 2-Clause "Simplified" License
1.52k stars 380 forks source link

Couldn't rename file /C:/test/file to /C:/test/file2: Failure #491

Closed fdefilippo closed 2 years ago

fdefilippo commented 2 years ago

Hi, I'v a small custom sftp server on windows, if I try to rename using the disk name in the path the rename fails. how can i solve? thank you.

puellanivis commented 2 years ago

Could you give us some more information? Sample code and the actual error messages returned can help significantly figure out what is going on.

fdefilippo commented 2 years ago

Hi, by reference to Release 1.13.4, similar to what was found in the server.go file, at the moment we solved the issue by applying the following solution in the packet.go file:

` $ diff -urN packet.go packet.go.new --- packet.go 2022-01-30 12:53:20.571724822 +0100 +++ packet.go.new 2022-01-30 12:55:13.076428695 +0100 @@ -1242,7 +1242,7 @@ }

func (p sshFxpExtendedPacketPosixRename) respond(s Server) responsePacket {

puellanivis commented 2 years ago

Ack! This appears to be an actual bug. Looks like the same issue exists with sshFxpExtendedPacketHardlink as well!

drakkan commented 2 years ago

Fixed in #492