[Bug 3109] New: Failure when sftp-server writes big data chunks on Windows

bugzilla-daemon at bugzilla.mindrot.org bugzilla-daemon at bugzilla.mindrot.org
Mon Jan 6 22:07:18 AEDT 2020


https://bugzilla.mindrot.org/show_bug.cgi?id=3109

            Bug ID: 3109
           Summary: Failure when sftp-server writes big data chunks on
                    Windows
           Product: Portable OpenSSH
           Version: 8.1p1
          Hardware: Other
                OS: Windows 10
            Status: NEW
          Severity: enhancement
          Priority: P5
         Component: sftp-server
          Assignee: unassigned-bugs at mindrot.org
          Reporter: adiroiban at gmail.com

Not sure if this is a defect or a request for improvements.

I am reporting this bug here in the case in which someone else has to
deal with this error.

I am implementing a custom SFTP client which interacts with OpenSSH
SFTP server.

I have observed this issue only on Windows... most probably due to
Windows `write` function implementation.

I am trying to do a SFTP write request using a big chunk: 160kB.

Other SFTP clients like Putty psftp.exe use 4kB for the SFTP write
request.

The problem is that Windows API fails to make the write call with a big
data chunk.
Using smaller chunks works.

The OpenSSH SFTP server error `debug2("nothing at all written");` is
missleading as some data is actually written... just that not the whole
data.

Not sure how to properly fix this.
The SFTP protocol RFC has no special status code for a partial write.

In an ideal case, OpenSSH SFTP would have a separate condition and send
a different debug message when partial data is write... but this will
not help the remote client.

What could help a remote SFTP client is send a human readable text
message together with the SFTP_FAILURE (code 4) status.

But I see that all the send_status call in OpenSSH are without a human
readable message.


The code is here:

https://github.com/openssh/openssh-portable/blob/master/sftp-server.c#L813


You can close this bug as I think the best thing to do is to have the
SFTP RFC updated with a dedicated error code when chunk size is too big
and the client can adjust the size.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.


More information about the openssh-bugs mailing list