openbsd-ports/net/mrtg/patches/patch-bin_mrtg
sthen d86a0686d5 - update to 2.16.3
- take maintainer
- drop some duplicate copies of docs which are in manpages anyway
- patch cfgmaker to recognise WWP gear and OpenSNMPD
- more perl 5.10.1 taint mode fixes
2010-03-20 23:01:11 +00:00

38 lines
1.2 KiB
Plaintext

$OpenBSD: patch-bin_mrtg,v 1.2 2010/03/20 23:01:11 sthen Exp $
--- bin/mrtg.orig Wed Jan 20 10:56:29 2010
+++ bin/mrtg Tue Mar 16 15:26:34 2010
@@ -214,7 +214,7 @@ sub main {
my $cfgfile = shift @ARGV;
- if ( !defined $cfgfile and -r "/etc/mrtg.cfg" ) { $cfgfile = "/etc/mrtg.cfg"; }
+ if ( !defined $cfgfile and -r "%%SYSCONFDIR%%/mrtg.cfg" ) { $cfgfile = "%%SYSCONFDIR%%/mrtg.cfg"; }
printusage() unless defined $cfgfile;
@@ -615,6 +615,9 @@ sub getcurrent {
$uptime = $target->[ $u ]{ _UPTIME_ };
$name = $target->[ $u ]{ _NAME_ };
$time = $target->[ $u ]{ _TIME_ };
+ if ($time =~ /^([-0-9.]+)$/) {
+ $time = $1;
+ }
}
# Set the time to the current time if it was not set above
@@ -950,6 +953,14 @@ sub writegraphics {
# set values to -1 to tell rateup about unknown values
$inlast = -1 unless defined $inlast;
$outlast = -1 unless defined $outlast;
+
+ # untaint
+ if ($inlast =~ /^([-0-9.]+)$/) {
+ $inlast = $1;
+ }
+ if ($outlast =~ /^([-0-9.]+)$/) {
+ $outlast = $1;
+ }
if ($$rcfg{'options'}{'dorelpercent'}{$router}) {
@exec = ("${FindBin::Bin}${MRTG_lib::SL}rateup",