After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 711287 - sftp backend should limit size of packets
sftp backend should limit size of packets
Status: RESOLVED NOTABUG
Product: gvfs
Classification: Core
Component: sftp backend
git master
Other Linux
: Normal normal
: ---
Assigned To: gvfs-maint
gvfs-maint
Depends on:
Blocks:
 
 
Reported: 2013-11-02 14:01 UTC by Ross Lagerwall
Modified: 2013-11-07 13:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
sftp: Limit requests to no more than 32768 bytes (2.23 KB, patch)
2013-11-02 15:01 UTC, Ross Lagerwall
reviewed Details | Review

Description Ross Lagerwall 2013-11-02 14:01:12 UTC
The sftp spec says read and write requests shouldn't be larger than 32768 but the sftp backend doesn't respect this.
Comment 1 Ross Lagerwall 2013-11-02 15:01:41 UTC
Created attachment 258804 [details] [review]
sftp: Limit requests to no more than 32768 bytes

Reference:
Chapter 3 of http://www.openssh.org/txt/draft-ietf-secsh-filexfer-02.txt
http://daniel.haxx.se/blog/2010/12/08/making-sftp-transfers-fast/
Comment 2 Ondrej Holy 2013-11-07 12:51:50 UTC
Review of attachment 258804 [details] [review]:

Patch looks good, however there is written:

All servers SHOULD support packets of at least 34000 bytes (where the packet size refers to the full length, including the header above). This should allow for reads and writes of at most 32768 bytes.

So I think 32768 bytes isn't allowed maximum, but supported minimum. Don't know how to limit our sshd server packet size or increase gvfs buffer_size to test it, but the backend should work also when we requested more and it should simply read less then we requested, however may not work for writing and returns error... Do you prove it somehow?
Comment 3 Ross Lagerwall 2013-11-07 13:12:02 UTC
After reading it again, it says:
"The maximum size of a packet is in practice determined by the client"

so let's leave it at 64kb until someone finds a server which doesn't like packets of that size.