Re: [Ssh-sftp-perl-users] input must be 8 bytes long at Crypt/DES.pmline 57
Brought to you by:
dbrobins
From: Glen F. <gfo...@ho...> - 2006-12-28 12:41:28
|
Hi, Thanks for the help, I just did a my $ip = pack('C*', unpack('C*', $_)); in each of the variables I was reading from the xml and everything worked!!! Thanks again -PBK-, Glen >From: Phillip.Keegstra >To: Glen Farmer >Subject: Re: [Ssh-sftp-perl-users] input must be 8 bytes long at >Crypt/DES.pmline 57 >Date: Wed, 27 Dec 2006 12:24:36 -0500 > > >You need to become friends with the Cargo Cult.... > >You need to turn the UTF-8ness off of the strings you get from XML.... > > > # For some truly bizarre cargocult reason > # SFTP only works if we strip utf8ness. > my $ip = pack('C*', unpack('C*', $_)); > my $ff = pack('C*', unpack('C*', ${$ftpref}{$_})); > my($ll,$user,$pass,$path_there) = split(/\t/, $ff); > > > -PBK- > > > >----- Original Message ----- >From: Glen Farmer >Date: Wednesday, December 27, 2006 11:41 am >Subject: [Ssh-sftp-perl-users] input must be 8 bytes long at >Crypt/DES.pm line 57 > > > Hi I'm a newbie to perl and I was trying to write a script to read > > a xml > > with all the info for the connection and all the commands that need > > to run > > on the remote machine. I was using Net::SSH::Perl and it works if I > > don't > > get the variables from the xml, but if I read the xml using > > XML::Simple or > > XML:Smart it give the the following error: > > > > input must be 8 bytes long at > > /usr/lib/perl5/site_perl/5.8.8/i586-linux-thread-multi/Crypt/DES.pm > > line 57. > > > > If I put in the info to login to the ssh server hardcoded in the > > script it > > works but when ever I use the variables that were read by the XML > > modules it > > give me the error. > > > > If I hardcode the login info to the script and then try to use > > commands that > > were read from the xml script it give me the same error. > > > > Can someone help me please!!! > > > > Thanks in advance, > > Glen > > > > I'm running: > > opensuse 10.1. Net > > This is perl, v5.8.8 built for i586-linux-thread-multi > > Net-SSH-Perl-1.30 > > Crypt-DES-2.05 > > XML-Simple-2.16 > > XML-Smart-1.6.9 > > cpan script version 1.03 > > CPAN.pm version 1.7602 > > > > > > The script is: > > > > #!/usr/bin/perl -w > > > > use XML::Smart; > > use Net::SSH::Perl; > > > > my $XML = XML::Smart->new($ARGV[0]); > > > > my $host = $XML->{Server}->{ip}; > > my $user = $XML->{Server}->{user}; > > my $password = $XML->{Server}->{password}; > > > > my $ssh = Net::SSH::Perl->new ($host); > > $ssh->login($user, $password); > > print "Connected...\n"; > > > > > > The XML -------------------------------- > > <Server> > > <ip>10.10.10.10</ip> > > <user>userName</user> > > <password>password</password> > > <Commands> > > <Command>cd d:/</Command> > > </Commands> > > </Server> > > _________________________________________________________________ The MSN Entertainment Guide to Golden Globes is here. Get all the scoop. http://tv.msn.com/tv/globes2007/ |