From 381d322caf5928732f3d478d80e70acfccd67f99 Mon Sep 17 00:00:00 2001 From: Tar Committer Date: Sun, 14 Mar 2004 17:00:09 +0000 Subject: Imported from rancid-2.3.tar.gz. --- bin/lg.cgi.in | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'bin/lg.cgi.in') diff --git a/bin/lg.cgi.in b/bin/lg.cgi.in index ad08c68..8b09847 100644 --- a/bin/lg.cgi.in +++ b/bin/lg.cgi.in @@ -1,6 +1,6 @@ #! @PERLV_PATH@ ## -## $Id: lg.cgi.in,v 1.47 2004/01/11 03:49:13 heas Exp $ +## $Id: lg.cgi.in,v 1.50 2004/03/10 23:01:28 heas Exp $ ## ## Copyright (C) 1997-2004 by Terrapin Communications, Inc. ## All rights reserved. @@ -27,8 +27,8 @@ # vars: query, router, args BEGIN { -$me = $0; -$me =~ s/.*\/(\S+)$/$1/; + $me = $0; + $me =~ s/.*\/(\S+)$/$1/; } use CGI qw/:standard escapeHTML/; @@ -38,6 +38,7 @@ use LockFile::Simple qw(lock trylock unlock); my($BASEDIR) = "@prefix@"; my($SYSCONFDIR) = "@sysconfdir@"; +my($LOCALSTATEDIR) = "@localstatedir@"; my($pingcmd) = "@LG_PING_CMD@"; my($query, $max_time_diff, $cache_dir, $cloginrc, @results); @@ -134,23 +135,24 @@ sub readrouters # if the router.db file does not exist, try to compile the list from # the rancid group router.db files. local(*DIR); - if (! opendir(DIR, $BASEDIR)) { - dolog(LOG_ERR, "ERROR: couldn\'t read $BASEDIR: $!\n"); + if (! opendir(DIR, $LOCALSTATEDIR)) { + dolog(LOG_ERR, "ERROR: couldn\'t read $LOCALSTATEDIR: $!\n"); } else { while ($dir = readdir(DIR)) { - next if ($dir =~ /^(\.|\.\.|CVS|bin|etc|logs|util)$/); - push(@dirs, $dir) if (-d "$BASEDIR/$dir"); + next if ($dir =~ /^(\.|\.\.|\.ssh|CVS|bin|etc|logs|util)$/); + push(@dirs, $dir) if (-d "$LOCALSTATEDIR/$dir"); } closedir(DIR); foreach $dir (@dirs) { - if (! opendir(DIR, "$BASEDIR/$dir")) { - dolog(LOG_ERR, "ERROR: couldn\'t read $BASEDIR/$dir: $!\n"); + if (! opendir(DIR, "$LOCALSTATEDIR/$dir")) { + dolog(LOG_ERR, + "ERROR: couldn\'t read $LOCALSTATEDIR/$dir: $!\n"); next; } closedir(DIR); - next if (! -f "$BASEDIR/$dir/router.db"); - if (open(RTR, "< $BASEDIR/$dir/router.db")) { + next if (! -f "$LOCALSTATEDIR/$dir/router.db"); + if (open(RTR, "< $LOCALSTATEDIR/$dir/router.db")) { while () { next if (/^\s*(#|$)/); # fqdn:mfg:state @@ -162,7 +164,7 @@ sub readrouters close(RTR); } else { dolog(LOG_ERR, "ERROR: couldn\'t open the router.db " . - "file: $BASEDIR/$dir/router.db: $!\n"); + "file: $LOCALSTATEDIR/$dir/router.db: $!\n"); } } } @@ -430,7 +432,7 @@ $max_lock_hold = 300; if (defined($LG_CLOGINRC)) { $cloginrc = $LG_CLOGINRC; } else { - $cloginrc = "$ENV(HOME)/.cloginrc"; + $cloginrc = $ENV{HOME} . "/.cloginrc"; } $query = new CGI; -- cgit From 654a4573f8fd2b1109e0ded8d9ce061dd3a2093f Mon Sep 17 00:00:00 2001 From: Tar Committer Date: Sun, 6 Jun 2004 04:12:54 +0000 Subject: Imported from rancid-2.3.1.tar.gz. --- bin/lg.cgi.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bin/lg.cgi.in') diff --git a/bin/lg.cgi.in b/bin/lg.cgi.in index 8b09847..ea0b54e 100644 --- a/bin/lg.cgi.in +++ b/bin/lg.cgi.in @@ -1,6 +1,6 @@ #! @PERLV_PATH@ ## -## $Id: lg.cgi.in,v 1.50 2004/03/10 23:01:28 heas Exp $ +## $Id: lg.cgi.in,v 1.51 2004/05/19 22:59:18 heas Exp $ ## ## Copyright (C) 1997-2004 by Terrapin Communications, Inc. ## All rights reserved. @@ -453,7 +453,7 @@ if (!defined($type) || !defined($router) || $router eq "") { "a clue.\n"); } -if ($arg !~ /^[-A-Za-z0-9|_\/ \.^\$]*$/) { +if ($arg !~ /^[-A-Za-z0-9|_\/: \.^\$]*$/) { &Error("Funny characters in argument; ignoring.\n"); } if (length($arg) >= 50) { -- cgit From 1cc9f22072de1d314a67387aac57740fb25c5258 Mon Sep 17 00:00:00 2001 From: Tar Committer Date: Thu, 4 May 2006 21:40:56 +0000 Subject: Imported from rancid-2.3.2a4.tar.gz. --- bin/lg.cgi.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'bin/lg.cgi.in') diff --git a/bin/lg.cgi.in b/bin/lg.cgi.in index ea0b54e..93e9797 100644 --- a/bin/lg.cgi.in +++ b/bin/lg.cgi.in @@ -1,6 +1,6 @@ #! @PERLV_PATH@ ## -## $Id: lg.cgi.in,v 1.51 2004/05/19 22:59:18 heas Exp $ +## $Id: lg.cgi.in,v 1.52 2005/12/07 19:19:46 heas Exp $ ## ## Copyright (C) 1997-2004 by Terrapin Communications, Inc. ## All rights reserved. @@ -680,7 +680,7 @@ if ($type eq "prefix" || $type eq "mbgp" || $type eq "route" ) { if ($mfg =~ /cisco/i) { $arg = " | include " . join(' ', @arg); } elsif ($mfg =~ /juniper/i) { - $arg = " | match \"" . join(' ', @arg) . "\""; + $arg = " | match \\\"" . join(' ', @arg) . "\\\""; } else { undef($arg); } @@ -738,7 +738,7 @@ if ($type eq "prefix" || $type eq "mbgp" || $type eq "route" ) { } else { $arg =~ s/[\$^]/ /g; } - $arg = "\"$arg\""; + $arg = "\\\"$arg\\\""; } # escape any ()s $arg =~ s/([\(\)])/\\$1/g; -- cgit From a0be206eb419f63eeb436631cc91b3456dff006f Mon Sep 17 00:00:00 2001 From: Tar Committer Date: Sat, 12 Aug 2006 02:59:43 +0000 Subject: Imported from rancid-2.3.2a5.tar.gz. --- bin/lg.cgi.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bin/lg.cgi.in') diff --git a/bin/lg.cgi.in b/bin/lg.cgi.in index 93e9797..2a6957f 100644 --- a/bin/lg.cgi.in +++ b/bin/lg.cgi.in @@ -1,8 +1,8 @@ #! @PERLV_PATH@ ## -## $Id: lg.cgi.in,v 1.52 2005/12/07 19:19:46 heas Exp $ +## $Id: lg.cgi.in,v 1.53 2006/05/28 16:38:51 heas Exp $ ## -## Copyright (C) 1997-2004 by Terrapin Communications, Inc. +## Copyright (C) 1997-2006 by Terrapin Communications, Inc. ## All rights reserved. ## ## This software may be freely copied, modified and redistributed -- cgit From 1a7c45398738cdb4eaafdc9e0962272f19d54816 Mon Sep 17 00:00:00 2001 From: Tar Committer Date: Tue, 5 Dec 2006 16:52:12 +0000 Subject: Imported from rancid-2.3.2a6.tar.gz. --- bin/lg.cgi.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'bin/lg.cgi.in') diff --git a/bin/lg.cgi.in b/bin/lg.cgi.in index 2a6957f..4ad6fdd 100644 --- a/bin/lg.cgi.in +++ b/bin/lg.cgi.in @@ -1,7 +1,8 @@ #! @PERLV_PATH@ ## -## $Id: lg.cgi.in,v 1.53 2006/05/28 16:38:51 heas Exp $ +## $Id: lg.cgi.in,v 1.54 2006/10/05 04:27:43 heas Exp $ ## +## @PACKAGE@ @VERSION@ ## Copyright (C) 1997-2006 by Terrapin Communications, Inc. ## All rights reserved. ## -- cgit