Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#11105 closed Bug report (fixed)

FileZilla Client ignoring failed SSH_FXP_CLOSE

Reported by: Deathkid535 Owned by:
Priority: normal Component: FileZilla Client
Keywords: SSH_FXP_CLOSE Cc:
Component version: 3.23.0.2 Operating system type: Linux
Operating system version: Fedora 25 on Intel i5

Description

Dear developers,

I am currently working on an SFTP-Proxy project and I noticed a bug in your software. When closing a file handle, according to the SFTP specification version 12, page 35 it states the following:

The response to this request will be a SSH_FXP_STATUS message. Note
that on some server platforms even a close can fail. For example, if
the server operating system caches writes, and an error occurs while
flushing cached writes, the close operation may fail.

In my case this is exactly what happens. When a file is not permitted through the proxy, the CLOSE will fail. The SFTP_Client from the command line in Fedora 25 respects that and will display an error if the upload is not permitted.

Screenshot from SFTP from command line:

http://deathkid.trojaner-board.de/img/Bugreport/SFTP.png

However, FileZilla will mark the upload as a success, even though it may have failed. The only way to verify this is to look into the directory, where the failed file will not appear. However, this could be very confusing for our users and can lead to data loss.

Screenshot from FileZilla:

http://deathkid.trojaner-board.de/img/Bugreport/FileZilla.png

FileZilla Logfile:

2016-12-12 14:24:59 6847 1 Status: Connecting to 172.18.0.4:2200...
2016-12-12 14:24:59 6847 1 Status: Connection established, waiting for welcome message...
2016-12-12 14:24:59 6847 1 Response: SSH-2.0-paramiko_2.0.2
2016-12-12 14:24:59 6847 1 Error: Cannot establish FTP connection to an SFTP server. Please select proper protocol.
2016-12-12 14:24:59 6847 1 Error: Critical error: Could not connect to server
2016-12-12 14:25:07 6847 1 Status: Disconnected from server
2016-12-12 14:25:07 6847 1 Status: Connecting to 172.18.0.4:2200...
2016-12-12 14:25:07 6847 1 Response: fzSftp started, protocol_version=7
2016-12-12 14:25:07 6847 1 Command: open "root@192.168.122.97:22@172.18.0.4" 2200
2016-12-12 14:25:08 6847 1 Command: Trust new Hostkey: Once
2016-12-12 14:25:08 6847 1 Command: Pass: ***
2016-12-12 14:25:08 6847 1 Status: Connected to 172.18.0.4
2016-12-12 14:25:08 6847 1 Status: Retrieving directory listing...
2016-12-12 14:25:08 6847 1 Command: pwd
2016-12-12 14:25:08 6847 1 Response: Current directory is: "/"
2016-12-12 14:25:08 6847 1 Command: ls
2016-12-12 14:25:08 6847 1 Status: Listing directory /
2016-12-12 14:25:08 6847 1 Status: Directory listing of "/" successful
2016-12-12 14:25:10 6847 1 Status: Retrieving directory listing of "/home"...
2016-12-12 14:25:10 6847 1 Command: cd "home"
2016-12-12 14:25:10 6847 1 Response: New directory is: "/home"
2016-12-12 14:25:10 6847 1 Command: ls
2016-12-12 14:25:10 6847 1 Status: Listing directory /home
2016-12-12 14:25:10 6847 1 Status: Directory listing of "/home" successful
2016-12-12 14:25:40 6847 1 Status: Retrieving directory listing of "/home"...
2016-12-12 14:25:40 6847 1 Command: ls
2016-12-12 14:25:40 6847 1 Status: Listing directory /home
2016-12-12 14:25:40 6847 1 Status: Directory listing of "/home" successful
2016-12-12 14:25:46 6847 2 Status: Connecting to 172.18.0.4:2200...
2016-12-12 14:25:46 6847 2 Response: fzSftp started, protocol_version=7
2016-12-12 14:25:46 6847 2 Command: open "root@192.168.122.97:22@172.18.0.4" 2200
2016-12-12 14:25:46 6847 2 Command: Trust new Hostkey: Once
2016-12-12 14:25:46 6847 2 Command: Pass: ***
2016-12-12 14:25:46 6847 2 Status: Connected to 172.18.0.4
2016-12-12 14:25:46 6847 2 Status: Starting upload of /home/deigner/Desktop/test_approve.txt
2016-12-12 14:25:46 6847 2 Command: cd "/home"
2016-12-12 14:25:46 6847 2 Response: New directory is: "/home"
2016-12-12 14:25:46 6847 2 Command: put "/home/deigner/Desktop/test_approve.txt" "test_approve.txt"
2016-12-12 14:25:46 6847 2 Command: local:/home/deigner/Desktop/test_approve.txt => remote:/home/test_approve.txt
2016-12-12 14:25:47 6847 2 Status: File transfer successful, transferred 20 bytes in 1 second
2016-12-12 14:25:48 6847 2 Status: Retrieving directory listing of "/home"...
2016-12-12 14:25:48 6847 2 Command: ls
2016-12-12 14:25:48 6847 2 Status: Listing directory /home
2016-12-12 14:25:48 6847 2 Status: Directory listing of "/home" successful
2016-12-12 14:25:50 6847 2 Status: Starting upload of /home/deigner/Desktop/test_deny
2016-12-12 14:25:50 6847 2 Command: put "/home/deigner/Desktop/test_deny" "test_deny"
2016-12-12 14:25:50 6847 2 Command: local:/home/deigner/Desktop/test_deny => remote:/home/test_deny
2016-12-12 14:25:52 6847 2 Status: File transfer successful, transferred 14 bytes in 2 seconds
2016-12-12 14:25:52 6847 2 Status: Retrieving directory listing of "/home"...
2016-12-12 14:25:52 6847 2 Command: ls
2016-12-12 14:25:52 6847 2 Status: Listing directory /home
2016-12-12 14:25:52 6847 2 Status: Directory listing of "/home" successful

Change History (2)

comment:1 by Tim Kosse, 8 years ago

Resolution: fixed
Status: newclosed

Curious, why do you accept/reject the transfer at SSH_FXP_CLOSE and not SSH_FXP_OPEN where it would make more sense?

Should be fixed in https://svn.filezilla-project.org/filezilla?revision=8070&view=revision

comment:2 by Deathkid535, 8 years ago

It works now, thanks!

The problem is, that the uploaded file gets checked by an AV at the proxy, and that can only be done when the file is fully uploaded.

Note: See TracTickets for help on using tickets.