aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/sshserver.pl24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/sshserver.pl b/tests/sshserver.pl
index a00dbbcd8..fefe1b557 100644
--- a/tests/sshserver.pl
+++ b/tests/sshserver.pl
@@ -86,6 +86,30 @@ if ($username eq "root") {
exit 1;
}
+# Find out sshd version.
+my $tmpstr;
+my $ssh_daemon;
+my $ssh_ver_major;
+my $ssh_ver_minor;
+my $ssh_ver_patch;
+chomp($tmpstr = qx($sshd -V 2>&1 | grep OpenSSH));
+if ($tmpstr =~ /OpenSSH[_-](\d+)\.(\d+)(\.(\d+))*/) {
+ ($ssh_ver_major, $ssh_ver_minor, $ssh_ver_patch) = ($1, $2, $4);
+ $ssh_daemon = 'OpenSSH';
+}
+if ($verbose) {
+ print STDERR "ssh_daemon: $ssh_daemon\n";
+ print STDERR "ssh_ver_major: $ssh_ver_major\n";
+ print STDERR "ssh_ver_minor: $ssh_ver_minor\n";
+ print STDERR "ssh_ver_patch: $ssh_ver_patch\n";
+}
+
+# Verify minimum OpenSSH version.
+if ($ssh_daemon !~ /OpenSSH/) || (10 * $ssh_ver_major + $ssh_ver_minor < 37)
+ print "SCP and SFTP tests require OpenSSH 3.7 or later\n";
+ exit 1;
+}
+
# Support for some options might have not been built into sshd. On some
# platforms specifying an unsupported option prevents sshd from starting.
# Check here for possible unsupported options, avoiding its use in sshd.