CC: | "Adam Kennedy" <adamkennedybackup [...] gmail.com>, "kmx" <kmx [...] volny.cz> |
Subject: | Win32 support for Net::SSH::Perl |
Date: | Fri, 18 Sep 2009 13:45:41 -0600 |
To: | "Doug Reed" <r.douglas.reed [...] gmail.com>, bug-Net-SSH-Perl [...] rt.cpan.org |
From: | "Curtis Jewell" <perl [...] csjewell.fastmail.us> |
On Thu, 17 Sep 2009 10:27 -0400, "Doug Reed" <r.douglas.reed@gmail.com>
wrote:
Show quoted text
> Curtis,
> I see you opened a ticket on Net::SSH::Perl recently and stated that you
> intend to include this module in Strawberry in the October release.
>
> I wonder if you have had any success in getting this module to work. I
> can
> compile and install it, and with a bit of hacking got it to ALMOST work.
I've gotten it to install (I just say local $ENV{HOME} =
$ENV{USERPROFILE} during the build), but haven't actually tried it or
looked at it much, as of yet.
Show quoted text> I have a need for SSH1 and SSH2 to support Router and Switch maintenance,
> and this support needs to be cross platform.
>
> I have not opened a ticket on CPAN, because from what I can see, this
> module
> is no longer supported, which is a shame because there is nothing to
> fully
> replace it. Net::SSH2 can do SSH2 protocol, but not SSH1. Anyway, with
> this in mind, I have tried to look at it myself to see if I could get it
> to
> work in Strawberry, because it meets my needs on every other platform.
If I have to, I'll ask about taking it up - but I have to admit that I
don't think I have access to an ssh-using server to test it against at
the moment...
but maybe I do. I'll check.
Would you mind sending me a patch against the current version to start
with?
It may have to get pulled out of October if the situation is as bad as
you say it is.
Show quoted text> The module out of the box only supports Unix. i.e. It makes assumptions
> about $HOME and such. I have played with it, and fixed all of that stuff
That can be changed to File::Homedir::my_home() easily enough. The other
things may be tougher. I'm cc'ing a few other people for advice, and
also cc'ing the bug address so that this gets logged as a ticket.
Show quoted text> and have it almost working in Windows, but it seems that it gets no data
> from the socket once it gets to 'client_loop', which is odd since it does
> logon and do authentication, so data is flowing until it gets to
> 'client_loop', and then it seems to loop between 'prepare_channels' and
> 'prepare_for_select' because it seems that $rb and $wb (which are
> pointers
> to anonomous arrays) are always empty. .. Or to put it another way...
> It
> gets as far as 'close_read' (if you run it with debug on) and then loops
> presumably because it never empties the buffer. In an effort to debug
> the
> code I found that 'prepare_for_select' is entered once with ((!$rfd) &&
> CHAN_INPUT_OPEN), then on the next loop (($rfd) && CHAN_INPUT_CLOSED),
> but
> since it only calls add() when (($rfd) && CHAN_INPUT_OPEN), add() never
> gets
> called.
>
> There is also Net::SSH::Win32Perl, but that code seems to change nothing
> at
> all. I guess it gets past the blocking() problem which I solved In the
> native code by simply testing '$^O' It still loops at 'close_read'
> trying
> to read the data. Maybe this used to work with some ancient version and
> some change has broken it in the loop above so that it no longer works.
> Anyway, I decided to ignore it completely and see if I could hack the
> native module into submission, but I am not good enough at debugging PERL
> to
> get farther than I have, so I thought I would pass my findings onto you
> to
> see if my findings would help.
>
> I think it would work OK if the looping problem were fixed. (Maybe it
> should use IO::Socket::INET instead of the native socket interface to
> easily
> get past the non-blocking problem since I think IO::Socket::INET
> 'normalizes' the blocking interface. The Native interface requires
> different handling for Windows... Which is how I fixed it, but then it
> is
> harder to make it platform independent.)
>
> In the end, the simple question is has anyone ever figured out how to get
> Net::SSH::Perl to work in Windows?
I don't know.
--
Curtis Jewell
swordsman@csjewell.fastmail.us
%DCL-E-MEM-BAD, bad memory
-VMS-F-PDGERS, pudding between the ears
[I use PC-Alpine, which deliberately does not display colors and pictures in HTML mail]