cnoeliachaves / ganymed-ssh-2

Automatically exported from code.google.com/p/ganymed-ssh-2
Other
0 stars 0 forks source link

Add support for very old sftp servers #48

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Try to connect to SunOS 5.9 stock sftp server
2. Get exceptions

SSH Server version:
Ganymed release: SVN head (161)
Client platform: Centos 7 

I have attached a patch that lets Ganymed connect to said SunOS 5.9 sftp server.

There are actually two different issues here:

1. The SunOS 5.9 ssh server tries to negotiate languages during connection, but 
ganymed has an fixed internal empty list, so ssh negotiation fails. I added the 
language string "C" to the fixed settings. I hope this will not cause problems 
with other implementations. 

A better alternative may be to simply drop the meaningless language negotiation 
logic.

2. Ganymed only supports sftp protocol v3 and v6. I added the possibility to 
downgrade the v3 connection attempts to a lower version, and added code to 
disable (actually, throw an exception if called) the missing operations.

I admit that this is not a very elegant solution, but it works, does not 
pollute the API, and does not require changes in existing code.
When connecting to sftp servers supporting protocol v3 everything works as it 
did, when connecting to pre-v3 servers, some operations will not work. This can 
be handled simply by relying on the exceptions thrown, or the code can check 
for the negotiated protocol version, and avoid using the operations entirely.

Original issue reported on code.google.com by stot...@gmail.com on 13 Aug 2014 at 11:53

GoogleCodeExporter commented 9 years ago
Updated patch. The original broke connecting to current servers.

Original comment by stot...@gmail.com on 6 Nov 2014 at 2:38

Attachments: