From owner-rancid-discuss@shrubbery.net Fri Nov 9 17:54:04 2001 Received: from guelah.shrubbery.net (guelah.shrubbery.net [198.58.5.1]) by ni.shrubbery.net (8.11.6/8.11.1) with ESMTP id fA9Hs3I28807 for ; Fri, 9 Nov 2001 17:54:03 GMT Received: from localhost (localhost [[UNIX: localhost]]) by guelah.shrubbery.net (8.11.4/8.11.1) id fA9K5aX22279 for rancid-discuss-outgoing; Fri, 9 Nov 2001 20:05:36 GMT Received: from alpha.dante.org.uk (alpha.dante.org.uk [193.63.211.19]) by guelah.shrubbery.net (8.11.4/8.11.1) with ESMTP id fA9K5Wm22275 for ; Fri, 9 Nov 2001 20:05:32 GMT Received: from moscow.dante.org.uk ([193.63.211.69]) by alpha.dante.org.uk with esmtp (Exim 3.12 #4) id 162Hu2-0002Ae-00 for rancid-discuss@shrubbery.net; Fri, 09 Nov 2001 20:05:26 +0000 Message-Id: <5.1.0.14.0.20011109195936.02e969e0@mail.dante.org.uk> X-Sender: janos@mail.dante.org.uk X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Fri, 09 Nov 2001 20:07:20 +0000 To: rancid-discuss@shrubbery.net From: Janos Mohacsi Subject: real query patch for looking glass Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Sender: owner-rancid-discuss@shrubbery.net Precedence: bulk Dear All, I made a patch against the rancid 2.2b8 for looking glass for display the real command not only the Cisco command. Would you like to integrate into the next version? Regards, Janos Mohacsi Additional section for the configuration file (lg.conf) to enable real command: # # $LG_REALCMD enable displaying the real router command also # $LG_REALCMD=1; Here is the patch: *** lg.cgi.save Fri Nov 9 15:27:53 2001 --- lg.cgi Fri Nov 9 19:45:36 2001 *************** *** 169,174 **** --- 169,177 ---- # create the page and log the transaction... sub print_results { + my($mfg) = @_; + my($cmd); + my($timestr) = strftime("%a %b %e %H:%M:%S %Y %Z", gmtime); dolog(LOG_INFO, sprintf("%s %s %s %s\n", $ENV{REMOTE_HOST}, $ENV{REMOTE_ADDR}, $ENV{REMOTE_USER}, *************** *** 181,186 **** --- 184,196 ---- # add the company image, LG_IMAGE print $LG_IMAGE; + if ($mfg =~ /foundry/i) { + $cmd = $foundryCmd{$type}; + } elsif ($mfg =~ /juniper/i) { + $cmd = $juniperCmd{$type}; + } else { + $cmd = $ciscoCmd{$type}; + } print <

Looking Glass Results - $router *************** *** 190,198 ****
Date: $timestr

! Query: $cmdDisp{$type} !
HEAD if ($arg) { print "Argument(s): $arg\n"; } print "

\n"; --- 200,209 ----
Date: $timestr

! Query: $cmdDisp{$type} HEAD + if ($LG_REALCMD) { print "Real Query: $cmd"; } + print "
"; if ($arg) { print "Argument(s): $arg\n"; } print "

\n"; *************** *** 267,273 **** ($router, $mfg) = split(':', $router_param); if (!defined($type) || !defined($router)) { $results[0] = "You must at least choose a Query and a router. Try buying a clue.\n"; ! &print_results; } # conversion of command "type" passed from lgform.cgi to the vendor's syntax. --- 278,284 ---- ($router, $mfg) = split(':', $router_param); if (!defined($type) || !defined($router)) { $results[0] = "You must at least choose a Query and a router. Try buying a clue.\n"; ! &print_results($mfg); } # conversion of command "type" passed from lgform.cgi to the vendor's syntax. *************** *** 361,373 **** if ($mfg =~ /juniper/) { if (! defined($juniperCmd{$type})) { $results[0] = "$cmdDisp{$type} not implemented for junipers. sorry.\n"; ! &print_results; } $cmd = $juniperCmd{$type}; } elsif ($mfg =~ /foundry/) { if(! defined($foundryCmd{$type})) { $results[0] = "$cmdDisp{$type} not implemented for foundrys. sorry.\n"; ! &print_results; } $cmd = $foundryCmd{$type}; } else { --- 372,384 ---- if ($mfg =~ /juniper/) { if (! defined($juniperCmd{$type})) { $results[0] = "$cmdDisp{$type} not implemented for junipers. sorry.\n"; ! &print_results($mfg); } $cmd = $juniperCmd{$type}; } elsif ($mfg =~ /foundry/) { if(! defined($foundryCmd{$type})) { $results[0] = "$cmdDisp{$type} not implemented for foundrys. sorry.\n"; ! &print_results($mfg); } $cmd = $foundryCmd{$type}; } else { *************** *** 378,387 **** if ($type eq "prefix" || $type eq "mbgp" || $type eq "route" ) { if ($arg[0] !~ /^\d+\.\d+\.\d+\.\d+$/) { $results[0] = "The IP address \"$arg[0]\" is not valid and lacking an address would over-burden our router.\n"; ! &print_results; } elsif (defined($arg[1]) && $arg[1] !~ /^\d+\.\d+\.\d+\.\d+$/) { $results[0] = "The IP netmask \"$arg[1]\" is not valid.\n"; ! &print_results; } if ($mfg =~ /juniper/i && defined($arg[1])) { $arg = $arg[0] . "/" . mask2len($arg[1]); --- 389,398 ---- if ($type eq "prefix" || $type eq "mbgp" || $type eq "route" ) { if ($arg[0] !~ /^\d+\.\d+\.\d+\.\d+$/) { $results[0] = "The IP address \"$arg[0]\" is not valid and lacking an address would over-burden our router.\n"; ! &print_results($mfg); } elsif (defined($arg[1]) && $arg[1] !~ /^\d+\.\d+\.\d+\.\d+$/) { $results[0] = "The IP netmask \"$arg[1]\" is not valid.\n"; ! &print_results($mfg); } if ($mfg =~ /juniper/i && defined($arg[1])) { $arg = $arg[0] . "/" . mask2len($arg[1]); *************** *** 390,396 **** if ($mfg =~ /juniper/) { $results[0] = "Juniper does not have a show frame-relay pvc command. ". "Use show interface.\n"; ! &print_results; } if ($arg[0] > 15 && $arg[0] < 1024) { $arg = $arg[0]; --- 401,407 ---- if ($mfg =~ /juniper/) { $results[0] = "Juniper does not have a show frame-relay pvc command. ". "Use show interface.\n"; ! &print_results($mfg); } if ($arg[0] > 15 && $arg[0] < 1024) { $arg = $arg[0]; *************** *** 428,456 **** if ($arg[0] !~ /^\d+\.\d+\.\d+\.\d+$/) { if ($arg[0] !~ /([A-Za-z0-9-]*.)*[A-Za-z0-9-]*.(com|edu|net|org)/) { $results[0] = "That argument ($arg[0]) is not valid.\n"; ! &print_results; } } $arg = $arg[0]; } elsif ($type eq "aspath" || $type eq "communitylist") { if ($arg[0] !~ /^\d+$/ || ($arg[0] < 1 && $arg[0] > 199)) { $results[0] = "That argument ($arg[0]) is not valid.\n"; ! &print_results; } $arg = $arg[0]; } elsif ($type eq "acl") { if ($arg[0] !~ /^\d+$/ || ($arg[0] < 100 && $arg[0] > 199) || ($arg[0] < 1300 && $arg[0] > 2699)) { $results[0] = "That argument ($arg[0]) is not valid.\n"; ! &print_results; } $arg = $arg[0]; # don't show the jewels ! &print_results if ($arg == 98 || $arg == 99); } elsif ($type eq "prefixlist" || $type eq "routemap") { if ($arg[0] !~ /^[0-9A-Za-z][^\s\"]*$/) { $results[0] = "That argument ($arg[0]) is not valid.\n"; ! &print_results; } $arg = $arg[0]; } elsif ($type eq "regex") { --- 439,467 ---- if ($arg[0] !~ /^\d+\.\d+\.\d+\.\d+$/) { if ($arg[0] !~ /([A-Za-z0-9-]*.)*[A-Za-z0-9-]*.(com|edu|net|org)/) { $results[0] = "That argument ($arg[0]) is not valid.\n"; ! &print_results($mfg); } } $arg = $arg[0]; } elsif ($type eq "aspath" || $type eq "communitylist") { if ($arg[0] !~ /^\d+$/ || ($arg[0] < 1 && $arg[0] > 199)) { $results[0] = "That argument ($arg[0]) is not valid.\n"; ! &print_results($mfg); } $arg = $arg[0]; } elsif ($type eq "acl") { if ($arg[0] !~ /^\d+$/ || ($arg[0] < 100 && $arg[0] > 199) || ($arg[0] < 1300 && $arg[0] > 2699)) { $results[0] = "That argument ($arg[0]) is not valid.\n"; ! &print_results($mfg); } $arg = $arg[0]; # don't show the jewels ! &print_results($mfg) if ($arg == 98 || $arg == 99); } elsif ($type eq "prefixlist" || $type eq "routemap") { if ($arg[0] !~ /^[0-9A-Za-z][^\s\"]*$/) { $results[0] = "That argument ($arg[0]) is not valid.\n"; ! &print_results($mfg); } $arg = $arg[0]; } elsif ($type eq "regex") { *************** *** 462,474 **** $arg =~ s/^\s*//; $arg =~ s/\s*$//; if ($arg !~ /^[0-9_ ^.*+?[\])\(-]*\$?$/ || $arg =~ /^\s*$/) { $results[0] = "That argument ($arg[0]) is not valid.\n"; ! &print_results; } # pathetic excuses for lookups if ($arg =~ /^[_.* ^]*(\*|1|701|1239|1280|1740|3561|5462|10303)+[_\$]*$/ || $arg =~ /^[_.* ^]*(1|701|1239|1280|1740|3561|5462|10303)+[_ .]*[\[*.]/) { $results[0] = "Get real. Such a query has potential to over-burden our router.\nLook that up on your own router.\n"; ! &print_results; } if ($mfg =~ /juniper/) { $arg =~ s/_/ /g; --- 473,485 ---- $arg =~ s/^\s*//; $arg =~ s/\s*$//; if ($arg !~ /^[0-9_ ^.*+?[\])\(-]*\$?$/ || $arg =~ /^\s*$/) { $results[0] = "That argument ($arg[0]) is not valid.\n"; ! &print_results($mfg); } # pathetic excuses for lookups if ($arg =~ /^[_.* ^]*(\*|1|701|1239|1280|1740|3561|5462|10303)+[_\$]*$/ || $arg =~ /^[_.* ^]*(1|701|1239|1280|1740|3561|5462|10303)+[_ .]*[\[*.]/) { $results[0] = "Get real. Such a query has potential to over-burden our router.\nLook that up on your own router.\n"; ! &print_results($mfg); } if ($mfg =~ /juniper/) { $arg =~ s/_/ /g; *************** *** 486,492 **** if ($arg[0] !~ /^\d+\.\d+\.\d+\.\d+$/) { if ($arg[0] !~ /([A-Za-z0-9-]*.)*[A-Za-z0-9-]*.(com|edu|net|org)/) { $results[0] = "That argument ($arg[0]) is not valid.\n"; ! &print_results; } } $arg = $arg[0]; --- 497,503 ---- if ($arg[0] !~ /^\d+\.\d+\.\d+\.\d+$/) { if ($arg[0] !~ /([A-Za-z0-9-]*.)*[A-Za-z0-9-]*.(com|edu|net|org)/) { $results[0] = "That argument ($arg[0]) is not valid.\n"; ! &print_results($mfg); } } $arg = $arg[0]; *************** *** 523,529 **** if ($arg[0] !~ /^\d+\.\d+\.\d+\.\d+$/) { if ($arg[0] !~ /([A-Za-z0-9-]*.)*[A-Za-z0-9-]*.(com|edu|net|org)/) { $results[0] = "That argument ($arg[0]) is not valid.\n"; ! &print_results; } } $arg = $arg[0]; --- 534,540 ---- if ($arg[0] !~ /^\d+\.\d+\.\d+\.\d+$/) { if ($arg[0] !~ /([A-Za-z0-9-]*.)*[A-Za-z0-9-]*.(com|edu|net|org)/) { $results[0] = "That argument ($arg[0]) is not valid.\n"; ! &print_results($mfg); } } $arg = $arg[0]; *************** *** 576,582 **** while () { push(@results, $_); } close CACHE ; $seconds = $dtime; ! &print_results ; } } --- 587,593 ---- while () { push(@results, $_); } close CACHE ; $seconds = $dtime; ! &print_results($mfg) ; } } *************** *** 590,599 **** } else { @results = &DoRsh($router, $mfg, $cmd, $arg); } ! &print_results ; } # end dampened-paths/flap-statistics @results = &DoRsh($router, $mfg, $cmd, $arg); ! &print_results ; exit ; --- 601,610 ---- } else { @results = &DoRsh($router, $mfg, $cmd, $arg); } ! &print_results($mfg) ; } # end dampened-paths/flap-statistics @results = &DoRsh($router, $mfg, $cmd, $arg); ! &print_results($mfg) ; exit ; From owner-rancid-discuss@shrubbery.net Wed Nov 14 07:50:51 2001 Received: from guelah.shrubbery.net (guelah.shrubbery.net [198.58.5.1]) by ni.shrubbery.net (8.11.6/8.11.1) with ESMTP id fAE7ooI28213 for ; Wed, 14 Nov 2001 07:50:50 GMT Received: by guelah.shrubbery.net (8.11.4/8.11.1) id fAE7nR918601 for rancid-discuss-outgoing; Wed, 14 Nov 2001 07:49:27 GMT Received: (from heas@localhost) by guelah.shrubbery.net (8.11.4/8.11.1) id fAE7nMB18596; Wed, 14 Nov 2001 07:49:22 GMT Date: Wed, 14 Nov 2001 07:49:22 +0000 From: john heasley To: Janos Mohacsi Cc: rancid-discuss@shrubbery.net Subject: Re: real query patch for looking glass Message-ID: <20011114074922.A18387@shrubbery.net> References: <5.1.0.14.0.20011109195936.02e969e0@mail.dante.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <5.1.0.14.0.20011109195936.02e969e0@mail.dante.org.uk>; from Janos.Mohacsi@dante.org.uk on Fri, Nov 09, 2001 at 08:07:20PM +0000 X-note: live free, or die! X-homer: mmmm, forbidden doughnut. Sender: owner-rancid-discuss@shrubbery.net Precedence: bulk Fri, Nov 09, 2001 at 08:07:20PM +0000, Janos Mohacsi: > Dear All, > I made a patch against the rancid 2.2b8 for looking glass for display the > real command not only the Cisco command. > > Would you like to integrate into the next version? > Regards, > Janos Mohacsi > > > Additional section for the configuration file (lg.conf) to enable real command: > > # > # $LG_REALCMD enable displaying the real router command also > # > $LG_REALCMD=1; > merged. it seemed like a better format than the generic command, so i didnt merge the LG_REALCMD switch. thanks. From owner-rancid-discuss@shrubbery.net Wed Nov 14 18:24:14 2001 Received: from guelah.shrubbery.net (guelah.shrubbery.net [198.58.5.1]) by ni.shrubbery.net (8.11.6/8.11.1) with ESMTP id fAEIOEI13677 for ; Wed, 14 Nov 2001 18:24:14 GMT Received: by guelah.shrubbery.net (8.11.4/8.11.1) id fAEINf801967 for rancid-discuss-outgoing; Wed, 14 Nov 2001 18:23:41 GMT Received: (from heas@localhost) by guelah.shrubbery.net (8.11.4/8.11.1) id fAEINYw01962; Wed, 14 Nov 2001 18:23:34 GMT Date: Wed, 14 Nov 2001 10:23:34 -0800 From: john heasley To: Andrew Partan Cc: Dylan Hall , rancid-discuss@shrubbery.net Subject: Re: Problems with RE matching in .cloginrc Message-ID: <20011114102334.K22256@shrubbery.net> References: <3BCB6A58.7DC11847@tsnz.net> <20011015203114.B23441@shrubbery.net> <3BCBC638.4B5B5BE@tsnz.net> <20011016230908.D12784@partan.com> <20011018183453.K2307@shrubbery.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20011018183453.K2307@shrubbery.net>; from heas@shrubbery.net on Thu, Oct 18, 2001 at 06:34:53PM -0700 X-note: live free, or die! X-homer: mmmm, forbidden doughnut. Sender: owner-rancid-discuss@shrubbery.net Precedence: bulk Thu, Oct 18, 2001 at 06:34:53PM -0700, john heasley: > Tue, Oct 16, 2001 at 11:09:08PM -0400, Andrew Partan: > > On Tue, Oct 16, 2001 at 06:31:36PM +1300, Dylan Hall wrote: > > > The workaround is to remove the check for $loginname@$router from > > > jlogin. Can you suggest a more elegant fix? > > > > Hmm; I think that jlogin is the only *login that has this login@router > > stuff. I think that this bit should be removed. Is anyone using it? > > --asp@partan.com (Andrew Partan) > > i put that in there a _long_ time ago. i can't remember why and (grumble) > the cvs note is empty, but suspect it was a stepping stone. however, i > see how it might be useful for a passphrase, granted "user@host" probably > isnt the right thing. comments? > > otherwise, it should go. if i havent bunged it up... Index: jlogin.in =================================================================== RCS file: /home/rancid/.CVS/rancid/bin/jlogin.in,v retrieving revision 1.26 diff -c -r1.26 jlogin.in *** jlogin.in 2001/11/02 22:05:01 1.26 --- jlogin.in 2001/11/14 18:22:17 *************** *** 452,468 **** # command line passwd set passwd $userpasswd } else { ! set userpswd [lindex [find userpassword $loginname@$router] 0] ! if { "$userpswd" == "" } { ! set userpswd [lindex [find userpassword $router] 0] ! } ! if { "$userpswd" == "" } { ! set passwd [lindex [find password $loginname@$router] 0] if { "$passwd" == "" } { ! set passwd [lindex [find password $router] 0] } - } else { - set passwd $userpswd } } --- 452,464 ---- # command line passwd set passwd $userpasswd } else { ! set passwd [lindex [find userpassword $loginname] 0] ! if { "$passwd" == "" } { ! set passwd [lindex [find password $router] 0] if { "$passwd" == "" } { ! send_user "Error: no password for $router in $password_file.\n" ! continue } } } From owner-rancid-discuss@shrubbery.net Thu Nov 15 05:59:20 2001 Received: from guelah.shrubbery.net (guelah.shrubbery.net [198.58.5.1]) by ni.shrubbery.net (8.11.6/8.11.1) with ESMTP id fAF5xKI28145 for ; Thu, 15 Nov 2001 05:59:20 GMT Received: by guelah.shrubbery.net (8.11.4/8.11.1) id fAF5wae07570 for rancid-discuss-outgoing; Thu, 15 Nov 2001 05:58:36 GMT Received: (from heas@localhost) by guelah.shrubbery.net (8.11.4/8.11.1) id fAF5wXf07564; Thu, 15 Nov 2001 05:58:33 GMT Date: Thu, 15 Nov 2001 05:58:32 +0000 From: "'john heasley'" To: Alex Bochannek Cc: rancid-discuss@guelah.shrubbery.net Subject: Re: Proposed Extreme changes. Message-ID: <20011115055832.A7510@shrubbery.net> References: <65988049D870C042BD59CF516556134A14D2CE@sfoexh01.yipes.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <65988049D870C042BD59CF516556134A14D2CE@sfoexh01.yipes.com>; from ABochannek@yipes.com on Fri, Oct 19, 2001 at 10:26:18AM -0700 X-note: live free, or die! X-homer: mmmm, forbidden doughnut. Sender: owner-rancid-discuss@shrubbery.net Precedence: bulk Fri, Oct 19, 2001 at 10:26:18AM -0700, Alex Bochannek: > One more diff: > > bash-2.03$ diff -c clogin clogin.new > *** clogin Fri Oct 19 10:20:07 2001 > --- clogin.new Fri Oct 19 10:21:21 2001 > *************** > *** 491,497 **** > exp_continue } > -re "\[^\r\n]*Press to cont\[^\r\n]*" { send " " > expect { > ! -re "\[\r\n]*\r\r" > {} > } > exp_continue > } > --- 491,499 ---- > exp_continue } > -re "\[^\r\n]*Press to cont\[^\r\n]*" { send " " > expect { > ! # gag, 2 more > prompts > ! -re "\[\r\n]*\r" {} > ! -re "\[^\r\n]*Press > to cont\[^\r\n]*" { send " "; exp_continue } > } > exp_continue > } other than collection not working when the config is unsaved, are folks having trouble with collection on extremes? the 3 three i have access to have not exhibited any problems (caused by rancid anyway). i havent seen this double more prompt oddness. does the following deal with it (more cleanly?)? Index: clogin.in =================================================================== RCS file: /home/rancid/.CVS/rancid/bin/clogin.in,v retrieving revision 1.41 diff -c -r1.41 clogin.in *** clogin.in 2001/11/02 23:11:39 1.41 --- clogin.in 2001/11/15 05:47:53 *************** *** 489,498 **** exp_continue } -re "\[\n\r]+" { send_user -- "$expect_out(buffer)" exp_continue } ! -re "\[^\r\n]*Press to cont\[^\r\n]*" { send " " ! expect { ! -re "\[\r\n]*\r\r" {} ! } exp_continue } -re "^<-+ More -+>\[^\n\r]*" { send " " --- 489,496 ---- exp_continue } -re "\[\n\r]+" { send_user -- "$expect_out(buffer)" exp_continue } ! -re "\[^\r\n]*Press to cont\[^\r\n]*" { ! send " " exp_continue } -re "^<-+ More -+>\[^\n\r]*" { send " " i feel for anyone burdened by these beasts. From owner-rancid-discuss@shrubbery.net Wed Nov 21 17:10:39 2001 Received: from guelah.shrubbery.net (guelah.shrubbery.net [198.58.5.1]) by ni.shrubbery.net (8.11.6/8.11.1) with ESMTP id fALHAdI16631 for ; Wed, 21 Nov 2001 17:10:39 GMT Received: by guelah.shrubbery.net (8.11.4/8.11.1) id fALH8rd14850 for rancid-discuss-outgoing; Wed, 21 Nov 2001 17:08:53 GMT Received: by guelah.shrubbery.net (8.11.4/8.11.1) id fALH8p714845 for rancid-discuss@shrubbery.net; Wed, 21 Nov 2001 17:08:51 GMT Received: from tigers.cableinet.net (tigers.cableinet.net [193.38.113.20]) by guelah.shrubbery.net (8.11.4/8.11.1) with SMTP id fALCj5m13540 for ; Wed, 21 Nov 2001 12:45:05 GMT Received: (qmail 7514 invoked from network); 21 Nov 2001 12:45:23 -0000 Received: from unknown (HELO mirage) (194.117.142.109) by tigers.cableinet.net with SMTP; 21 Nov 2001 12:45:23 -0000 Message-ID: <016201c1728a$53f36d40$6d8e75c2@mirage> From: "Mark Cooper" To: References: <20011012111844.H13370@shrubbery.net> Subject: Router banners Date: Wed, 21 Nov 2001 12:44:58 -0000 Organization: Telewest Communications Ltd MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_015F_01C1728A.53CD47A0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 Sender: owner-rancid-discuss@shrubbery.net Precedence: bulk This is a multi-part message in MIME format. ------=_NextPart_000_015F_01C1728A.53CD47A0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit I have come across a problem with RANCID when trying to login to routers with a banner. Two real world examples are attached ( ahhhh pretty ;) ) It looks like the ?login script thinks it's already logged in due to the presence of the > in both banners. ------=_NextPart_000_015F_01C1728A.53CD47A0 Content-Type: text/plain; name="cisco_banner.txt" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="cisco_banner.txt" spawn telnet cisco.router.ip Trying cisco.router.ip... Connected to cisco.router.ip. Escape character is '^]'. CC ----- No Unauthorised Access ----- Welcome to the blah blah Router __ _-==-=_,-. /--`' \_@-@.--< `--'\ \ <___/. tiggers if rabbit \ \\ " / can do Was bigger >=\\_/`< anything! and fatter ____ /= | \_|/ and stronger, _' `\ _/=== \___/ or bigger `___/ //\./=/~\====\ than tigger, \ // / | ===: if tigger was smaller, | ._/_,__|_ ==: __ then tigger's bad habit \/ \\ \\`--| / \\ of bouncing at rabbit | _ \\: /==:-\ would matter no longer, `.__' `-____/ |--|==: if rabbit \ \ ===\ :==:`-' was taller. _> \ ===\ /==/ /==\ | ===\__/--/ <=== \ / ====\ \\/ (one of pooh's songs) _`-- \/ === \/--' | \ ==== | -`------/`--' / \___-' User Access Verification Username: enable % Login invalid ------=_NextPart_000_015F_01C1728A.53CD47A0 Content-Type: text/plain; name="nortel_banner.txt" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="nortel_banner.txt" spawn telnet nortel.router.ip Trying nortel.router.ip... Connected to nortel.router.ip. Escape character is '^]'. ///, //// \ /, / >. \ /, _/ /. \_ /_/ /. \__/_ < /<<< \_\_ /,)^>>_._ \ (/ \\ /\\\ // ```` Welcome to the Backbone Technician Interface and its Licensors. Copyright 1992,1993,1994,1995,1996,1997,1998,1999,2000,2001. All rights reserved. Login: logout Password: ------=_NextPart_000_015F_01C1728A.53CD47A0-- From owner-rancid-discuss@shrubbery.net Wed Nov 21 17:15:42 2001 Received: from guelah.shrubbery.net (guelah.shrubbery.net [198.58.5.1]) by ni.shrubbery.net (8.11.6/8.11.1) with ESMTP id fALHFgI16682 for ; Wed, 21 Nov 2001 17:15:42 GMT Received: by guelah.shrubbery.net (8.11.4/8.11.1) id fALHFja14936 for rancid-discuss-outgoing; Wed, 21 Nov 2001 17:15:45 GMT Received: from tower.partan.com (tower.partan.com [198.6.255.248]) by guelah.shrubbery.net (8.11.4/8.11.1) with ESMTP id fALHFgm14932 for ; Wed, 21 Nov 2001 17:15:42 GMT Received: (from asp@localhost) by tower.partan.com (8.9.3/8.9.3) id MAA29362; Wed, 21 Nov 2001 12:15:34 -0500 (EST) Date: Wed, 21 Nov 2001 12:15:34 -0500 From: Andrew Partan To: Mark Cooper Cc: rancid-discuss@shrubbery.net Subject: Re: Router banners Message-ID: <20011121121534.A29307@partan.com> References: <20011012111844.H13370@shrubbery.net> <016201c1728a$53f36d40$6d8e75c2@mirage> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <016201c1728a$53f36d40$6d8e75c2@mirage>; from mcooper@blueyonder.co.uk on Wed, Nov 21, 2001 at 12:44:58PM -0000 Sender: owner-rancid-discuss@shrubbery.net Precedence: bulk On Wed, Nov 21, 2001 at 12:44:58PM -0000, Mark Cooper wrote: > It looks like the ?login script thinks it's already logged in due > to the presence of the > in both banners. Yup. We had to ban some characters in banners (and other motds) - no > or #. The trickest part about clogin (et al) is recognizing the prompt correctly. [expect turns out to be a horrible language for writting anything complicated in.] Looks like this needs to be added to the FAQ. --asp From owner-rancid-discuss@shrubbery.net Thu Nov 22 13:26:43 2001 Received: from guelah.shrubbery.net (guelah.shrubbery.net [198.58.5.1]) by ni.shrubbery.net (8.11.6/8.11.1) with ESMTP id fAMDQhI03885 for ; Thu, 22 Nov 2001 13:26:43 GMT Received: by guelah.shrubbery.net (8.11.4/8.11.1) id fAMDQJM26419 for rancid-discuss-outgoing; Thu, 22 Nov 2001 13:26:19 GMT Received: from tigers.cableinet.net (tigers.cableinet.net [193.38.113.20]) by guelah.shrubbery.net (8.11.4/8.11.1) with SMTP id fAMDQBm26410 for ; Thu, 22 Nov 2001 13:26:15 GMT Received: (qmail 5104 invoked from network); 22 Nov 2001 13:26:35 -0000 Received: from unknown (HELO mirage) (194.117.142.109) by tigers.cableinet.net with SMTP; 22 Nov 2001 13:26:35 -0000 Message-ID: <01df01c17359$404f31a0$6d8e75c2@mirage> From: "Mark Cooper" To: Cc: Subject: bug in brancid handling of prompts Date: Thu, 22 Nov 2001 13:26:11 -0000 Organization: Telewest Communications Ltd MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 Sender: owner-rancid-discuss@shrubbery.net Precedence: bulk I have just come across a bug in the handling of the prompt in brancid. It occurs when handling prompts with 'special' characters in them such as [UK-ISP1]> I found that rrancid already had code to handle it so the following diff against brancid should fix the problem. 172a173 > $prompt =~ s/([][])/\\$1/g; 235c236,239 < if (!defined($prompt)) {$prompt = ($_ =~ /^([^>]+>)/)[0]; } --- > if (!defined($prompt)) { > $prompt = ($_ =~ /^([^>]+>)/)[0]; > $prompt =~ s/([][])/\\$1/g; > } HTH Mark From owner-rancid-discuss@shrubbery.net Fri Nov 23 16:40:57 2001 Received: from guelah.shrubbery.net (guelah.shrubbery.net [198.58.5.1]) by ni.shrubbery.net (8.11.6/8.11.1) with ESMTP id fANGevI20799 for ; Fri, 23 Nov 2001 16:40:57 GMT Received: by guelah.shrubbery.net (8.11.4/8.11.1) id fANGeAs02706 for rancid-discuss-outgoing; Fri, 23 Nov 2001 16:40:10 GMT Received: from tigers.cableinet.net (tigers.cableinet.net [193.38.113.20]) by guelah.shrubbery.net (8.11.4/8.11.1) with SMTP id fANGe5m02701 for ; Fri, 23 Nov 2001 16:40:06 GMT Received: (qmail 11753 invoked from network); 23 Nov 2001 16:40:25 -0000 Received: from unknown (HELO mirage) (194.117.142.109) by tigers.cableinet.net with SMTP; 23 Nov 2001 16:40:25 -0000 Message-ID: <00b701c1743d$7cfb5e00$6d8e75c2@mirage> From: "Mark Cooper" To: Cc: , Subject: fix for special character handling Date: Fri, 23 Nov 2001 16:39:57 -0000 Organization: Telewest Communications Ltd MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 Sender: owner-rancid-discuss@shrubbery.net Precedence: bulk I have run into a few problems with 'special' characters within router banners and/or prompts. The following diff against clogin should fix the banner containing expected prompt character and also any special characters in the prompt. 376c376,382 < -re "$p_prompt" { send "$userpswd\r" } --- > -re "$p_prompt" { send "$userpswd\r" > expect { > eof { send_user "\nError: Couldn't login\n"; wait; return 1 } > -re "$u_prompt" { send "$user\r" } > "$prompt" { set in_proc 0; return 0 } > } > } 394d399 < "$prompt" { break; } 449c454,455 < regsub -all "\[)(]" $prompt {\\&} reprompt --- > regsub -all {\[} $prompt {\\&} reprompt > regsub -all {\]} $reprompt {\\&} reprompt The following diff against rancid should fix handling of special characters in the prompt. 1131c1131,1134 < if (!defined($prompt)) {$prompt = ($_ =~ /^([^#]+#)/)[0]; } --- > if (!defined($prompt)) { > $prompt = ($_ =~ /^([^#]+#)/)[0]; > $prompt =~ s/([][])/\\$1/g; > } The following diff against blogin should fix problems with there being a banner on a nortel. 367c367,373 < -re "$p_prompt" { send "$userpswd\r" } --- > -re "$p_prompt" { send "$userpswd\r" > expect { > eof { send_user "\nError: Couldn't login\n"; wait; return 1 } > -re "$u_prompt" { send "$user\r" } > "$prompt" { set in_proc 0; return 0 } > } > } 385d390 < "$prompt" { break; } BTW, all these diffs are against 2.2b7 with Mordechai T. Abzug brancid patches installed. I obviously really need to provide these as full context diffs against 2.2b8....d'oh HTH Mark From owner-rancid-discuss@shrubbery.net Wed Nov 28 11:12:51 2001 Received: from guelah.shrubbery.net (guelah.shrubbery.net [198.58.5.1]) by ni.shrubbery.net (8.11.6/8.11.1) with ESMTP id fASBCpm04577 for ; Wed, 28 Nov 2001 11:12:51 GMT Received: by guelah.shrubbery.net (8.11.4/8.11.1) id fASBBRF02520 for rancid-discuss-outgoing; Wed, 28 Nov 2001 11:11:27 GMT Received: from tigers.cableinet.net (tigers.cableinet.net [193.38.113.20]) by guelah.shrubbery.net (8.11.4/8.11.1) with SMTP id fASBBKi02515 for ; Wed, 28 Nov 2001 11:11:24 GMT Received: (qmail 17579 invoked from network); 28 Nov 2001 11:11:43 -0000 Received: from unknown (HELO mirage) (194.117.142.109) by tigers.cableinet.net with SMTP; 28 Nov 2001 11:11:43 -0000 Message-ID: <012401c177fd$6347b6c0$6d8e75c2@mirage> From: "Mark Cooper" To: Cc: Subject: brancid patch for Bay/Nortel GUI lock mechanism Date: Wed, 28 Nov 2001 11:11:11 -0000 Organization: Telewest Communications Ltd MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 Sender: owner-rancid-discuss@shrubbery.net Precedence: bulk The following patch removes the lock-address line from the Bay/Nortel configs which is used by Nortel's proprietary GUI to manage their routers. HTH Mark *** brancid Thu Nov 22 14:17:33 2001 --- brancid.patch Wed Nov 28 10:18:09 2001 *************** *** 142,147 **** --- 142,148 ---- next if (/^Reading configuration information/); next if (/^\# *uptime +\d+\s*$/); next if (/^Can\'t find object or class named \"\-all\"\s*$/); + next if (/lock-address .*$/); s{^(\# *description \{.* )Created on .*(\}\s*)$}{$1$2}; if (/community label /) { if (defined($ENV{'NOCOMMSTR'})) { From owner-rancid-discuss@shrubbery.net Thu Nov 29 18:31:19 2001 Received: from guelah.shrubbery.net (guelah.shrubbery.net [198.58.5.1]) by ni.shrubbery.net (8.11.6/8.11.1) with ESMTP id fATIVJm22997 for ; Thu, 29 Nov 2001 18:31:19 GMT Received: by guelah.shrubbery.net (8.11.4/8.11.1) id fATIUAg12783 for rancid-discuss-outgoing; Thu, 29 Nov 2001 18:30:10 GMT Received: from netservice.netcom.utah.edu (netservice.netcom.utah.edu [155.99.46.16]) by guelah.shrubbery.net (8.11.4/8.11.1) with ESMTP id fATIU1i12776; Thu, 29 Nov 2001 18:30:01 GMT X-MimeOLE: Produced By Microsoft Exchange V6.0.4712.0 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Subject: RE: fix for special character handling Date: Thu, 29 Nov 2001 11:28:58 -0700 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: fix for special character handling Thread-Index: AcF0PfpfeZfCAvClQ5mrz+xGVyxNZgExbvNw From: "Dave Packham" To: "Mark Cooper" , Cc: , Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by guelah.shrubbery.net id fATIU2i12777 Sender: owner-rancid-discuss@shrubbery.net Precedence: bulk My router prompt is set to "TheNet>" and clogin hangs. Do I need to apply the patches in the previous postings? Dave Packham University of Utah Netcom Manager Network Engineering, Advanced Projects ISO Office member DSO   c. 718-7777@801 w. 585.6043@801 Dave.Packham@Utah.edu ICQ#:45818442 Current ICQ status: 45818442@pager.icq.com SMS: (Send an SMS message to my ICQ): +278314245818442 More ways to contact me: http://wwp.icq.com/45818442   http://www.netcom.utah.edu/network/engineering.html http://www.map.utah.edu/umaplink/0893.html   -----Original Message----- From: Mark Cooper [mailto:mcooper@blueyonder.co.uk] Sent: Friday, November 23, 2001 9:40 AM To: rancid-discuss@shrubbery.net Cc: rancid@shrubbery.net; asp@partan.com Subject: fix for special character handling I have run into a few problems with 'special' characters within router banners and/or prompts. The following diff against clogin should fix the banner containing expected prompt character and also any special characters in the prompt. 376c376,382 < -re "$p_prompt" { send "$userpswd\r" } --- > -re "$p_prompt" { send "$userpswd\r" > expect { > eof { send_user "\nError: Couldn't login\n"; wait; return 1 } > -re "$u_prompt" { send "$user\r" } > "$prompt" { set in_proc 0; return 0 } > } > } 394d399 < "$prompt" { break; } 449c454,455 < regsub -all "\[)(]" $prompt {\\&} reprompt --- > regsub -all {\[} $prompt {\\&} reprompt > regsub -all {\]} $reprompt {\\&} reprompt The following diff against rancid should fix handling of special characters in the prompt. 1131c1131,1134 < if (!defined($prompt)) {$prompt = ($_ =~ /^([^#]+#)/)[0]; } --- > if (!defined($prompt)) { > $prompt = ($_ =~ /^([^#]+#)/)[0]; > $prompt =~ s/([][])/\\$1/g; > } The following diff against blogin should fix problems with there being a banner on a nortel. 367c367,373 < -re "$p_prompt" { send "$userpswd\r" } --- > -re "$p_prompt" { send "$userpswd\r" > expect { > eof { send_user "\nError: Couldn't login\n"; wait; return 1 } > -re "$u_prompt" { send "$user\r" } > "$prompt" { set in_proc 0; return 0 } > } > } 385d390 < "$prompt" { break; } BTW, all these diffs are against 2.2b7 with Mordechai T. Abzug brancid patches installed. I obviously really need to provide these as full context diffs against 2.2b8....d'oh HTH Mark From owner-rancid-discuss@shrubbery.net Fri Nov 30 09:40:09 2001 Received: from guelah.shrubbery.net (guelah.shrubbery.net [198.58.5.1]) by ni.shrubbery.net (8.11.6/8.11.1) with ESMTP id fAU9e9m07861 for ; Fri, 30 Nov 2001 09:40:09 GMT Received: by guelah.shrubbery.net (8.11.4/8.11.1) id fAU9dTs25629 for rancid-discuss-outgoing; Fri, 30 Nov 2001 09:39:29 GMT Received: from tigers.cableinet.net (tigers.cableinet.net [193.38.113.20]) by guelah.shrubbery.net (8.11.4/8.11.1) with SMTP id fAU9dPi25625 for ; Fri, 30 Nov 2001 09:39:26 GMT Received: (qmail 20624 invoked from network); 30 Nov 2001 09:39:56 -0000 Received: from unknown (HELO mirage) (194.117.142.109) by tigers.cableinet.net with SMTP; 30 Nov 2001 09:39:56 -0000 Message-ID: <00b101c17982$e508e7c0$6d8e75c2@mirage> From: "Mark Cooper" To: "Dave Packham" References: Subject: Re: fix for special character handling Date: Fri, 30 Nov 2001 09:39:23 -0000 Organization: Telewest Communications Ltd MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 Sender: owner-rancid-discuss@shrubbery.net Precedence: bulk A login prompt such as TheNet> shouldn't cause any problems as it doesn't contain characters like square brackets ( [ or ] ) or a minus sign. If you send me a cut and paste of what happens when you run something like:- clogin -c "show ver" put_your_ciscos_ip_here and what platform you are running rancid on, I'll take a look. HTH Mark ----- Original Message ----- From: "Dave Packham" To: "Mark Cooper" ; Cc: ; Sent: Thursday, November 29, 2001 6:28 PM Subject: RE: fix for special character handling > My router prompt is set to "TheNet>" and clogin hangs. Do I need to > apply the patches in the previous postings? > > Dave Packham > University of Utah Netcom > Manager Network Engineering, > Advanced Projects > ISO Office member > DSO > > c. 718-7777@801 > w. 585.6043@801 > Dave.Packham@Utah.edu > > ICQ#:45818442 > Current ICQ status: > > 45818442@pager.icq.com > SMS: (Send an SMS message to my ICQ): +278314245818442 > More ways to contact me: http://wwp.icq.com/45818442 > > http://www.netcom.utah.edu/network/engineering.html > http://www.map.utah.edu/umaplink/0893.html > > > > > -----Original Message----- > From: Mark Cooper [mailto:mcooper@blueyonder.co.uk] > Sent: Friday, November 23, 2001 9:40 AM > To: rancid-discuss@shrubbery.net > Cc: rancid@shrubbery.net; asp@partan.com > Subject: fix for special character handling > > I have run into a few problems with 'special' characters within router > banners and/or > prompts. > > The following diff against clogin should fix the banner containing > expected prompt > character > and also any special characters in the prompt. >