From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 15 Mar 2012 22:30:13 +0100 (CET)
On Thu, 15 Mar 2012, Ellié Computing Open Source Program wrote:
The scenario is the following:
- the user enters valid authentication information (e.g. login/pwd)
- libcurl connects correctly
- the user finally want to use agent connection or private key (I enter "foo" for the path, "bar" for the password to verify it's really wrong), and want
to verify that the new credential are ok
- it connects as well :( reusing the previous connection, rather than
authenticating again

where should I search in the code to fix that?

lib/url.c:ConnectionExists() is the function that checks if a new request can re-use an existing connection. Different credentials like user+password should certainly not allow a SSH connection to be re-used (although a HTTP connection
can be re-used even with new credentials).

I have a problem, when I try to access check->data members it seems that I get default values, and not those provided when the original SFTP request happened. Am I right? [if yes I won't be able to check reusability at all :( until the true values are there]

should I use another SessionHandle / "data"?

Part of the authentication information is indeed provided inside "data->set" with the combination of being "statefully authenticated" on the contrary to most other protocols. I suspect there must be some recycling mechanic which is not aware of that and cleans all the members a bit too eagerly :(

is there a "trash all recycled connections to that server" call somewhere? it may be simpler to implement. Though not solving the scenario above, I admit changing slightly credential is much a matter of GUI only and in a GUI it is not too hard to issue such a 'trash them all' call.

Regards
Armel


-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Reply via email to