Package: libnet-telnet-cisco-perl
Version: 1.10-5
Severity: normal
Tags: upstream patch

When using errmode == return and calling cmd() in list context and an error is
detected during command processing, Net::Telnet:::Cisco will return

        $VAR1 = [ undef ];

instead of an empty list

        $VAR1 = [];

However perldoc Net::Telnet states

        When mode is "return" then the method generating the error places an
        error message in the object and returns an undefined value in a scalar
        context and an empty list in list context.  The error message may be
        obtained using "errmsg()".

And perldoc Net::Telnet::Cisco states:

        Before you use Net::Telnet::Cisco, you should have a good understanding
        of Net::Telnet, so read it's documentation first, and then come back
        here to see the improvements.

This patch seems to fix the problem:

--- /tmp/Cisco.pm       2013-08-06 15:01:51.000000000 +0200
+++ /usr/share/perl5/Net/Telnet/Cisco.pm        2013-08-06 14:54:50.000000000 
+0200
@@ -202,6 +202,7 @@
 
        if ($self->find_errors(@out) ) {
            $ok = 0;
+           @out = ();
            last;
        }


-- System Information:
Debian Release: 6.0.7
  APT prefers oldstable
  APT policy: (500, 'oldstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-5-xen-686 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to