diff options
author | Remi Collet <remi@remirepo.net> | 2021-03-02 11:01:02 +0100 |
---|---|---|
committer | Remi Collet <remi@remirepo.net> | 2021-03-02 11:01:02 +0100 |
commit | 2c66aa8e4ec5b4bfc80f991bb2b3069b108b6121 (patch) | |
tree | 2cc6c3d025aeafca8a378072f4db34ee1e3d7cd8 /0015-libssh2-1.4.3-debug-msgs.patch | |
parent | ef20bb6b3d0272c8340b5e55347eeffa114c889b (diff) |
import from RHEL 7.7
Diffstat (limited to '0015-libssh2-1.4.3-debug-msgs.patch')
-rw-r--r-- | 0015-libssh2-1.4.3-debug-msgs.patch | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/0015-libssh2-1.4.3-debug-msgs.patch b/0015-libssh2-1.4.3-debug-msgs.patch new file mode 100644 index 0000000..034f337 --- /dev/null +++ b/0015-libssh2-1.4.3-debug-msgs.patch @@ -0,0 +1,70 @@ +From c1bbc2d6b0708dcb1fd014554585296b0ba25a43 Mon Sep 17 00:00:00 2001 +From: Kamil Dudka <kdudka@redhat.com> +Date: Mon, 9 Oct 2017 17:35:51 +0200 +Subject: [PATCH] session: avoid printing misleading debug messages + +... while throwing LIBSSH2_ERROR_EAGAIN out of session_startup() + +If the session runs in blocking mode, LIBSSH2_ERROR_EAGAIN never reaches +the libssh2 API boundary and, in non-blocking mode, these messages are +suppressed by the condition in _libssh2_error_flags() anyway. + +Closes #211 + +Upstream-commit: 712c6cbdd2f1b509f586aea5889a5c1deb7c9bda +Signed-off-by: Kamil Dudka <kdudka@redhat.com> +--- + src/session.c | 16 ++++++++++++---- + 1 file changed, 12 insertions(+), 4 deletions(-) + +diff --git a/src/session.c b/src/session.c +index 9838d2b..62ef70d 100644 +--- a/src/session.c ++++ b/src/session.c +@@ -703,7 +703,9 @@ session_startup(LIBSSH2_SESSION *session, libssh2_socket_t sock) + + if (session->startup_state == libssh2_NB_state_created) { + rc = banner_send(session); +- if (rc) { ++ if (rc == LIBSSH2_ERROR_EAGAIN) ++ return rc; ++ else if (rc) { + return _libssh2_error(session, rc, + "Failed sending banner"); + } +@@ -714,7 +716,9 @@ session_startup(LIBSSH2_SESSION *session, libssh2_socket_t sock) + if (session->startup_state == libssh2_NB_state_sent) { + do { + rc = banner_receive(session); +- if (rc) ++ if (rc == LIBSSH2_ERROR_EAGAIN) ++ return rc; ++ else if (rc) + return _libssh2_error(session, rc, + "Failed getting banner"); + } while(strncmp("SSH-", (char *)session->remote.banner, 4)); +@@ -724,7 +728,9 @@ session_startup(LIBSSH2_SESSION *session, libssh2_socket_t sock) + + if (session->startup_state == libssh2_NB_state_sent1) { + rc = _libssh2_kex_exchange(session, 0, &session->startup_key_state); +- if (rc) ++ if (rc == LIBSSH2_ERROR_EAGAIN) ++ return rc; ++ else if (rc) + return _libssh2_error(session, rc, + "Unable to exchange encryption keys"); + +@@ -749,7 +755,9 @@ session_startup(LIBSSH2_SESSION *session, libssh2_socket_t sock) + rc = _libssh2_transport_send(session, session->startup_service, + sizeof("ssh-userauth") + 5 - 1, + NULL, 0); +- if (rc) { ++ if (rc == LIBSSH2_ERROR_EAGAIN) ++ return rc; ++ else if (rc) { + return _libssh2_error(session, rc, + "Unable to ask for ssh-userauth service"); + } +-- +2.13.6 + |