Skip Menu |

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

Report information
The Basics
Id: 49820
Status: open
Priority: 0/
Queue: Net-SSH-Perl

People
Owner: greg [...] turnstep.com
Requestors: perl [...] csjewell.fastmail.us
Cc: CHORNY [...] cpan.org
AdminCc:

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



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]
CC: "Doug Reed" <r.douglas.reed [...] gmail.com>, "Adam Kennedy" <adamkennedybackup [...] gmail.com>, "kmx" <kmx [...] volny.cz>
Subject: Re: [rt.cpan.org #49820] AutoReply: Win32 support for Net::SSH::Perl
Date: Fri, 18 Sep 2009 15:32:52 -0600
To: "Bugs in Net-SSH-Perl via RT" <bug-Net-SSH-Perl [...] rt.cpan.org>
From: "Curtis Jewell" <perl [...] csjewell.fastmail.us>
Show quoted text
> > 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.
"not actively supported" may be too strong - the maintainer just released a new version of another module that Strawberry uses yesterday (should have checked who the maintainer was first.) Greg? Any help here? Any help I or Doug can offer? Would you need a "pre-beta" build of Strawberry to test that includes all the prerequisites? Show quoted text
> Would you mind sending me a patch against the current version to start > with?
Attach it to the bug, too. Show quoted text
> It may have to get pulled out of October if the situation is as bad as > you say it is.
And right now Convert::PEM has suddenly (as in since 30 hours ago) started failing tests - I'm going to have to find whatever other module is breaking it and get it to build again before I attack this bug - but that won't be long! --Curtis -- 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]
CC: Bugs in Net-SSH-Perl via RT <bug-Net-SSH-Perl [...] rt.cpan.org>, Adam Kennedy <adamkennedybackup [...] gmail.com>, kmx <kmx [...] volny.cz>
Subject: Re: [rt.cpan.org #49820] AutoReply: Win32 support for Net::SSH::Perl
Date: Sat, 19 Sep 2009 12:35:54 -0400
To: Curtis Jewell <perl [...] csjewell.fastmail.us>
From: Doug Reed <r.douglas.reed [...] gmail.com>

Message body is not shown because sender requested not to inline it.

Download PerlSSHHack.tar.gz
application/x-gzip 16.3k

Message body not shown because it is not plain text.

Message body is not shown because sender requested not to inline it.

Curtis, (and listeners), Attached, please find the 'patches' I made to handle Windows. I don't have an account on CPAN, so I don't really know how to attach them to the problem you opened. I am sure I could figure it out, but, my wife has something she needs me to do. :-) I cannot really call them patches because they cannot be deployed as is. I need to be able to do: if ($^O =~ /MSWin32/) { use Win32; } But that will not work because 'use' is done at script load and not at execute. There MUST be some way do do this, but I don't know it. I changed it to 'require', but then the load failed with unresolved symbols down in the code, so this is something PERLish I don't know how to do. In the end, there is nothing wrong with the code except that we don't want to 'use Win32;' on Unix systems. Thanque for looking into this. I will help if I can as I need this to work, and we are REALLY close! On Fri, Sep 18, 2009 at 5:32 PM, Curtis Jewell <perl@csjewell.fastmail.us>wrote: Show quoted text
> > > 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.
> > "not actively supported" may be too strong - the maintainer just > released a new version of another module that Strawberry uses yesterday > (should have checked who the maintainer was first.) > > Greg? Any help here? Any help I or Doug can offer? Would you need a > "pre-beta" build of Strawberry to test that includes all the > prerequisites? >
> > Would you mind sending me a patch against the current version to start > > with?
> > Attach it to the bug, too. >
> > It may have to get pulled out of October if the situation is as bad as > > you say it is.
> > And right now Convert::PEM has suddenly (as in since 30 hours ago) > started failing tests - I'm going to have to find whatever other module > is breaking it and get it to build again before I attack this bug - but > that won't be long! > > --Curtis > -- > 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] > >
-- Regards, Doug
CC: Curtis Jewell <perl [...] csjewell.fastmail.us>, Bugs in Net-SSH-Perl via RT <bug-Net-SSH-Perl [...] rt.cpan.org>, kmx <kmx [...] volny.cz>
Subject: Re: [rt.cpan.org #49820] AutoReply: Win32 support for Net::SSH::Perl
Date: Sun, 20 Sep 2009 15:46:54 +1000
To: Doug Reed <r.douglas.reed [...] gmail.com>
From: Adam Kennedy <adamkennedybackup [...] gmail.com>
One option is to have the functions called directly in Win32::whatever() and to NOT export them. The other is to make the whole thing happen at compile time with... BEGIN { if ( $^O eq 'MSWin32' ) { require Win32; Win32->import; } } 2009/9/20 Doug Reed <r.douglas.reed@gmail.com>: Show quoted text
> Curtis, (and listeners), > Attached, please find the 'patches' I made to handle Windows.  I don't have > an account on CPAN, so I don't really know how to attach them to the problem > you opened.  I am sure I could figure it out, but, my wife has something she > needs me to do. :-) > I cannot really call them patches because they cannot be deployed as is.  I > need to be able to do: > if ($^O =~ /MSWin32/) { >    use Win32; > } > But that will not work because 'use' is done at script load and not at > execute.  There MUST be some way do do this, but I don't know it.  I changed > it to 'require', but then the load failed with unresolved symbols down in > the code, so this is something PERLish I don't know how to do.  In the end, > there is nothing wrong with the code except that we don't want to 'use > Win32;' on Unix systems. > Thanque for looking into this.  I will help if I can as I need this to work, > and we are REALLY close! > > On Fri, Sep 18, 2009 at 5:32 PM, Curtis Jewell <perl@csjewell.fastmail.us> > wrote:
>>
>> > > 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.
>> >> "not actively supported" may be too strong - the maintainer just >> released a new version of another module that Strawberry uses yesterday >> (should have checked who the maintainer was first.) >> >> Greg? Any help here? Any help I or Doug can offer? Would you need a >> "pre-beta" build of Strawberry to test that includes all the >> prerequisites? >>
>> > Would you mind sending me a patch against the current version to start >> > with?
>> >> Attach it to the bug, too. >>
>> > It may have to get pulled out of October if the situation is as bad as >> > you say it is.
>> >> And right now Convert::PEM has suddenly (as in since 30 hours ago) >> started failing tests - I'm going to have to find whatever other module >> is breaking it and get it to build again before I attack this bug - but >> that won't be long! >> >> --Curtis >> -- >> 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] >>
> > > > -- > Regards, > > Doug >
CC: Curtis Jewell <perl [...] csjewell.fastmail.us>, Bugs in Net-SSH-Perl via RT <bug-Net-SSH-Perl [...] rt.cpan.org>, kmx <kmx [...] volny.cz>
Subject: Re: [rt.cpan.org #49820] AutoReply: Win32 support for Net::SSH::Perl
Date: Sun, 20 Sep 2009 06:04:07 -0400
To: adam [...] ali.as
From: Doug Reed <r.douglas.reed [...] gmail.com>
Adam, I tried doing both, but when the code referenced the win32 functions in the code, it complained about 'barewords' under strict mode where the functions were used at compile time. I hate 'strict' and never use it, but I don't write stuff for CPAN. On Sun, Sep 20, 2009 at 1:46 AM, Adam Kennedy <adamkennedybackup@gmail.com>wrote: Show quoted text
> One option is to have the functions called directly in > Win32::whatever() and to NOT export them. > > The other is to make the whole thing happen at compile time with... > > BEGIN { > if ( $^O eq 'MSWin32' ) { > require Win32; > Win32->import; > } > }
Show quoted text
> 2009/9/20 Doug Reed <r.douglas.reed@gmail.com>:
> > Curtis, (and listeners), > > Attached, please find the 'patches' I made to handle Windows. I don't
> have
> > an account on CPAN, so I don't really know how to attach them to the
> problem
> > you opened. I am sure I could figure it out, but, my wife has something
> she
> > needs me to do. :-) > > I cannot really call them patches because they cannot be deployed as is.
> I
> > need to be able to do: > > if ($^O =~ /MSWin32/) { > > use Win32; > > } > > But that will not work because 'use' is done at script load and not at > > execute. There MUST be some way do do this, but I don't know it. I
> changed
> > it to 'require', but then the load failed with unresolved symbols down in > > the code, so this is something PERLish I don't know how to do. In the
> end,
> > there is nothing wrong with the code except that we don't want to 'use > > Win32;' on Unix systems. > > Thanque for looking into this. I will help if I can as I need this to
> work,
> > and we are REALLY close! > > > > On Fri, Sep 18, 2009 at 5:32 PM, Curtis Jewell <
> perl@csjewell.fastmail.us>
> > wrote:
> >>
> >> > > 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.
> >> > >> "not actively supported" may be too strong - the maintainer just > >> released a new version of another module that Strawberry uses yesterday > >> (should have checked who the maintainer was first.) > >> > >> Greg? Any help here? Any help I or Doug can offer? Would you need a > >> "pre-beta" build of Strawberry to test that includes all the > >> prerequisites? > >>
> >> > Would you mind sending me a patch against the current version to start > >> > with?
> >> > >> Attach it to the bug, too. > >>
> >> > It may have to get pulled out of October if the situation is as bad as > >> > you say it is.
> >> > >> And right now Convert::PEM has suddenly (as in since 30 hours ago) > >> started failing tests - I'm going to have to find whatever other module > >> is breaking it and get it to build again before I attack this bug - but > >> that won't be long! > >> > >> --Curtis > >> -- > >> 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] > >>
> > > > > > > > -- > > Regards, > > > > Doug > >
>
-- Regards, Doug
CC: Curtis Jewell <perl [...] csjewell.fastmail.us>, Bugs in Net-SSH-Perl via RT <bug-Net-SSH-Perl [...] rt.cpan.org>, kmx <kmx [...] volny.cz>
Subject: Re: [rt.cpan.org #49820] AutoReply: Win32 support for Net::SSH::Perl
Date: Sun, 20 Sep 2009 11:31:20 -0400
To: adam [...] ali.as
From: Doug Reed <r.douglas.reed [...] gmail.com>
All, I realized my e-mail was going into the ticket! So I thought I would show the symptoms. Below are two examples from the same Win32 host to the same Linux host. The first example is running through Cygwin (which works), and the second is through Strawberry (which loops). Here is the test script: use Net::SSH::Perl; my $ssh = Net::SSH::Perl->new("laura", debug=>1, protocol=>2); $ssh->login("dreed", "*******"); @Out = $ssh->cmd("ls"); foreach $File (@Out) { print $File } Cygwin: HP_Administrator@Vanessa:~$ perl /c/Downloads/testssh.pl Vanessa: Reading configuration data /home/HP_Administrator/.ssh/config Vanessa: Reading configuration data /etc/ssh_config Vanessa: Connecting to laura, port 22. Vanessa: Remote protocol version 2.0, remote software version OpenSSH_5.1p1 Debian-5ubuntu1 Vanessa: Net::SSH::Perl Version 1.34, protocol version 2.0. .anessa: No compat match: OpenSSH_5.1p1 Debian-5ubuntu1 Vanessa: Connection established. Vanessa: Sent key-exchange init (KEXINIT), wait response. Vanessa: Algorithms, c->s: 3des-cbc hmac-sha1 none Vanessa: Algorithms, s->c: 3des-cbc hmac-sha1 none Vanessa: Entering Diffie-Hellman Group 1 key exchange. Vanessa: Sent DH public key, waiting for reply. Vanessa: Received host key, type 'ssh-dss'. Vanessa: Host 'laura' is known and matches the host key. Vanessa: Computing shared secret key. Vanessa: Verifying server signature. Vanessa: Waiting for NEWKEYS message. Vanessa: Send NEWKEYS. Vanessa: Enabling encryption/MAC/compression. Vanessa: Sending request for user-authentication service. Vanessa: Service accepted: ssh-userauth. Vanessa: Trying empty user-authentication request. Vanessa: Authentication methods that can continue: publickey,password. Vanessa: Next method to try is publickey. Vanessa: Next method to try is password. Vanessa: Trying password authentication. Vanessa: Login completed, opening dummy shell channel. Vanessa: channel 0: new [client-session] Vanessa: Requesting channel_open for channel 0. Vanessa: channel 0: open confirm rwindow 0 rmax 32768 Vanessa: Got channel open confirmation, requesting shell. Vanessa: Requesting service shell on channel 0. Vanessa: channel 1: new [client-session] Vanessa: Requesting channel_open for channel 1. Vanessa: Entering interactive session. Vanessa: Sending command: ls Vanessa: Sending command: ls Vanessa: Requesting service exec on channel 1. Vanessa: channel 1: open confirm rwindow 0 rmax 32768 Vanessa: input_channel_request: rtype exit-status reply 0 Vanessa: channel 1: rcvd eof Vanessa: channel 1: output open -> drain Vanessa: channel 1: rcvd close Vanessa: channel 1: input open -> closed Vanessa: channel 1: close_read Vanessa: channel 1: obuf empty Vanessa: channel 1: output drain -> closed Vanessa: channel 1: close_write Vanessa: channel 1: send close Vanessa: channel 1: full closed Desktop Documents Music Pictures Public screen-configurations.xml Templates testssh.pl Videos HP_Administrator@Vanessa:~$ Strawberry: C:\strawberry\perl\bin>perl \Downloads\testssh.pl Vanessa: Reading configuration data C:\Documents and Settings\HP_Administrator/.ssh/config Vanessa: Reading configuration data /etc/ssh_config Vanessa: Connecting to laura, port 22. Vanessa: Remote protocol version 2.0, remote software version OpenSSH_5.1p1 Debian-5ubuntu1 Vanessa: Net::SSH::Perl Version 1.34, protocol version 2.0. .anessa: No compat match: OpenSSH_5.1p1 Debian-5ubuntu1 Vanessa: Connection established. Vanessa: Sent key-exchange init (KEXINIT), wait response. Vanessa: Algorithms, c->s: 3des-cbc hmac-sha1 none Vanessa: Algorithms, s->c: 3des-cbc hmac-sha1 none Vanessa: Entering Diffie-Hellman Group 1 key exchange. Vanessa: Sent DH public key, waiting for reply. Vanessa: Received host key, type 'ssh-dss'. Vanessa: Host 'laura' is known and matches the host key. Vanessa: Computing shared secret key. Vanessa: Verifying server signature. Vanessa: Waiting for NEWKEYS message. Vanessa: Send NEWKEYS. Vanessa: Enabling encryption/MAC/compression. Vanessa: Sending request for user-authentication service. Vanessa: Service accepted: ssh-userauth. Vanessa: Trying empty user-authentication request. Vanessa: Authentication methods that can continue: publickey,password. Vanessa: Next method to try is publickey. Vanessa: Next method to try is password. Vanessa: Trying password authentication. Vanessa: Login completed, opening dummy shell channel. Vanessa: channel 0: new [client-session] Vanessa: Requesting channel_open for channel 0. Vanessa: channel 0: open confirm rwindow 0 rmax 32768 Vanessa: Requesting service shell on channel 0. Vanessa: channel 1: new [client-session] Vanessa: Requesting channel_open for channel 1. Vanessa: Entering interactive session. Vanessa: Sending command: ls Vanessa: Sending command: ls Vanessa: Requesting service exec on channel 1. Vanessa: channel 1: open confirm rwindow 0 rmax 32768 Vanessa: input_channel_request: rtype exit-status reply 0 Vanessa: channel 1: rcvd eof Vanessa: channel 1: output open -> drain Vanessa: channel 1: rcvd close Vanessa: channel 1: input open -> closed Vanessa: channel 1: close_read Terminating on signal SIGINT(2) C:\strawberry\perl\bin> On Sun, Sep 20, 2009 at 6:04 AM, Doug Reed <r.douglas.reed@gmail.com> wrote: Show quoted text
> Adam, > I tried doing both, but when the code referenced the win32 functions in the > code, it complained about 'barewords' under strict mode where the functions > were used at compile time. I hate 'strict' and never use it, but I don't > write stuff for CPAN. > > > On Sun, Sep 20, 2009 at 1:46 AM, Adam Kennedy <adamkennedybackup@gmail.com
> > wrote:
>
>> One option is to have the functions called directly in >> Win32::whatever() and to NOT export them. >> >> The other is to make the whole thing happen at compile time with... >> >> BEGIN { >> if ( $^O eq 'MSWin32' ) { >> require Win32; >> Win32->import; >> } >> }
> >
>> 2009/9/20 Doug Reed <r.douglas.reed@gmail.com>:
>> > Curtis, (and listeners), >> > Attached, please find the 'patches' I made to handle Windows. I don't
>> have
>> > an account on CPAN, so I don't really know how to attach them to the
>> problem
>> > you opened. I am sure I could figure it out, but, my wife has something
>> she
>> > needs me to do. :-) >> > I cannot really call them patches because they cannot be deployed as is.
>> I
>> > need to be able to do: >> > if ($^O =~ /MSWin32/) { >> > use Win32; >> > } >> > But that will not work because 'use' is done at script load and not at >> > execute. There MUST be some way do do this, but I don't know it. I
>> changed
>> > it to 'require', but then the load failed with unresolved symbols down
>> in
>> > the code, so this is something PERLish I don't know how to do. In the
>> end,
>> > there is nothing wrong with the code except that we don't want to 'use >> > Win32;' on Unix systems. >> > Thanque for looking into this. I will help if I can as I need this to
>> work,
>> > and we are REALLY close! >> > >> > On Fri, Sep 18, 2009 at 5:32 PM, Curtis Jewell <
>> perl@csjewell.fastmail.us>
>> > wrote:
>> >>
>> >> > > 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.
>> >> >> >> "not actively supported" may be too strong - the maintainer just >> >> released a new version of another module that Strawberry uses yesterday >> >> (should have checked who the maintainer was first.) >> >> >> >> Greg? Any help here? Any help I or Doug can offer? Would you need a >> >> "pre-beta" build of Strawberry to test that includes all the >> >> prerequisites? >> >>
>> >> > Would you mind sending me a patch against the current version to
>> start
>> >> > with?
>> >> >> >> Attach it to the bug, too. >> >>
>> >> > It may have to get pulled out of October if the situation is as bad
>> as
>> >> > you say it is.
>> >> >> >> And right now Convert::PEM has suddenly (as in since 30 hours ago) >> >> started failing tests - I'm going to have to find whatever other module >> >> is breaking it and get it to build again before I attack this bug - but >> >> that won't be long! >> >> >> >> --Curtis >> >> -- >> >> 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] >> >>
>> > >> > >> > >> > -- >> > Regards, >> > >> > Doug >> >
>>
> > > > -- > Regards, > > Doug >
-- Regards, Doug

