Skip Menu |

This queue is for tickets about the Net-SSH2 CPAN distribution.

Report information
The Basics
Id: 80065
Status: resolved
Priority: 0/
Queue: Net-SSH2

People
Owner: Nobody in particular
Requestors: cmadams [...] hiwaay.net
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



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.
Hey, in the development version that ugly code was rewritten and the issue just went away. Anyway, thank you for reporting it and for the patch!