From fae328cd534c1f700cdf8576cd370f68d62d585a Mon Sep 17 00:00:00 2001 From: Tobi Oetiker Date: Sun, 29 Jun 2008 15:09:46 +0000 Subject: do some more checking on the slave name we get from the cgi --- lib/Smokeping.pm | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib') diff --git a/lib/Smokeping.pm b/lib/Smokeping.pm index 5f47efc..e66ee44 100644 --- a/lib/Smokeping.pm +++ b/lib/Smokeping.pm @@ -1548,6 +1548,11 @@ sub display_webpage($$){ my $cfg = shift; my $q = shift; my ($path,$slave) = split(/~/,$q->param('target') || ''); + if ($slave and $slave ~= /(\S+)/){ + die "ERROR: slave '$slave' is not defined in the '*** Slaves ***' section!\n" + unless defined $cfg->{Slaves}{$slave}; + $slave = $1; + } my $hierarchy = $q->param('hierarchy'); die "ERROR: unknown hierarchy $hierarchy\n" if $hierarchy and not $cfg->{Presentation}{hierarchies}{$hierarchy}; -- cgit v1.2.3-24-g4f1b