[Ssh-sftp-perl-users] Handling Invalid Login Credentials
Brought to you by:
dbrobins
From: Leon K. <leo...@ya...> - 2009-09-01 22:15:20
|
I'm testing a script that uses Net::SFTP, and if I provide a bogus password, the ssh->login kills my script with a "die": Permission denied at /usr/local/pkg/perl/5.8.4/lib/site_perl/5.8.4/Net/SFTP.pm line 62 I am unable to find any way to handle this. I want to catch the error (which is not very specific BTW) and call my own failure handler code to exit the script on my terms. Is there a way to configure the call to Net::SFTP->new so that if it fails, control returns back to my script? I tried using a warn handler, which had no effect. I also tried an ssh_args containing "LogLevel QUIET" to no avail. If I use a $SIG{__DIE__}, it catches all sorts of events prior to the "Permission denied" die signal. |