aboutsummaryrefslogtreecommitdiff
path: root/libs/libssh
diff options
context:
space:
mode:
authorJakov Smolic <jakov.smolic@sartura.hr>2020-08-24 13:06:35 +0200
committerJakov Smolic <jakov.smolic@sartura.hr>2020-08-24 20:05:40 +0200
commitd726b13aff114826e1b65eba38b2b2718508de1b (patch)
tree9dbe65b513477da67720c2ff241a145d069d18ff /libs/libssh
parentf8ffabaf08784229016b46108d86d038333b45c8 (diff)
libssh: patch ssh_channel_poll_timeout for compatibility with libnetconf2
Signed-off-by: Jakov Smolic <jakov.smolic@sartura.hr>
Diffstat (limited to 'libs/libssh')
-rw-r--r--libs/libssh/Makefile2
-rw-r--r--libs/libssh/patches/0004-channels-Avoid-returning-SSH_AGAIN-from-ssh_channel_.patch41
2 files changed, 42 insertions, 1 deletions
diff --git a/libs/libssh/Makefile b/libs/libssh/Makefile
index 89890e4a0..ae2099430 100644
--- a/libs/libssh/Makefile
+++ b/libs/libssh/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=libssh
PKG_VERSION:=0.9.4
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://www.libssh.org/files/0.9/
diff --git a/libs/libssh/patches/0004-channels-Avoid-returning-SSH_AGAIN-from-ssh_channel_.patch b/libs/libssh/patches/0004-channels-Avoid-returning-SSH_AGAIN-from-ssh_channel_.patch
new file mode 100644
index 000000000..8dd50bae0
--- /dev/null
+++ b/libs/libssh/patches/0004-channels-Avoid-returning-SSH_AGAIN-from-ssh_channel_.patch
@@ -0,0 +1,41 @@
+From 6417f5a3cac8537ac6f6ff7fc1642dfaa0917fb4 Mon Sep 17 00:00:00 2001
+From: Jakub Jelen <jjelen@redhat.com>
+Date: Thu, 16 Apr 2020 11:13:34 +0200
+Subject: [PATCH] channels: Avoid returning SSH_AGAIN from
+ ssh_channel_poll_timeout()
+
+This addresses a regression introduced in 3bad0607, partially fixed in 022409e9,
+but the function was still able to return SSH_AGAIN, which was not expected by
+callers.
+
+Based on discussion in [1] and [2]
+
+[1] https://gitlab.com/libssh/libssh-mirror/-/merge_requests/101
+[2] https://www.libssh.org/archive/libssh/2020-03/0000029.html
+
+Signed-off-by: Jakub Jelen <jjelen@redhat.com>
+Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
+---
+ src/channels.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/src/channels.c b/src/channels.c
+index bcc1c207..9fe309d0 100644
+--- a/src/channels.c
++++ b/src/channels.c
+@@ -3116,6 +3116,12 @@ int ssh_channel_poll_timeout(ssh_channel channel, int timeout, int is_stderr)
+ session->session_state == SSH_SESSION_STATE_ERROR) {
+ rc = SSH_ERROR;
+ goto out;
++ } else if (rc == SSH_AGAIN) {
++ /* If the above timeout expired, it is ok and we do not need to
++ * attempt to check the read buffer. The calling functions do not
++ * expect us to return SSH_AGAIN either here. */
++ rc = SSH_OK;
++ goto out;
+ }
+ len = ssh_buffer_get_len(stdbuf);
+ if (len > 0) {
+--
+2.26.2
+