From patchwork Tue Apr 21 08:46:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Thiery X-Patchwork-Id: 1274088 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=qvO3tk6u; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 495xyZ6tJ3z9sPF for ; Tue, 21 Apr 2020 18:47:16 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 2025386D5A; Tue, 21 Apr 2020 08:47:14 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VUMGT9BRi1r3; Tue, 21 Apr 2020 08:47:13 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 7C33286FF9; Tue, 21 Apr 2020 08:47:13 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id E83721BF312 for ; Tue, 21 Apr 2020 08:47:11 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id E523386FF9 for ; Tue, 21 Apr 2020 08:47:11 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6xkSmnvBNI0g for ; Tue, 21 Apr 2020 08:47:10 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) by hemlock.osuosl.org (Postfix) with ESMTPS id 4D2F986D5A for ; Tue, 21 Apr 2020 08:47:10 +0000 (UTC) Received: by mail-wm1-f45.google.com with SMTP id y24so2694587wma.4 for ; Tue, 21 Apr 2020 01:47:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=7ypcw0VECB8FFItbFyBQSqmibM1toPwOi9GYDwCVeZk=; b=qvO3tk6uRgTLCee3Y3FekQfdYNJArysIFYOlPhJ48Mqf+I6mmjPAy9EJ+EvnEk1ASa zIKQvIJlWkBemfCng4MKcZSIFW0TKa4mFnHekKlQ6Zael3wrw06UQ1g0sAW7dAnoqHMD NdMvLybCVLqkYnav8GJYBJF5qM39Q9CVXwZdSOhEhIIKCubNyL5LMOLLn1U1zck35Px9 9b1ci1RzIsEgDnCqR2cGDSrRws6Bh8RgPxqzHFLmQrJgxcMM9v6mCv0Jqv2H+o7IOZUr Ej0LU4wtDnpTkeT6GuM9hUxMravvHjKdomaoc5DTGUMLNI6r6QrfWFhr+1f8ZCgdN5cY x3EA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=7ypcw0VECB8FFItbFyBQSqmibM1toPwOi9GYDwCVeZk=; b=QRdIUJ3epRrp3JABGRuKVJfOuOJca13fymQ0pCeZmcf1B1Ia+QtwjwaK1e1dSlBA3x xbNOcWcd9VH5PHk7DRAJpaRGZ05nWQCYyYJVLX8MHFq7rF3WUjP3Bjuc3YL92fuMLd5E nYK3131mPwIp0A9yY8QfF3bb5VdvccNqKmRS6ThOaFalPsI2EXtJYFh1BiGuy/e1x0IP F8dLJlYbwTuRqZeeRI0/FVWGH/ryHBtYFzSHQUhavC5avcHVSKEDIzY9GtO4UXk9ue2o pQq/tAtRNjZYp/o6JxfYm3xc3HJescYzEtXJLTGTOOG4j8gz3Wc5JMD7Znebo9CVSt8K B/8A== X-Gm-Message-State: AGi0PuYqVoL3j2jadb68WzNJ/IUqsgI9CnvnemuKLZ+bKkcOkmxpweI/ Zehb6qyd7xPzt/Y6q8W/BnkWSPsC X-Google-Smtp-Source: APiQypIbvQnT9Z24ZEPRa7Di/eF82p9sX8v8S4d28EHDktTjIIesWSJ0W3/ingqp+U6JeohSfZY7GQ== X-Received: by 2002:a05:600c:2210:: with SMTP id z16mr3873402wml.151.1587458828481; Tue, 21 Apr 2020 01:47:08 -0700 (PDT) Received: from t450s.fritz.box (ip5b426f84.dynamic.kabel-deutschland.de. [91.66.111.132]) by smtp.gmail.com with ESMTPSA id m188sm2510014wme.47.2020.04.21.01.47.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Apr 2020 01:47:07 -0700 (PDT) From: Heiko Thiery To: buildroot@buildroot.org Date: Tue, 21 Apr 2020 10:46:51 +0200 Message-Id: <20200421084650.11391-1-heiko.thiery@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH] package/libssh: add patch to fix regression X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Heiko Thiery , Scott Fan Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" The libssh server is used by libnetconf2. With libssh version 0.9.4 a regression was introduced that wrongly leads to session closed after the poll timeout. The patch comes from upstrem: https://git.libssh.org/projects/libssh.git/commit/?id=6417f5a3cac8537ac6f6ff7fc1642dfaa0917fb4 Signed-off-by: Heiko Thiery --- ...eturning-SSH_AGAIN-from-ssh_channel_.patch | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 package/libssh/0002-channels-Avoid-returning-SSH_AGAIN-from-ssh_channel_.patch diff --git a/package/libssh/0002-channels-Avoid-returning-SSH_AGAIN-from-ssh_channel_.patch b/package/libssh/0002-channels-Avoid-returning-SSH_AGAIN-from-ssh_channel_.patch new file mode 100644 index 0000000000..9cc9389479 --- /dev/null +++ b/package/libssh/0002-channels-Avoid-returning-SSH_AGAIN-from-ssh_channel_.patch @@ -0,0 +1,45 @@ +From 6417f5a3cac8537ac6f6ff7fc1642dfaa0917fb4 Mon Sep 17 00:00:00 2001 +From: Jakub Jelen +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 +Reviewed-by: Anderson Toshiyuki Sasaki + +[Backport from upstream commit: +6417f5a3cac8537ac6f6ff7fc1642dfaa0917fb4] +Signed-off-by: Heiko Thiery +--- + 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.20.1 +