From 83536ab7d1fc01c3bd1c8947261d484ffb0eec10 Mon Sep 17 00:00:00 2001 From: Aris Adamantiadis Date: Sat, 24 Apr 2010 22:47:34 +0200 Subject: Fixes \r in SSH1 banner Thanks to Xi Wang for the patch WARNING: this may cause backward compatibility issues with SSH1, revert if there are problems --- libssh/client.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libssh/client.c b/libssh/client.c index 0d34a8b..805b144 100644 --- a/libssh/client.c +++ b/libssh/client.c @@ -227,7 +227,7 @@ int ssh_send_banner(ssh_session session, int server) { } } - snprintf(buffer, 128, "%s\r\n", banner); + snprintf(buffer, 128, "%s\n", banner); if (ssh_socket_write(session->socket, buffer, strlen(buffer)) == SSH_ERROR) { leave_function(); @@ -645,7 +645,7 @@ void ssh_connection_callback(ssh_session session){ case SSH_SESSION_STATE_AUTHENTICATING: break; case SSH_SESSION_STATE_ERROR: - break; + goto error; default: ssh_set_error(session,SSH_FATAL,"Invalid state %d",session->session_state); } -- cgit