Package: guile-ssh / 0.11.3-2

0004-libguile-ssh-Fix-building-with-libssh-0.8.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
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 04/14] 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