summaryrefslogtreecommitdiff
path: root/gnu/packages
diff options
context:
space:
mode:
authorYelninei <yelninei@tutamail.com>2025-07-29 13:15:42 +0000
committerAndreas Enge <andreas@enge.fr>2025-07-30 14:18:33 +0200
commit3c42d9de374c3f433da53ca7b0e7d6a91e1ac918 (patch)
tree5df39d1c0373c5f8578802843c23481528b65f78 /gnu/packages
parent4ec561b1c20ed4c4f26094e0591cadbdd749aa6a (diff)
gnu: libssh: Update to 0.11.2.
* gnu/packages/ssh.scm (libssh): Update to 0.11.2. [origin]: Remove snippet and patch. [#:configure-flags]: Remove custom CFLAGS. [#:phases]: Remove prepare-for-tests phase. * gnu/packages/patches/libssh-openssh-banner.patch: Delete patch. * gnu/local.mk (dist_patch_DATA): Deregister patch. Fixes: guix/guix#1679 Change-Id: Iad2c57353d3a9e8c6391e206f41bfb6deb821a8a
Diffstat (limited to 'gnu/packages')
-rw-r--r--gnu/packages/patches/libssh-openssh-banner.patch61
-rw-r--r--gnu/packages/ssh.scm30
2 files changed, 4 insertions, 87 deletions
diff --git a/gnu/packages/patches/libssh-openssh-banner.patch b/gnu/packages/patches/libssh-openssh-banner.patch
deleted file mode 100644
index 2a05f6ec670..00000000000
--- a/gnu/packages/patches/libssh-openssh-banner.patch
+++ /dev/null
@@ -1,61 +0,0 @@
1From 78d536c150bd7f327e0de45a1246bb1f03cd2f48 Mon Sep 17 00:00:00 2001
2From: Lucas Mulling <lucas.mulling@suse.com>
3Date: Thu, 24 Apr 2025 15:48:32 -0300
4Subject: [PATCH] misc: Fix OpenSSH banner parsing
5
6Signed-off-by: Lucas Mulling <lucas.mulling@suse.com>
7---
8 src/misc.c | 6 ++++--
9 tests/unittests/torture_misc.c | 5 +++++
10 2 files changed, 9 insertions(+), 2 deletions(-)
11
12diff --git a/src/misc.c b/src/misc.c
13index 95512f0d3..b1ebc0c44 100644
14--- a/src/misc.c
15+++ b/src/misc.c
16@@ -1426,6 +1426,7 @@ int ssh_analyze_banner(ssh_session session, int server)
17 char *tmp = NULL;
18 unsigned long int major = 0UL;
19 unsigned long int minor = 0UL;
20+ int off = 0;
21
22 /*
23 * The banner is typical:
24@@ -1445,8 +1446,9 @@ int ssh_analyze_banner(ssh_session session, int server)
25 }
26
27 errno = 0;
28- minor = strtoul(openssh + 10, &tmp, 10);
29- if ((tmp == (openssh + 10)) ||
30+ off = major >= 10 ? 11 : 10;
31+ minor = strtoul(openssh + off, &tmp, 10);
32+ if ((tmp == (openssh + off)) ||
33 ((errno == ERANGE) && (major == ULONG_MAX)) ||
34 ((errno != 0) && (major == 0)) ||
35 (minor > 100)) {
36diff --git a/tests/unittests/torture_misc.c b/tests/unittests/torture_misc.c
37index bd6bf96e8..b2320a94e 100644
38--- a/tests/unittests/torture_misc.c
39+++ b/tests/unittests/torture_misc.c
40@@ -448,6 +448,7 @@ static void torture_ssh_analyze_banner(void **state) {
41 assert_server_banner_accepted("SSH-2.0-OpenSSH");
42 assert_int_equal(0, session->openssh);
43
44+
45 /* OpenSSH banners: big enough to extract major and minor versions */
46 assert_client_banner_accepted("SSH-2.0-OpenSSH_5.9p1");
47 assert_int_equal(SSH_VERSION_INT(5, 9, 0), session->openssh);
48@@ -487,6 +488,10 @@ static void torture_ssh_analyze_banner(void **state) {
49 assert_server_banner_accepted("SSH-2.0-OpenSSH-keyscan");
50 assert_int_equal(0, session->openssh);
51
52+ /* OpenSSH banners: Double digit in major version */
53+ assert_server_banner_accepted("SSH-2.0-OpenSSH_10.0p1");
54+ assert_int_equal(SSH_VERSION_INT(10, 0, 0), session->openssh);
55+
56 ssh_free(session);
57 }
58
59--
60GitLab
61
diff --git a/gnu/packages/ssh.scm b/gnu/packages/ssh.scm
index 1fecee078f7..c421d11b827 100644
--- a/gnu/packages/ssh.scm
+++ b/gnu/packages/ssh.scm
@@ -137,7 +137,7 @@ file names.
137(define-public libssh 137(define-public libssh
138 (package 138 (package
139 (name "libssh") 139 (name "libssh")
140 (version "0.11.1") 140 (version "0.11.2")
141 (source (origin 141 (source (origin
142 (method url-fetch) 142 (method url-fetch)
143 (uri (string-append "https://www.libssh.org/files/" 143 (uri (string-append "https://www.libssh.org/files/"
@@ -145,17 +145,7 @@ file names.
145 "/libssh-" version ".tar.xz")) 145 "/libssh-" version ".tar.xz"))
146 (sha256 146 (sha256
147 (base32 147 (base32
148 "0y8v5ihrqnjxchvjhz8fcczndchaaxxim64bqm8q3q4i5v3xrdql")) 148 "1rq4dnmaz7zi0y7myvqi5xgdy9mwl80lanhfmw5iyq2viz0rylk9"))))
149 (modules '((guix build utils)))
150 (snippet
151 ;; 'PATH_MAX' is undefined on GNU/Hurd; work around it.
152 #~(substitute* (find-files "examples" "\\.c$")
153 (("#include \"examples_common\\.h\"" all)
154 (string-append all "\n"
155 "#ifndef PATH_MAX\n"
156 "# define PATH_MAX 4096\n"
157 "#endif\n"))))
158 (patches (search-patches "libssh-openssh-banner.patch"))))
159 (build-system cmake-build-system) 149 (build-system cmake-build-system)
160 (outputs '("out" "debug")) 150 (outputs '("out" "debug"))
161 (arguments 151 (arguments
@@ -163,13 +153,7 @@ file names.
163 #:configure-flags 153 #:configure-flags
164 #~(list #$@(if (%current-target-system) 154 #~(list #$@(if (%current-target-system)
165 #~() 155 #~()
166 #~("-DUNIT_TESTING=ON")) 156 #~("-DUNIT_TESTING=ON")))
167 #$@(if (and (%current-target-system)
168 (not (target-64bit?)))
169 #~((string-append
170 "-DCMAKE_C_FLAGS=-g -O2"
171 " -Wno-error=incompatible-pointer-types"))
172 #~()))
173 #:phases 157 #:phases
174 #~(modify-phases %standard-phases 158 #~(modify-phases %standard-phases
175 (add-after 'unpack 'patch-commands 159 (add-after 'unpack 'patch-commands
@@ -182,13 +166,7 @@ file names.
182 ;; Test sources. 166 ;; Test sources.
183 (substitute* '("tests/server/test_server/default_cb.c") 167 (substitute* '("tests/server/test_server/default_cb.c")
184 (("\"/bin/sh\"") 168 (("\"/bin/sh\"")
185 (format #f "~s" (which "sh")))))) 169 (format #f "~s" (which "sh")))))))))
186 (add-before 'check 'prepare-for-tests
187 ;; A few test rely on the assumption that HOME == user's pw_dir,
188 ;; which is not satisfied in Guix, where `pw_dir' is '/' while
189 ;; HOME is '/homeless-shelter'.
190 (lambda _
191 (setenv "HOME" "/"))))))
192 (native-inputs (list cmocka)) 170 (native-inputs (list cmocka))
193 (inputs (list bash-minimal mit-krb5 openssl zlib)) 171 (inputs (list bash-minimal mit-krb5 openssl zlib))
194 (synopsis "SSH client library") 172 (synopsis "SSH client library")