Message body is not shown because it is too large.

CC: adam [...] ali.as, Curtis Jewell <perl [...] csjewell.fastmail.us>, Bugs in Net-SSH-Perl via RT <bug-Net-SSH-Perl [...] rt.cpan.org>
Subject: Re: [rt.cpan.org #49820] AutoReply: Win32 support for Net::SSH::Perl
Date: Mon, 21 Sep 2009 09:34:14 +0200
To: Doug Reed <r.douglas.reed [...] gmail.com>
From: kmx <kmx [...] volny.cz>
Hi Doug (and others), I am sending my opinion to Net::SSH::Perl issues discussed here: 1) I would definitely split the problem into two parts - "$ENV{HOME}" issue - "looping" issue 2) With "$ENV{HOME}" I recommend to use File::HomeDir module (as proposed by CSJEWELL) and replace $ENV{HOME} with File::HomeDir::home() - in that case no "if ($^O eq 'MSWin32') ..." needed 3) I have looked at you patch and I want to point out that it is not necessary to do a special ioctl on Windows to set nonblocking behaviour as it was already implemented in IO::Socket - see source http://cpansearch.perl.org/src/GBARR/IO-1.25/lib/IO/Socket.pm So it should be enough to call $sock->blocking(0) - HOWEVER BEWARE: proper setting of nonblocking mode on Windows was implemented in IO version approx. 1.24 (not so long time ago). So again no need for any "if ($^O eq 'MSWin32') ... 4) I have done a test with the following script: use Net::SSH::Perl; my $ssh = Net::SSH::Perl->new("srv", debug => 1, protocol => '1' ); $ssh->login("usr", "passwd"); my ($output,$errors,$exit) = $ssh->cmd("ls -l", 1); print "###OUTPUT=\n" . $output; and it works - however: a) it uses protocol SSH1; b) I have to pass 2nd param (=$stdin) to cmd() call - do not ask me why, but without it it hangs up (loops). When I look at SSH1.pm - sub _start_interactive - I was in doubts whether the condition: $s->add(\*STDIN) unless $sent_stdin; is not reverted, but I do not know absolutely nothing about Net::SSH::Perl guts. 5) When trying SSH2 - the script hangs up exactly as you have described and short analysis led me to the select() call in SSH2.pm (sub client_loop) that seems not to work as expected - but again the module Net::SSH::Perl is quite complex and I saw its source code for the first time 6) What makes things slightly unclear is mixing non-OO functions and OO-functions when handling sockets - I know it should work but consistent use of OO (or non-OO) approach would be healthier. I have dealt with non-blocking sockets couple of months ago and it works - perhaps Windows is only not so "tolerant" and not everything from UNIX world works the same. I recommend consistently use OO socket interface. That is all from my short analysis. Unfortunately I am have not seen Net::SSH::Perl sources before so it is quite hard for me to prepare a sane patch (but I can try later if you find it useful). -- kmx
CC: adam [...] ali.as, Curtis Jewell <perl [...] csjewell.fastmail.us>, Bugs in Net-SSH-Perl via RT <bug-Net-SSH-Perl [...] rt.cpan.org>
Subject: Re: [rt.cpan.org #49820] AutoReply: Win32 support for Net::SSH::Perl
Date: Mon, 21 Sep 2009 10:08:50 +0200
To: Doug Reed <r.douglas.reed [...] gmail.com>
From: kmx <kmx [...] volny.cz>
.. and one more point where I am not sure about Windows compatibility in SSH2.pm - sub _session_channel: I do not know if calling: rfd => _dup('STDIN', '<'), wfd => _dup('STDOUT', '>'), ... works on Windows as expected, I have not tested it in more details. I have only experienced some "dup() issue" in past - so just pointing your attention to potential "point of failure". -- kmx
CC: adam [...] ali.as, Curtis Jewell <perl [...] csjewell.fastmail.us>, Bugs in Net-SSH-Perl via RT <bug-Net-SSH-Perl [...] rt.cpan.org>
Subject: Re: [rt.cpan.org #49820] AutoReply: Win32 support for Net::SSH::Perl
Date: Mon, 21 Sep 2009 08:08:15 -0400
To: kmx <kmx [...] volny.cz>
From: Doug Reed <r.douglas.reed [...] gmail.com>
Kmx, With regard to the non-blocking sockets, yes this is supposed to work, and I think it was fixed in IO::Socket, but as you point out there is a mixture of OO and non OO code in the module, and using 1.34 on my die is triggered on: defined($sock->blocking(0)) or die "Can't set socket non-blocking: $!"; .. which I also wondered if it might be because the socket was opened using the Non OO call. I did the patch to get past this. You will notice my patch also calls die on failure, and yet mine does not die. So it seems that something is not working unless my IO Socket is old, but I just installed Strawberry from scratch about two weeks ago. On Mon, Sep 21, 2009 at 3:34 AM, kmx <kmx@volny.cz> wrote: Show quoted text
> Hi Doug (and others), > > I am sending my opinion to Net::SSH::Perl issues discussed here: > > 1) I would definitely split the problem into two parts > - "$ENV{HOME}" issue > - "looping" issue > > 2) With "$ENV{HOME}" I recommend to use File::HomeDir module (as proposed > by CSJEWELL) and replace $ENV{HOME} with File::HomeDir::home() - in that > case no "if ($^O eq 'MSWin32') ..." needed > > 3) I have looked at you patch and I want to point out that it is not > necessary to do a special ioctl on Windows to set nonblocking behaviour as > it was already implemented in IO::Socket - see source > http://cpansearch.perl.org/src/GBARR/IO-1.25/lib/IO/Socket.pm > > So it should be enough to call $sock->blocking(0) - HOWEVER BEWARE: proper > setting of nonblocking mode on Windows was implemented in IO version approx. > 1.24 (not so long time ago). > > So again no need for any "if ($^O eq 'MSWin32') ... > > 4) I have done a test with the following script: > > use Net::SSH::Perl; > my $ssh = Net::SSH::Perl->new("srv", debug => 1, protocol => '1' ); > $ssh->login("usr", "passwd"); > my ($output,$errors,$exit) = $ssh->cmd("ls -l", 1); > print "###OUTPUT=\n" . $output; > > and it works - however: a) it uses protocol SSH1; b) I have to pass 2nd > param (=$stdin) to cmd() call - do not ask me why, but without it it hangs > up (loops). When I look at SSH1.pm - sub _start_interactive - I was in > doubts whether the condition: > > $s->add(\*STDIN) unless $sent_stdin; > > is not reverted, but I do not know absolutely nothing about Net::SSH::Perl > guts. > > 5) When trying SSH2 - the script hangs up exactly as you have described and > short analysis led me to the select() call in SSH2.pm (sub client_loop) that > seems not to work as expected - but again the module Net::SSH::Perl is > quite complex and I saw its source code for the first time > > 6) What makes things slightly unclear is mixing non-OO functions and > OO-functions when handling sockets - I know it should work but consistent > use of OO (or non-OO) approach would be healthier. I have dealt with > non-blocking sockets couple of months ago and it works - perhaps Windows is > only not so "tolerant" and not everything from UNIX world works the same. I > recommend consistently use OO socket interface. > > That is all from my short analysis. Unfortunately I am have not seen > Net::SSH::Perl sources before so it is quite hard for me to prepare a sane > patch (but I can try later if you find it useful). > > > -- > kmx >
-- Regards, Doug
CC: adam [...] ali.as, Curtis Jewell <perl [...] csjewell.fastmail.us>, Bugs in Net-SSH-Perl via RT <bug-Net-SSH-Perl [...] rt.cpan.org>
Subject: Re: [rt.cpan.org #49820] AutoReply: Win32 support for Net::SSH::Perl
Date: Mon, 21 Sep 2009 15:12:36 +0200
To: Doug Reed <r.douglas.reed [...] gmail.com>
From: kmx <kmx [...] volny.cz>
Doug, try to upgrade IO package: c:\> cpan -fi IO I have experienced "Can't set socket non-blocking" only with old IO module (e.g. IO-1.23 module included in strawberry 5.8.9 April-2009 release). The other thing is that Net::SSH::Perl is setting non-blocking mode only on the actual socket (I am nearly sure this should work), however in the code there is also some dark magic with STDIN, STDOUT, STDERR handles and I am not sure about [non]blocking issues with STD* on Win32. Calling $x->blocking(0) on a non-socket handle will fail on Win32. Anyway when tracing the never-ending loop I have ended up in IO::Select->select() that fails (unfortunately with Unknown Error) when calling raw (non-OO) select() function with handle-vectors containing bits for the network socket as well as some "dup-ed" STD* handles. -- kmx
CC: adam [...] ali.as, Curtis Jewell <perl [...] csjewell.fastmail.us>, Bugs in Net-SSH-Perl via RT <bug-Net-SSH-Perl [...] rt.cpan.org>
Subject: Re: [rt.cpan.org #49820] AutoReply: Win32 support for Net::SSH::Perl
Date: Mon, 21 Sep 2009 18:19:59 +0200
To: Doug Reed <r.douglas.reed [...] gmail.com>
From: kmx <kmx [...] volny.cz>
Hi all, I have distilled the core problem of looping issue - it is improperly working IO::Select / select() when called on STDIN (or other STD*) handle. *** sample1.pl - using OO interface via IO::Select *** use strict; use warnings; use IO::Select; use Data::Dumper; my $s = IO::Select->new(); $s->add(\*STDIN); print STDERR "calling select() - hit any key or wait 5sec for timeout\n"; my @ready = IO::Select->select($s,undef,undef,5); print STDERR Dumper(\@ready); print STDERR "error=$!\n"; *** end of sample1.pl *** *** sample2.pl - using raw select() call *** use strict; use warnings; my $v=''; vec($v,fileno(STDIN),1)=1; print STDERR "calling select() - hit any key or wait 5sec for timeout\n"; my $rv=select($v,undef,undef,5); print STDERR "rv=$rv\n"; print STDERR "error=$!\n"; *** end of sample2.pl *** Both scripts above work on perl@Linux and perl@Cygwin however fails on Win32/strawberry perl. Unfortunately Net::SSH::Perl uses STD(IN|OUT|ERR) handles in select() call - therefore currently no chance to work on Win32. To sum up: 1) We should probably post an RT to IO module? or perhaps somewhere else? 2) Making a workaround in Net::SSH::Perl just for Win32 platform - not easy + I do not believe the Net::SSH::Perl maintainers would agree with this approach 3) For CSJEWELL - I guess Win32/strawberry Oct2009 release will be without Net::SSH::Perl -- kmx
CC: adam [...] ali.as, Curtis Jewell <perl [...] csjewell.fastmail.us>, Bugs in Net-SSH-Perl via RT <bug-Net-SSH-Perl [...] rt.cpan.org>
Subject: Re: [rt.cpan.org #49820] AutoReply: Win32 support for Net::SSH::Perl
Date: Mon, 21 Sep 2009 12:41:59 -0400
To: kmx <kmx [...] volny.cz>
From: Doug Reed <r.douglas.reed [...] gmail.com>
Kmx, So in order to follow up, can someone (you?) open an RT to the maintainers of the IO module. I don't feel I comfortable doing so because I don't have the same level of understanding as you. .. and thanque for following up on this. On Mon, Sep 21, 2009 at 12:19 PM, kmx <kmx@volny.cz> wrote: Show quoted text
> Hi all, > > I have distilled the core problem of looping issue - it is improperly > working IO::Select / select() when called on STDIN (or other STD*) handle. > > *** sample1.pl - using OO interface via IO::Select *** > > use strict; > use warnings; > use IO::Select; > use Data::Dumper; > > my $s = IO::Select->new(); > $s->add(\*STDIN); > print STDERR "calling select() - hit any key or wait 5sec for timeout\n"; > my @ready = IO::Select->select($s,undef,undef,5); > print STDERR Dumper(\@ready); > print STDERR "error=$!\n"; > > *** end of sample1.pl *** > > > *** sample2.pl - using raw select() call *** > > use strict; > use warnings; > > my $v=''; > vec($v,fileno(STDIN),1)=1; > print STDERR "calling select() - hit any key or wait 5sec for timeout\n"; > my $rv=select($v,undef,undef,5); > print STDERR "rv=$rv\n"; > print STDERR "error=$!\n"; > > *** end of sample2.pl *** > > Both scripts above work on perl@Linux and perl@Cygwin however fails on > Win32/strawberry perl. > > Unfortunately Net::SSH::Perl uses STD(IN|OUT|ERR) handles in select() call > - therefore currently no chance to work on Win32. > > To sum up: > > 1) We should probably post an RT to IO module? or perhaps somewhere else? > > 2) Making a workaround in Net::SSH::Perl just for Win32 platform - not > easy + I do not believe the Net::SSH::Perl maintainers would agree with > this approach > > 3) For CSJEWELL - I guess Win32/strawberry Oct2009 release will be without > Net::SSH::Perl > > -- > kmx >
-- Regards, Doug
CC: adam [...] ali.as, Curtis Jewell <perl [...] csjewell.fastmail.us>, Bugs in Net-SSH-Perl via RT <bug-Net-SSH-Perl [...] rt.cpan.org>
Subject: Re: [rt.cpan.org #49820] AutoReply: Win32 support for Net::SSH::Perl
Date: Wed, 23 Sep 2009 10:09:32 +0200
To: Doug Reed <r.douglas.reed [...] gmail.com>
From: kmx <kmx [...] volny.cz>
Doug (and others), bad news: http://search.cpan.org/dist/perl-5.10.1/pod/perlport.pod says "select - Only implemented on sockets. (Win32, VMS)" So chances to get Net::SSH::Perl work on Win32 (without quite significant design changes) are quite low. -- kmx
CC: adam [...] ali.as, Curtis Jewell <perl [...] csjewell.fastmail.us>, Bugs in Net-SSH-Perl via RT <bug-Net-SSH-Perl [...] rt.cpan.org>
Subject: Re: [rt.cpan.org #49820] AutoReply: Win32 support for Net::SSH::Perl
Date: Wed, 23 Sep 2009 09:41:33 -0400
To: kmx <kmx [...] volny.cz>
From: Doug Reed <r.douglas.reed [...] gmail.com>
Kmx, Well, thanque for following up on this. This is a bummer. I might think about working on this if I knew where to start, but I fear that my understanding of Perl's socket implementation is not sophisticated enough. Indeed I am not quite sure I even understand the problem. Why are we not using sockets? I mean the code creates sockets, and selects them, and the docs say it only works on sockets, so I don't really understand when a socket is not a socket. ... or better yet, how it works on Cygwin. On Wed, Sep 23, 2009 at 4:09 AM, kmx <kmx@volny.cz> wrote: Show quoted text
> Doug (and others), > > bad news: http://search.cpan.org/dist/perl-5.10.1/pod/perlport.pod says > "select - Only implemented on sockets. (Win32, VMS)" > > So chances to get Net::SSH::Perl work on Win32 (without quite significant > design changes) are quite low. > > -- > kmx >
-- Regards, Doug
CC: adam [...] ali.as, Curtis Jewell <perl [...] csjewell.fastmail.us>, Bugs in Net-SSH-Perl via RT <bug-Net-SSH-Perl [...] rt.cpan.org>
Subject: Re: [rt.cpan.org #49820] AutoReply: Win32 support for Net::SSH::Perl
Date: Wed, 23 Sep 2009 17:07:29 +0200
To: Doug Reed <r.douglas.reed [...] gmail.com>
From: kmx <kmx [...] volny.cz>
Doug, to get it work on Win32 you need to fix basically 2 issues: [1] in SSH1.pm avoid using this: - my $s = IO::Select->new; - ... - $s->add(\*STDIN) <<< THIS IS NOT WIN32 COMPATIBLE [2] in SSH2.pm (in sub _session_channel) - redesign _dup(STD*) magic: - my $channel = $cmgr->new_channel( - ctype => 'session', local_window => 32*1024, - local_maxpacket => 16*1024, remote_name => 'client-session', - rfd => _dup('STDIN', '<'), wfd => _dup('STDOUT', '>'), - efd => _dup('STDERR', '>')); as later in SSH2.pm we use rfd/wfd/efd in select() call - again WIN32 INCOMPATIBLE Sorry, I cannot help you more as I am not Net::SSH::Perl user - I was involved in this RT just "by accident" while trying to fix some issues concerning various crypto libraries we are gonna include in Win32/strawberry perl (Oct2009 release). Crypto is not a problem on Win32-perl anymore. This is sort of an IO (socket/handle/select) issue. But agree, it is not a good news that Net::SSH::Perl is not supported on Win32. -- kmx
On Wed Sep 23 11:07:50 2009, kmx@volny.cz wrote: Show quoted text
> Doug, > > to get it work on Win32 you need to fix basically 2 issues: > > [1] in SSH1.pm avoid using this: > - my $s = IO::Select->new; > - ... > - $s->add(\*STDIN) <<< THIS IS NOT WIN32 COMPATIBLE > > [2] in SSH2.pm (in sub _session_channel) - redesign _dup(STD*) magic: > - my $channel = $cmgr->new_channel( > - ctype => 'session', local_window => 32*1024, > - local_maxpacket => 16*1024, remote_name => 'client-session', > - rfd => _dup('STDIN', '<'), wfd => _dup('STDOUT', '>'), > - efd => _dup('STDERR', '>')); > as later in SSH2.pm we use rfd/wfd/efd in select() call - again WIN32 > INCOMPATIBLE > > Sorry, I cannot help you more as I am not Net::SSH::Perl user - I was > involved in this RT just "by accident" while trying to fix some issues > concerning various crypto libraries we are gonna include in > Win32/strawberry perl (Oct2009 release). Crypto is not a problem on > Win32-perl anymore. This is sort of an IO (socket/handle/select) issue. > > But agree, it is not a good news that Net::SSH::Perl is not supported on > Win32. > > -- > kmx
even if you remove the stdin/out/err handles from the select there is a remaining issue of some sort. The select fires once, then never again. Did someone post that they have a partial patch ? was it posted to the ticket? I HAVE to make this work quickly, so I may be able to develop something. this also fails on ActiveState perl 5.10 (which is my Windows target platform). Sam
On Wed Sep 23 15:26:34 2009, sam-d wrote: Show quoted text
> > even if you remove the stdin/out/err handles from the select there is a > remaining issue of some sort. The select fires once, then never again. > Did someone post that they have a partial patch ? was it posted to the > ticket? > > I HAVE to make this work quickly, so I may be able to develop something. > this also fails on ActiveState perl 5.10 (which is my Windows target > platform). > > Sam >
I see the patch above (to the right).. it was only for the homedir problem.. we can use eval() for that. the bigger problem is the select() difficulty. Sam
CC: adam [...] ali.as, Curtis Jewell <perl [...] csjewell.fastmail.us>, Bugs in Net-SSH-Perl via RT <bug-Net-SSH-Perl [...] rt.cpan.org>
Subject: Re: [rt.cpan.org #49820] AutoReply: Win32 support for Net::SSH::Perl
Date: Fri, 25 Sep 2009 11:49:44 -0400
To: kmx <kmx [...] volny.cz>
From: Doug Reed <r.douglas.reed [...] gmail.com>
All, I found an easy solution! http://www.perlmonks.org/?node_id=758068 Says that Net::SSH::w32Perl stopped working because they changed: my $proto_class = $ssh->protocol_class($proto); To: my $proto_class = join '::', __PACKAGE__, ($proto == PROTOCOL_SSH2 ? "SSH2" : "SSH1"); in 'Perl.pm' which prevents the module from overloading the select statements. The comment says that if you put it back, it works properly. I did, and it does. Now I just need to get SSH1 working. Maybe better still someone like 'Knx' could have a look at the code and tell us if the fix might be able to be put in Net::SSH::Perl and we could throw W32Perl away. I think it looks pretty generic to me... It just overrides select with Object methods. .. but them I am a bit green at this Perl internals stuff. On Wed, Sep 23, 2009 at 11:07 AM, kmx <kmx@volny.cz> wrote: Show quoted text
> Doug, > > to get it work on Win32 you need to fix basically 2 issues: > > [1] in SSH1.pm avoid using this: > - my $s = IO::Select->new; > - ... > - $s->add(\*STDIN) <<< THIS IS NOT WIN32 COMPATIBLE > > [2] in SSH2.pm (in sub _session_channel) - redesign _dup(STD*) magic: > - my $channel = $cmgr->new_channel( > - ctype => 'session', local_window => 32*1024, > - local_maxpacket => 16*1024, remote_name => 'client-session', > - rfd => _dup('STDIN', '<'), wfd => _dup('STDOUT', '>'), > - efd => _dup('STDERR', '>')); > as later in SSH2.pm we use rfd/wfd/efd in select() call - again WIN32 > INCOMPATIBLE > > Sorry, I cannot help you more as I am not Net::SSH::Perl user - I was > involved in this RT just "by accident" while trying to fix some issues > concerning various crypto libraries we are gonna include in Win32/strawberry > perl (Oct2009 release). Crypto is not a problem on Win32-perl anymore. This > is sort of an IO (socket/handle/select) issue. > > But agree, it is not a good news that Net::SSH::Perl is not supported on > Win32. > > -- > kmx >
-- Regards, Doug
From: sdetweil [...] gmail.com
On Fri Sep 25 11:50:03 2009, r.douglas.reed@gmail.com wrote: Show quoted text
> All, > I found an easy solution! > > http://www.perlmonks.org/?node_id=758068 > > Says that Net::SSH::w32Perl stopped working because they changed: > > my $proto_class = $ssh->protocol_class($proto); > > To: > > my $proto_class = join '::', __PACKAGE__, ($proto == PROTOCOL_SSH2 ? > "SSH2" > : "SSH1"); > > in 'Perl.pm' which prevents the module from overloading the select > statements. The comment says that if you put it back, it works > properly. I > did, and it does. Now I just need to get SSH1 working. Maybe better > still > someone like 'Knx' could have a look at the code and tell us if the > fix > might be able to be put in Net::SSH::Perl and we could throw W32Perl > away. I > think it looks pretty generic to me... It just overrides select with > Object > methods. .. but them I am a bit green at this Perl internals stuff. > > >
well, it takes more than that.. that fails.. you need to change SSH::Perl to SSH:W32Perl to load the right library. this hooks in IO::Select::Trap.. my $proto_class = join '::', __PACKAGE__, ($proto == PROTOCOL_SSH2 ? "SSH2" : "SSH1"); so the change it to add if ($^O =~ /Win32/i) { $proto_class =~ s/Perl/W32Perl/; } to hook the W32/SSH2.pm the $home problem fix is in two places.. SSH:Perl.pm, init() my $home; if ($^O =~ /Win32/i) { $home = $ENV{HOMEDRIVE}.$ENV{HOMEPATH} || eval(Win32::GetFolderPath( "Win32::CSIDL_PERSONAL" ) || "."); $home=~ s/\\/\//g; } else { $home = $ENV{HOME} || (getpwuid($>))[7]; } still searching for the other one I change (for %home) thank YOU.. Sam
On Fri Sep 25 13:23:26 2009, sam-d wrote: Show quoted text
> On Fri Sep 25 11:50:03 2009, r.douglas.reed@gmail.com wrote:
> > All, > > I found an easy solution! > > > > http://www.perlmonks.org/?node_id=758068 > > > > Says that Net::SSH::w32Perl stopped working because they changed: > > > > my $proto_class = $ssh->protocol_class($proto); > > > > To: > > > > my $proto_class = join '::', __PACKAGE__, ($proto == PROTOCOL_SSH2 ? > > "SSH2" > > : "SSH1"); > > > > in 'Perl.pm' which prevents the module from overloading the select > > statements. The comment says that if you put it back, it works > > properly. I > > did, and it does. Now I just need to get SSH1 working. Maybe better > > still > > someone like 'Knx' could have a look at the code and tell us if the > > fix > > might be able to be put in Net::SSH::Perl and we could throw W32Perl > > away. I > > think it looks pretty generic to me... It just overrides select with > > Object > > methods. .. but them I am a bit green at this Perl internals stuff. > > > > > >
> well, it takes more than that.. that fails.. you need to change > SSH::Perl to SSH:W32Perl to load the right library. > this hooks in IO::Select::Trap.. > > my $proto_class = join '::', __PACKAGE__, > ($proto == PROTOCOL_SSH2 ? "SSH2" : "SSH1"); > > so the change it to add > > if ($^O =~ /Win32/i) { > $proto_class =~ s/Perl/W32Perl/; > } > > to hook the W32/SSH2.pm > > the $home problem fix is in two places.. > SSH:Perl.pm, init() > my $home; > if ($^O =~ /Win32/i) { > $home = $ENV{HOMEDRIVE}.$ENV{HOMEPATH} || > eval(Win32::GetFolderPath( "Win32::CSIDL_PERSONAL" ) || "."); > $home=~ s/\\/\//g; > > } else { > $home = $ENV{HOME} || (getpwuid($>))[7]; > } > > still searching for the other one I change (for %home) > > thank YOU.. > > Sam > >
also in Perl::SSH2.pm init() if ($^O =~ /Win32/i) { $home = $ENV{HOMEDRIVE}.$ENV{HOMEPATH} || eval(Win32::GetFolderPath( "Win32::CSIDL_PERSONAL" ) || "."); $home=~ s/\\/\//g; } else { $home = $ENV{HOME} || (getpwuid($>))[7]; } and the blocking change in SSH::Perl _connect() if ($^O =~ /Win32/i) { my $nonblocking = "\x00\x00\x00\x01"; # pack("L",1) works too my $PtrToLong = unpack("I",pack('P',$nonblocking)); # get address to the variable contents, not it's reference structure ioctl($sock, FIONBIO,$PtrToLong ) or die "Can't set socket non-blocking: $!"; } else { defined($sock->blocking(0)) or die "Can't set socket non-blocking: $!"; } don't know how to get that perldiff.. Sam
On Fri Sep 25 14:10:42 2009, sam-d wrote: now I am seeing this SAMS: channel 1: open confirm rwindow 131071 rmax 16384 GLOB at i:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 350 IO::String at i:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 113 SAMS: sftp: in sftp connection failure sub SAMS: sftp: sftp server responded SAMS: sftp: Sending SSH2_FXP_INIT SAMS: sftp: in sftp get_msg SAMS: sftp: calling client loop GLOB at i:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 350 IO::String at i:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 113 GLOB at i:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 350 IO::String at i:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 113 IO::String at i:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 121 SAMS: sftp: in sftp incoming data sub SAMS: sftp: returned from client loop SAMS: sftp: Remote version: 3 SAMS: sftp: Sent message T:17 I:0 SAMS: sftp: in sftp get_msg SAMS: sftp: calling client loop GLOB at i:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 350 IO::String at i:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 113 GLOB at i:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 350 IO::String at i:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 113 IO::String at i:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 121 Sam
On Fri Sep 25 14:47:48 2009, sam-d wrote: Show quoted text
> On Fri Sep 25 14:10:42 2009, sam-d wrote: > now I am seeing this > > SAMS: channel 1: open confirm rwindow 131071 rmax 16384 > GLOB at i:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 350 > IO::String at i:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 113 > SAMS: sftp: in sftp connection failure sub > SAMS: sftp: sftp server responded > SAMS: sftp: Sending SSH2_FXP_INIT > SAMS: sftp: in sftp get_msg > SAMS: sftp: calling client loop > GLOB at i:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 350 > IO::String at i:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 113 > GLOB at i:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 350 > IO::String at i:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 113 > IO::String at i:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 121 > SAMS: sftp: in sftp incoming data sub > SAMS: sftp: returned from client loop > SAMS: sftp: Remote version: 3 > SAMS: sftp: Sent message T:17 I:0 > SAMS: sftp: in sftp get_msg > SAMS: sftp: calling client loop > GLOB at i:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 350 > IO::String at i:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 113 > GLOB at i:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 350 > IO::String at i:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 113 > IO::String at i:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 121 > > > Sam >
ok, in IO::Select::Trap, Trap.pm, the two calls to carp() in trapped() need to be removed. Sam
Applied some changes in cvs, please let me know what else needs to be done.
On Sun Oct 25 16:52:59 2009, greg@turnstep.com wrote: Show quoted text
> Applied some changes in cvs, please let me know what else needs to be
done. I just got reminded of this, and have one question - where would this CVS be?!? There's NO mention of it in the docs. I think I have an ssh-using server to try against now. --Curtis
On Sun Oct 25 16:52:59 2009, greg@turnstep.com wrote: Show quoted text
> Applied some changes in cvs, please let me know what else needs to be
done. Net::SSH::Perl uses FIONBIO, which is undefined (at least of Windows). I added following constant: use constant FIONBIO => 0x8004667e; All tests pass except 03-packet.t: Can't locate Net/SSH/W32Perl/SSH1.pm in @INC (@INC contains: D:\14\net-ssh-perl\blib\lib D:\14\net-ssh-perl\blib\arch C:/strawberry/perl/lib C:/strawberry/perl/site/lib C:\strawberry\perl\vendor\lib .) at D:\14\net-ssh-perl\blib\lib/Net/SSH/Perl.pm line 55. # Looks like your test exited with 2 before it could output anything. t/03-packet.t .. 1..10 Dubious, test returned 2 (wstat 512, 0x200) There is Net::SSH::W32Perl::SSH2 on CPAN, but no Net::SSH::W32Perl::SSH1. -- Alexandr Ciornii, http://chorny.net