summaryrefslogtreecommitdiff
path: root/dev-perl/Net-Telnet-Cisco/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
commit8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch)
tree7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /dev-perl/Net-Telnet-Cisco/files
parent30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff)
gentoo resync : 14.07.2018
Diffstat (limited to 'dev-perl/Net-Telnet-Cisco/files')
-rw-r--r--dev-perl/Net-Telnet-Cisco/files/1.10-warning.patch15
-rw-r--r--dev-perl/Net-Telnet-Cisco/files/Net-Telnet-Cisco-1.11-no-interactive-test.patch125
2 files changed, 140 insertions, 0 deletions
diff --git a/dev-perl/Net-Telnet-Cisco/files/1.10-warning.patch b/dev-perl/Net-Telnet-Cisco/files/1.10-warning.patch
new file mode 100644
index 000000000000..1ec11726ce1c
--- /dev/null
+++ b/dev-perl/Net-Telnet-Cisco/files/1.10-warning.patch
@@ -0,0 +1,15 @@
+https://bugs.gentoo.org/show_bug.cgi?id=192808
+http://rt.cpan.org/Public/Bug/Display.html?id=7796
+
+diff -ru Net-Telnet-Cisco-1.10/Cisco.pm Net-Telnet-Cisco-1.10/Cisco.pm
+--- Net-Telnet-Cisco-1.10/Cisco.pm 2002-06-18 19:17:03.000000000 +0200
++++ Net-Telnet-Cisco-1.10/Cisco.pm 2008-05-08 20:59:09.000000000 +0200
+@@ -753,7 +753,7 @@
+ 1 while s/[^\cH\c?][\cH\c?]//mg; # ^H ^?
+ s/^.*\cU//mg; # ^U
+
+- return wantarray ? split /$/mg, $_ : $_; # ORS instead?
++ return wantarray ? split /$/m, $_ : $_; # ORS instead?
+ }
+
+ # Lifted from Net::Telnet en toto
diff --git a/dev-perl/Net-Telnet-Cisco/files/Net-Telnet-Cisco-1.11-no-interactive-test.patch b/dev-perl/Net-Telnet-Cisco/files/Net-Telnet-Cisco-1.11-no-interactive-test.patch
new file mode 100644
index 000000000000..7ab7b2ad20ab
--- /dev/null
+++ b/dev-perl/Net-Telnet-Cisco/files/Net-Telnet-Cisco-1.11-no-interactive-test.patch
@@ -0,0 +1,125 @@
+From 60d93af35887e53677be5a0f95591489c2683c73 Mon Sep 17 00:00:00 2001
+From: Kent Fredric <kentnl@gentoo.org>
+Date: Wed, 13 Dec 2017 18:42:56 +1300
+Subject: Remove test interactivity
+
+Pass configuration by enviroment variables and don't prompt.
+---
+ test.pl | 82 ++++++++++++++++-------------------------------------------------
+ 1 file changed, 20 insertions(+), 62 deletions(-)
+
+diff --git a/test.pl b/test.pl
+index 369bc30..e9f7ae2 100644
+--- a/test.pl
++++ b/test.pl
+@@ -5,14 +5,8 @@
+
+ use Test::More tests => 32;
+ #use Test::More qw/no_plan/;
+-use ExtUtils::MakeMaker qw/prompt/;
+ use Carp;
+ use Cwd;
+-my $HAVE_Term_ReadKey = 0;
+-eval "use Term::ReadKey";
+-if(!$@) {
+- $HAVE_Term_ReadKey = 1
+-}
+
+ use vars qw/$ROUTER $PASSWD $LOGIN $S $EN_PASS $PASSCODE/;
+
+@@ -161,18 +155,9 @@ END { cleanup() };
+
+ sub cleanup {
+ return unless -f "input.log" || -f "dump.log";
+-
+- print <<EOB;
+-
+-Would you like to delete the test logs? They will contain
+-security info like your login and passwords. If you ran
+-into problems and wish to investigate, you can save them
+-and manually delete them later.
+-EOB
+-
+ my $dir = cwd();
+
+- my $ans = prompt("Delete logs", "y");
++ my $ans = "y";
+ if ($ans eq "y") {
+ print "Deleting logs in $dir...";
+ unlink "input.log" or warn "Can't delete input.log! $!";
+@@ -183,53 +168,26 @@ EOB
+ }
+ }
+
+-sub get_login {
+- print <<EOB;
+-
+-Net::Telnet::Cisco needs to log into a router to
+-perform it\'s full suite of tests. To log in, we
+-need a test router, a login, a password, an
+-optional enable password, and an optional
+-SecurID/TACACS PASSCODE.
+-
+-To skip these tests, hit "return".
+-
+-EOB
+-
+- $ROUTER = prompt("Router:", $ROUTER) or return;
+- $LOGIN = prompt("Login:", $LOGIN) or return;
+- $PASSWD = passprompt("Password:", $PASSWD) or return;
+- $EN_PASS = passprompt("Enable password [optional]:", $EN_PASS);
+- $PASSCODE = passprompt("SecurID/TACACS PASSCODE [optional]:", $PASSCODE);
++sub maskpass {
++ return 'not set' unless defined $_[0];
++ return ( '*' x ( length $_[0] ) ) . ' [masked]';
+ }
+
++sub get_login {
++ $ROUTER = $ENV{CISCO_TEST_ROUTER} or return;
++ $LOGIN = $ENV{CISCO_TEST_LOGIN} or return;
++ $PASSWD = $ENV{CISCO_TEST_PASSWORD} or return;
++ $EN_PASS = $ENV{CISCO_TEST_ENABLE_PASSWORD};
++ $PASSCODE = $ENV{CISCO_TEST_PASSCODE};
++
++ printf STDERR
++ <<EOB, $ROUTER, $LOGIN, maskpass($PASSWD), maskpass($EN_PASS), maskpass($PASSCODE);
++Using the following configuration for testing:
++ Router: %s
++ Login: %s
++ Password: %s
++ Enable Password: %s
++ SecureID/TACACS PASSCODE: %s
+
+-# Lifted from ExtUtils::MakeMaker.
+-#
+-# If the user has Term::ReadKey, we can hide any passwords
+-# they type from shoulder-surfing attacks.
+-#
+-# Args: "Question for user", "optional default answer"
+-sub passprompt ($;$) {
+- my($mess,$def)=@_;
+- $ISA_TTY = -t STDIN && (-t STDOUT || !(-f STDOUT || -c STDOUT)) ; # Pipe?
+- Carp::confess("prompt function called without an argument") unless defined $mess;
+- my $dispdef = defined $def ? "[$def] " : " ";
+- $def = defined $def ? $def : "";
+- my $ans;
+- local $|=1;
+- print "$mess $dispdef";
+- if ($ISA_TTY) {
+- if ( $Term::ReadKey::VERSION ) {
+- ReadMode( 'noecho' );
+- chomp($ans = ReadLine(0));
+- ReadMode( 'normal' );
+- print "\n";
+- } else {
+- chomp($ans = <STDIN>);
+- }
+- } else {
+- print "$def\n";
+- }
+- return ($ans ne '') ? $ans : $def;
++EOB
+ }
+--
+2.14.3
+