mirror of
https://github.com/curl/curl.git
synced 2024-11-27 05:50:21 +08:00
verify ssh daemon version
This commit is contained in:
parent
0839621f47
commit
bdbaedc452
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user