Ticket #128 (closed defect: fixed)

Opened 7 years ago

Last modified 5 years ago

Error message is not updated on failure

Reported by: anonymous Owned by:
Priority: normal Milestone:
Component: API Version: 1.2.1
Keywords: Cc:
Blocked By: Blocks:

Description

Error message in LIBSSH2_SESSION is not updated on failure in some places. For example (libssh2-1.2.2): src/userauth.c line 299 and line 1355 - no calls to libssh2_error(). When using libssh2_session_last_error(), I get messages from previous failure. As a result, my own error messages look like the following (error messages from libssh2 are "quoted"):

authentication by password failed: "Would block requesting userauth list"; authentication by keyboard-interactive failed: "Would block requesting userauth list".

authentication by public key failed: "Username/PublicKey? combination invalid"; authentication by password failed: "Username/PublicKey? combination invalid".

Just adding function to clear current error message from session might be fine. Then it would be possible to save error message from one call, clear error message in session, then call another function and save its error message. Missing error messages can be treated as some generic failure.

Observed with non-blocking API on windows vista with custom build of libssh2-1.2.1 using Visual Studio 2005.

Change History

comment:1 Changed 7 years ago by anonymous

Actually, clearing current error message is not enough. It should really set some error message, otherwise it might end with "Would block ..." error message anyway.

comment:2 Changed 7 years ago by bagder

  • Component set to API
  • Milestone set to 1.2.5
  • Resolution set to fixed
  • Status changed from new to closed
  • Version set to 1.2.1

Thank you, this is now fixed in the current git repo!

comment:3 Changed 5 years ago by bagder

  • Milestone 1.2.5 deleted

Milestone 1.2.5 deleted

Note: See TracTickets for help on using tickets.