deadbeefsociety / sshfs

A network filesystem client to connect to SSH servers
GNU General Public License v2.0
592 stars 7 forks source link

Crash with -o max_write=67108864 -o max_read=67108864 #8

Open rozhuk-im opened 1 year ago

rozhuk-im commented 1 year ago

Crash with message: Read size too large. OpenSSH SFTP server message limit is 261120 Abort trap (core dumped) Write size too large. OpenSSH SFTP server message limit is 261120 Abort trap (core dumped)

ccope commented 1 year ago

I'll verify later today, but I believe the error is expected if the sftp server doesn't support read/write size negotiation.

rozhuk-im commented 1 year ago

Using abort() after some mountings already done is bad idea. Original code use it only in case if error can not be handled or ignored.

On other size is latest OpenSSH.

ccope commented 1 year ago

The challenge here is that you can't tell that the server doesn't support it until you've already started the SSH connection. Maybe that can be reordered in the code so the fuse setup happens after?

rozhuk-im commented 1 year ago

I think this is not critical error to call abort().

ccope commented 1 year ago

Silently ignoring user specified parameters is bad. There are many posts on the internet where people think you can set arbitrarily large read/write sizes for performance improvements because they don't realize the code just caps the values. If you ask for something impossible, there should be immediate feedback.

ccope commented 1 year ago

Using abort() after some mountings already done is bad idea. Original code use it only in case if error can not be handled or ignored.

On other size is latest OpenSSH.

Can you post the version string and Linux distribution?

h4sh5 commented 1 year ago

Since it isn't completely silent (it does say what the error is), I suppose we should clean up fuse properly before exiting instead of calling abort()