diff --git a/net/mrtg/Makefile b/net/mrtg/Makefile index bb7f19c6f20..911f83d1348 100644 --- a/net/mrtg/Makefile +++ b/net/mrtg/Makefile @@ -1,9 +1,9 @@ -# $OpenBSD: Makefile,v 1.62 2010/01/05 16:36:33 okan Exp $ +# $OpenBSD: Makefile,v 1.63 2010/01/13 12:33:24 sthen Exp $ COMMENT= multi-router traffic grapher DISTNAME= mrtg-2.16.2 -PKGNAME= ${DISTNAME}p0 +PKGNAME= ${DISTNAME}p1 CATEGORIES= net HOMEPAGE= http://oss.oetiker.ch/mrtg/ @@ -38,6 +38,10 @@ CONFIGURE_ENV= CPPFLAGS="-I${X11BASE}/include" \ NO_REGRESS= Yes +# SUBST_CMD mangles the file +pre-configure: + @perl -pi -e 's,%%SYSCONFDIR%%,${SYSCONFDIR},g' ${WRKSRC}/bin/mrtg + do-install: ${INSTALL_DATA_DIR} ${PREFIX}/share/examples/mrtg ${INSTALL_DATA_DIR} ${PREFIX}/libdata/perl5/site_perl/Pod diff --git a/net/mrtg/patches/patch-bin_mrtg b/net/mrtg/patches/patch-bin_mrtg new file mode 100644 index 00000000000..80dfb9751c2 --- /dev/null +++ b/net/mrtg/patches/patch-bin_mrtg @@ -0,0 +1,27 @@ +$OpenBSD: patch-bin_mrtg,v 1.1 2010/01/13 12:33:24 sthen Exp $ +--- bin/mrtg.orig Wed Jan 13 00:17:19 2010 ++++ bin/mrtg Wed Jan 13 00:17:49 2010 +@@ -212,7 +212,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; + +@@ -910,6 +910,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",