Subject: | Wrong precedence in version test in Net::SSH2 |
Date: | Mon, 8 Oct 2012 17:34:49 -0500 |
To: | bug-Net-SSH2 [...] rt.cpan.org |
From: | Chris Adams <cmadams [...] hiwaay.net> |
When testing the libssh2 version, the operator precedence is wrong
(because >= has higher precedence than ||), which leads to the test
always succeeding. Here's the fix:
--- Net-SSH2-0.45.dist/lib/Net/SSH2.pm 2012-05-27 04:18:25.000000000 -0500
+++ Net-SSH2-0.45.dist/lib/Net/SSH2.pm 2012-10-08 09:56:41.205788483 -0500
@@ -279,7 +279,7 @@
sub _auth_methods {
return {
- ((version())[1]||0 >= 0x010203 ? (
+ (((version())[1]||0) >= 0x010203 ? (
'agent' => {
ssh => 'agent',
method => \&auth_agent,
@@ -322,7 +322,7 @@
sub _auth_rank {
return [
- ((version())[1]||0 >= 0x010203 ? ('agent') : ()),
+ (((version())[1]||0) >= 0x010203 ? ('agent') : ()),
qw(hostbased publickey keyboard keyboard-auto password none)
];
}
--
Chris Adams <cmadams@hiwaay.net>
Systems and Network Administrator - HiWAAY Internet Services
I don't speak for anybody but myself - that's enough trouble.