Re: [Ssh-sftp-perl-users] Handling Invalid Login Credentials
Brought to you by:
dbrobins
|
From: Rodney R. <rri...@gm...> - 2009-09-01 22:57:33
|
Perhaps an eval() with $@ would work for your scenario?
On 9/1/09, Leon Kowalski <leo...@ya...> wrote:
> 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.
>
>
>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus
> on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now. http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Ssh-sftp-perl-users mailing list
> Ssh...@li...
> https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users
>
--
Sent from my mobile device
|