]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
runtests: set 'oldlibssh' for libssh versions before 0.9.6
authorDaniel Stenberg <daniel@haxx.se>
Sun, 13 Feb 2022 10:12:56 +0000 (11:12 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 14 Feb 2022 07:26:44 +0000 (08:26 +0100)
... and make test 1459 check for the different return code then.

Closes #8444

tests/FILEFORMAT.md
tests/data/test1459
tests/runtests.pl

index c50d0fe595750cc6eef35157a0a84dad5732038f..c1fbc5705b7136cc7460e7b89de10563ba767d46 100644 (file)
@@ -395,6 +395,7 @@ Features testable here are:
 - `ld_preload`
 - `libssh2`
 - `libssh`
+- `oldlibssh` (versions before 0.9.6)
 - `libz`
 - `manual`
 - `Mime`
index fde8bf1d60ee8111c7075ce4547c5e89740ff494..08fae3378db54fb8bbc0bccd4461501c30b637a2 100644 (file)
@@ -35,8 +35,13 @@ CURL_HOME=%PWD/log/test%TESTNUMBER.dir
 
 # Verify data after the test has been "shot"
 <verify>
+# old libssh installs return the wrong thing
 <errorcode>
+%if oldlibssh
+67
+%else
 60
+%endif
 </errorcode>
 <valgrind>
 disable
index f726d223bab651c50fc985ffff299db2477120f5..8c7dbd62c9678a99553a90b293bd57e842140666 100755 (executable)
@@ -271,6 +271,7 @@ my $has_mingw;      # set if built with MinGW (as opposed to MinGW-w64)
 my $has_hyper = 0;  # set if built with Hyper
 my $has_libssh2;    # set if built with libssh2
 my $has_libssh;     # set if built with libssh
+my $has_oldlibssh;  # set if built with libssh < 0.9.6
 my $has_wolfssh;    # set if built with wolfssh
 my $has_unicode;    # set if libcurl is built with Unicode support
 
@@ -2883,6 +2884,7 @@ sub setupfeatures {
     $feature{"libz"} = $has_libz;
     $feature{"libssh2"} = $has_libssh2;
     $feature{"libssh"} = $has_libssh;
+    $feature{"oldlibssh"} = $has_oldlibssh;
     $feature{"rustls"} = $has_rustls;
     $feature{"wolfssh"} = $has_wolfssh;
     $feature{"wolfssl"} = $has_wolfssl;
@@ -3041,8 +3043,15 @@ sub checksystem {
             if ($libcurl =~ /libssh2/i) {
                 $has_libssh2=1;
             }
-            if ($libcurl =~ /libssh\//i) {
+            if ($libcurl =~ /libssh\/([0-9.]*)\//i) {
                 $has_libssh=1;
+                if($1 =~ /(\d+)\.(\d+).(\d+)/) {
+                    my $v = $1 * 100 + $2 * 10 + $3;
+                    if($v < 96) {
+                        # before 0.9.6
+                        $has_oldlibssh = 1;
+                    }
+                }
             }
             if ($libcurl =~ /wolfssh/i) {
                 $has_wolfssh=1;