aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2010-04-24 22:47:34 +0200
committerAris Adamantiadis <aris@0xbadc0de.be>2010-04-24 22:47:34 +0200
commit83536ab7d1fc01c3bd1c8947261d484ffb0eec10 (patch)
treeb782256906c3a57811420e8748393ae6430ae022
parent6cdbc01208dad2113effda008be4f529b424a6d7 (diff)
downloadlibssh-83536ab7d1fc01c3bd1c8947261d484ffb0eec10.tar.gz
libssh-83536ab7d1fc01c3bd1c8947261d484ffb0eec10.tar.xz
libssh-83536ab7d1fc01c3bd1c8947261d484ffb0eec10.zip
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
-rw-r--r--libssh/client.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libssh/client.c b/libssh/client.c
index 0d34a8b3..805b1442 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);
}