summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorTing-Wei Lan2019-05-17 22:38:31 +0800
committerTing-Wei Lan2019-05-17 22:38:31 +0800
commit4c92b0bc398f0dd845fab83023c8cc24b10d011f (patch)
tree7127cee06b4527cb263912285a1553ce2a372da8
parent753a0d55fb4e538cea1c0d3ce7a5d578f512d0b9 (diff)
downloadaur-4c92b0bc398f0dd845fab83023c8cc24b10d011f.tar.gz
guile-ssh: Pull more upstream patches to fix builds and tests
-rw-r--r--.SRCINFO12
-rw-r--r--PKGBUILD20
-rw-r--r--guile-ssh-0.11.3-fix-segfault.patch104
-rw-r--r--guile-ssh-0.11.3-libssh-0.8-name.patch88
-rw-r--r--guile-ssh-0.11.3-libssh-0.8-tests.patch (renamed from guile-ssh-tests-server-fix-libssh-0.8.patch)3
5 files changed, 217 insertions, 10 deletions
diff --git a/.SRCINFO b/.SRCINFO
index efc625f9d588..ea1d142a8d56 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,9 +1,7 @@
-# Generated by mksrcinfo v8
-# Sun Jan 20 15:07:59 UTC 2019
pkgbase = guile-ssh
pkgdesc = SSH module for Guile based on libssh
pkgver = 0.11.3
- pkgrel = 3
+ pkgrel = 4
url = https://github.com/artyom-poptsov/guile-ssh
arch = x86_64
arch = i686
@@ -12,9 +10,13 @@ pkgbase = guile-ssh
depends = guile>=2.0.9
depends = libssh>=0.7.3
source = https://github.com/artyom-poptsov/guile-ssh/archive/v0.11.3.tar.gz
- source = guile-ssh-tests-server-fix-libssh-0.8.patch
+ source = guile-ssh-0.11.3-fix-segfault.patch
+ source = guile-ssh-0.11.3-libssh-0.8-name.patch
+ source = guile-ssh-0.11.3-libssh-0.8-tests.patch
sha256sums = 1373bf6f30ba9b4404c044fb00c0509cbd851606264803faccbf881b1efb52bc
- sha256sums = 96c6f1a6c460fbc6f5c3b78168c9ce9cc297bd2c6f74aecdfdbc7695609e1153
+ sha256sums = f3284d61b7166be9809e37c7ced323d45255479e51f68f46f0499d9a3056b535
+ sha256sums = 4a0ab224a08afc832ce82dc055f23c36c56f7e63f4f2b1814571a3c930d9cae6
+ sha256sums = 5594153165cade97481c50284aade32153801232c65a958abd3e25a2eb237841
pkgname = guile-ssh
diff --git a/PKGBUILD b/PKGBUILD
index 36744df0be79..a2364da9e10d 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,7 +2,7 @@
pkgname=guile-ssh
pkgver=0.11.3
-pkgrel=3
+pkgrel=4
pkgdesc='SSH module for Guile based on libssh'
arch=('x86_64' 'i686' 'armv7h')
url="https://github.com/artyom-poptsov/guile-ssh"
@@ -12,19 +12,29 @@ depends=(
'libssh>=0.7.3')
source=(
"https://github.com/artyom-poptsov/guile-ssh/archive/v${pkgver}.tar.gz"
- 'guile-ssh-tests-server-fix-libssh-0.8.patch')
+ 'guile-ssh-0.11.3-fix-segfault.patch'
+ 'guile-ssh-0.11.3-libssh-0.8-name.patch'
+ 'guile-ssh-0.11.3-libssh-0.8-tests.patch')
sha256sums=(
'1373bf6f30ba9b4404c044fb00c0509cbd851606264803faccbf881b1efb52bc'
- '96c6f1a6c460fbc6f5c3b78168c9ce9cc297bd2c6f74aecdfdbc7695609e1153')
+ 'f3284d61b7166be9809e37c7ced323d45255479e51f68f46f0499d9a3056b535'
+ '4a0ab224a08afc832ce82dc055f23c36c56f7e63f4f2b1814571a3c930d9cae6'
+ '5594153165cade97481c50284aade32153801232c65a958abd3e25a2eb237841')
prepare() {
cd "${srcdir}/${pkgname}-${pkgver}"
- patch -p1 < "${srcdir}/${source[1]}"
+ local source_file
+ for source_file in "${source[@]}"; do
+ case "${source_file}" in
+ *.patch)
+ patch -p1 < "${srcdir}/${source_file}"
+ ;;
+ esac
+ done
}
build() {
cd "${srcdir}/${pkgname}-${pkgver}"
- sed -i 's|-lssh_threads||' libguile-ssh/Makefile.am
autoreconf -fi
./configure --prefix=/usr --disable-rpath
make
diff --git a/guile-ssh-0.11.3-fix-segfault.patch b/guile-ssh-0.11.3-fix-segfault.patch
new file mode 100644
index 000000000000..787dc04c9a7a
--- /dev/null
+++ b/guile-ssh-0.11.3-fix-segfault.patch
@@ -0,0 +1,104 @@
+From c468d9c2dc343446757360857a295736359b3024 Mon Sep 17 00:00:00 2001
+From: "Artyom V. Poptsov" <poptsov.artyom@gmail.com>
+Date: Tue, 7 Aug 2018 07:55:00 +0300
+Subject: [PATCH] libguile-ssh/channel-type.c (ptob_close): Bugfix: fix a
+ segfault
+
+'ptob_close' would always get a segfault when it tried to free a closed
+channel. This patch fixes that by adding a check if a channel is already
+closed.
+
+Reported by Michael Bowcutt <mbowcutt@case.edu> in
+ <https://github.com/artyom-poptsov/guile-ssh/issues/8>
+ and Njagi Mwaniki in a personal email.
+
+* libguile-ssh/channel-type.c (ptob_close): Check if a channel is already
+ closed before trying to close and free it. Improve logging.
+* libguile-ssh/log.c (_gssh_log_debug, _gssh_log_debug1): New procedures
+* libguile-ssh/log.h: Likewise.
+---
+ libguile-ssh/channel-type.c | 10 +++++++++-
+ libguile-ssh/log.c | 21 +++++++++++++++++++++
+ libguile-ssh/log.h | 3 +++
+ 3 files changed, 33 insertions(+), 1 deletion(-)
+
+diff --git a/libguile-ssh/channel-type.c b/libguile-ssh/channel-type.c
+index ffcca64..4b0b9ae 100644
+--- a/libguile-ssh/channel-type.c
++++ b/libguile-ssh/channel-type.c
+@@ -29,6 +29,7 @@
+ #include "channel-type.h"
+ #include "error.h"
+ #include "common.h"
++#include "log.h"
+
+
+ /* The channel port type. Guile 2.2 introduced a new port API, so we have a
+@@ -223,10 +224,17 @@ ptob_close (SCM channel)
+ ptob_flush (channel);
+ #endif
+
+- if (ch)
++ if (ch && ssh_channel_is_open (ch->ssh_channel))
+ {
++ _gssh_log_debug ("ptob_close", "closing and freeing the channel...",
++ channel);
+ ssh_channel_close (ch->ssh_channel);
+ ssh_channel_free (ch->ssh_channel);
++ _gssh_log_debug1 ("ptob_close", "closing and freeing the channel... done");
++ }
++ else
++ {
++ _gssh_log_debug1 ("ptob_close", "the channel is already freeed.");
+ }
+
+ SCM_SETSTREAM (channel, NULL);
+diff --git a/libguile-ssh/log.c b/libguile-ssh/log.c
+index 6588749..e0e3027 100644
+--- a/libguile-ssh/log.c
++++ b/libguile-ssh/log.c
+@@ -270,6 +270,27 @@ _gssh_log_warning (const char* function_name, const char* msg, SCM args)
+ scm_dynwind_end ();
+ }
+
++void
++_gssh_log_debug (const char* function_name, const char* msg, SCM args)
++{
++ char *c_str;
++ scm_dynwind_begin (0);
++
++ c_str = scm_to_locale_string (scm_object_to_string (args, SCM_UNDEFINED));
++ scm_dynwind_free (c_str);
++
++ _ssh_log (SSH_LOG_FUNCTIONS, function_name, "[GSSH DEBUG] %s: %s",
++ msg, c_str);
++
++ scm_dynwind_end ();
++}
++
++void
++_gssh_log_debug1 (const char* function_name, const char* msg)
++{
++ _ssh_log (SSH_LOG_FUNCTIONS, function_name, "[GSSH DEBUG] %s", msg);
++}
++
+
+ /* Initialization */
+
+diff --git a/libguile-ssh/log.h b/libguile-ssh/log.h
+index dd1424b..c3fe866 100644
+--- a/libguile-ssh/log.h
++++ b/libguile-ssh/log.h
+@@ -28,6 +28,9 @@ extern void _gssh_log_error (const char* function_name, const char* msg,
+
+ extern void _gssh_log_warning (const char* function_name, const char* msg,
+ SCM args);
++extern void _gssh_log_debug (const char* function_name, const char* msg,
++ SCM args);
++extern void _gssh_log_debug1 (const char* function_name, const char* msg);
+
+ extern void init_log_func (void);
+
+--
+2.20.1
+
diff --git a/guile-ssh-0.11.3-libssh-0.8-name.patch b/guile-ssh-0.11.3-libssh-0.8-name.patch
new file mode 100644
index 000000000000..0f3d58daa135
--- /dev/null
+++ b/guile-ssh-0.11.3-libssh-0.8-name.patch
@@ -0,0 +1,88 @@
+From 01cafef0dd87b6afda41942070e73b55b45a5ed2 Mon Sep 17 00:00:00 2001
+From: "Artyom V. Poptsov" <poptsov.artyom@gmail.com>
+Date: Mon, 1 Oct 2018 05:11:27 +0300
+Subject: [PATCH] libguile-ssh: Fix building with libssh 0.8
+
+The 'libguile-ssh' library would fail to build due to missing 'libssh_threads'
+library that was removed libssh 0.8. This patch fixes that.
+
+Reported by lantw44 in
+<https://github.com/artyom-poptsov/guile-ssh/issues/9>
+
+* configure.ac: Add check for libssh 0.8
+* libguile-ssh/Makefile.am: Don't use 'libssh_threads' library when building
+ with libssh 0.8+.
+* NEWS: Update.
+---
+ NEWS | 17 +++++++++++++++++
+ configure.ac | 7 +++++++
+ libguile-ssh/Makefile.am | 7 ++++++-
+ 3 files changed, 30 insertions(+), 1 deletion(-)
+
+diff --git a/NEWS b/NEWS
+index 84d455b..8c73d1b 100644
+--- a/NEWS
++++ b/NEWS
+@@ -7,6 +7,23 @@ Copyright (C) Artyom V. Poptsov <poptsov.artyom@gmail.com>
+ are permitted in any medium without royalty provided the copyright
+ notice and this notice are preserved.
+
++* Unreleased
++** Bugfixes
++*** Fix a segfault in 'libguile-ssh'
++ The library would always fail with segmentation fault error when an
++ application tried to free a closed channel. Now it should be fixed.
++
++ Reported by Michael Bowcutt <mbowcutt@case.edu> in
++ <https://github.com/artyom-poptsov/guile-ssh/issues/8>
++ and Njagi Mwaniki in a personal email.
++*** Fix building with libssh 0.8
++ The 'libguile-ssh' library would fail to build due to missing
++ 'libssh_threads' library that was removed libssh 0.8. Now 'libguile-ssh'
++ builds without 'libssh_threads' when using libssh 0.8+.
++
++ Reported by lantw44 in
++ <https://github.com/artyom-poptsov/guile-ssh/issues/9>
++
+ * Changes in version 0.11.3 (2018-03-27)
+ ** Bugfixes
+ *** 'node-run-server' now checks for errors
+diff --git a/configure.ac b/configure.ac
+index c818208..74271f7 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -64,6 +64,13 @@ PKG_CHECK_MODULES([LIBSSH_0_7_3], [libssh >= 0.7.3],
+ Using a potentially vulnerable version of libssh
+ <https://www.libssh.org/2016/02/23/libssh-0-7-3-security-and-bugfix-release/>])])
+
++dnl Checking for libssh 0.8.x
++PKG_CHECK_MODULES([LIBSSH_0_8], [libssh >= 0.8.0],
++ [AC_DEFINE(HAVE_LIBSSH_0_8, 1, [Use libssh 0.8])],
++ [AC_DEFINE(HAVE_LIBSSH_0_8, 0, [Use libssh < 0.8])])
++
++AM_CONDITIONAL(HAVE_LIBSSH_0_8, $HAVE_LIBSSH_0_8)
++
+ # -------------------------------------------------------------------------------
+
+ dnl These macros must be provided by guile.m4.
+diff --git a/libguile-ssh/Makefile.am b/libguile-ssh/Makefile.am
+index 1ffb6c0..523d77a 100644
+--- a/libguile-ssh/Makefile.am
++++ b/libguile-ssh/Makefile.am
+@@ -44,7 +44,12 @@ BUILT_SOURCES = auth.x channel-func.x channel-type.x error.x \
+
+ libguile_ssh_la_CPPFLAGS = $(GUILE_CFLAGS)
+
+-libguile_ssh_la_LDFLAGS = -module -no-undefined -lssh_threads -lssh \
++SSH_LD_FLAGS = -lssh
++if ! HAVE_LIBSSH_0_8
++SSH_LD_FLAGS += -lssh_threads
++endif
++
++libguile_ssh_la_LDFLAGS = -module -no-undefined $(SSH_LD_FLAGS) \
+ -version-info $(LIBGUILE_SSH_INTERFACE) $(GUILE_LDFLAGS)
+
+ AM_CFLAGS = $(WARN_CFLAGS)
+--
+2.20.1
+
diff --git a/guile-ssh-tests-server-fix-libssh-0.8.patch b/guile-ssh-0.11.3-libssh-0.8-tests.patch
index f169971481b0..8b1b65259147 100644
--- a/guile-ssh-tests-server-fix-libssh-0.8.patch
+++ b/guile-ssh-0.11.3-libssh-0.8-tests.patch
@@ -21,3 +21,6 @@ index 7a37a96..c7f8b6c 100644
(list 'hostkey %rsakey %dsakey)
'(hostkey "ssh-rsa" "ssh-dss"))
(rsakey ,%rsakey)
+--
+2.20.1
+