Skip Menu |

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

Report information
The Basics
Id: 122364
Status: new
Priority: 0/
Queue: Net-SSH-Perl

Owner: Nobody in particular
Requestors: hugo.mgt [...]

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

Subject: bug in write_private method
Date: Wed, 05 Jul 2017 10:15:49 +0000
To: bug-Net-SSH-Perl [...]
From: hugo.mgt [...]
Download (untitled) / with headers
text/plain 1.6k
Hello, the documentation[1] says "If $file is not provided, returns the content that would have been written to the key file." But running this simple perl script returns the following error message : Show quoted text
> hugo@brichemer:~$ cat > use Net::SSH::Perl::Key; > my $privkey = Net::SSH::Perl::Key->keygen("RSA",2048)->write_private(); > hugo@brichemer:~$ perl > Use of uninitialized value $key_file in open at > /usr/local/lib/x86_64-linux-gnu/perl/5.22.1/Net/SSH/Perl/Key/ line > 93. > Use of uninitialized value $key_file in concatenation (.) or string at > /usr/local/lib/x86_64-linux-gnu/perl/5.22.1/Net/SSH/Perl/Key/ line 93. > Can't write to : No such file or directory at line 2.
To fix this I added a line to handle the case where "$key_file" is empty, here is the diff between the original and the modified : Show quoted text
> hugo@brichemer:~$ diff* > 92a93,95 > > return $pem if(!$key_file);
I have checked some but not all perl modules file in 'perl/5.24.1/Net/SSH/Perl/Key/' for the function write_private and it seems they also need this modification. Finally, here are some versions infos : Show quoted text
> hugo@brichemer:~$ sudo cpanm --info Net::SSH::Perl::Key && uname -a && perl -v > SCHWIGON/Net-SSH-Perl-2.12.tar.gz > Linux brichemer 4.9.0-3-686-pae #1 SMP Debian 4.9.30-2+deb9u2 (2017-06-26) i686 GNU/Linux > This is perl 5, version 24, subversion 1 (v5.24.1) built for i686-linux-gnu-thread-multi-64int
Thank you [1]$key-%3Ewrite_private([_$ ile_[,_$pass,_$ciphername,_$rounds]_]) --- gpg public key :

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to