| Summary: | Failure when sftp-server writes big data chunks on Windows | ||
|---|---|---|---|
| Product: | Portable OpenSSH | Reporter: | Adi Roiban <adiroiban> |
| Component: | sftp-server | Assignee: | Assigned to nobody <unassigned-bugs> |
| Status: | CLOSED FIXED | ||
| Severity: | enhancement | CC: | djm |
| Priority: | P5 | ||
| Version: | 8.1p1 | ||
| Hardware: | Other | ||
| OS: | Windows 10 | ||
| Bug Depends on: | |||
| Bug Blocks: | 3162 | ||
I have made sftp-server log the reason for the failed write in the local log. At least that way the errors can be identified. Mass close of all bugs fixed in 8.4 release. |
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.