diff options
author | Tobi Oetiker <tobi@oetiker.ch> | 2008-06-29 17:09:46 +0200 |
---|---|---|
committer | Tobi Oetiker <tobi@oetiker.ch> | 2008-06-29 17:09:46 +0200 |
commit | fae328cd534c1f700cdf8576cd370f68d62d585a (patch) | |
tree | c1d1467426ce4cbbf76e9db7cdc67e830b71f7b7 /lib | |
parent | f28283f29111269f6de963411f80748692186153 (diff) | |
download | smokeping-fae328cd534c1f700cdf8576cd370f68d62d585a.tar.gz smokeping-fae328cd534c1f700cdf8576cd370f68d62d585a.tar.xz |
do some more checking on the slave name we get from the cgi
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Smokeping.pm | 5 |
1 files changed, 5 insertions, 0 deletions
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}; |