mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-04 12:20:42 +09:00
auth.c: Add termination when server disconnects during authentication
When the server is reaches MaxAuthTries it sends disconnect immediately which was not correctly handled in the libssh client and hanged. Solves #11 Signed-off-by: Norbert Pocs <npocs@redhat.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
@@ -78,6 +78,8 @@ SSH_PACKET_CALLBACK(ssh_packet_disconnect_callback){
|
||||
ssh_socket_close(session->socket);
|
||||
session->alive = 0;
|
||||
session->session_state = SSH_SESSION_STATE_ERROR;
|
||||
/* correctly handle disconnect during authorization */
|
||||
session->auth.state = SSH_AUTH_STATE_FAILED;
|
||||
/* TODO: handle a graceful disconnect */
|
||||
return SSH_PACKET_USED;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user