Fix cfgmaker uninitialized value errors

This commit is contained in:
Vitezslav Crhonek 2015-09-07 13:43:13 +02:00
parent 4b72393c8c
commit a8f5856152
2 changed files with 50 additions and 1 deletions

View File

@ -0,0 +1,42 @@
diff -up mrtg-2.17.4/bin/cfgmaker.orig mrtg-2.17.4/bin/cfgmaker
--- mrtg-2.17.4/bin/cfgmaker.orig 2015-09-07 13:12:23.960003553 +0200
+++ mrtg-2.17.4/bin/cfgmaker 2015-09-07 13:13:16.694253515 +0200
@@ -1369,22 +1369,23 @@ sub addrouter() {
# tenderly and populate the $$flags{}{} hashes accordingly.
for my $g (@{$$opt{"global"}}) {
my ($t,$fs);
- $g =~ /^options\[([_^\$])\]:\s*(.*)$/i;
- $t = $1;
- $fs = $2;
- $t =~ s/_/default/;
- $t =~ s/\^/prepend/;
- $t =~ s/\$/append/;
+ if ($g =~ /^options\[([_^\$])\]:\s*(.*)$/i) {
+ $t = $1;
+ $fs = $2;
+ $t =~ s/_/default/;
+ $t =~ s/\^/prepend/;
+ $t =~ s/\$/append/;
- # If a line like "options[X]:" is found clear
- # all flags for that category and then go to next
- # --global 'Options[..' line if any.
- if ($fs =~ /^\s*$/) {
- $$flags{$t} = {};
- next;
- } else {
- for my $f (split /\s*,\s*/,$fs) {
- $$flags{$t}{$f} = "set";
+ # If a line like "options[X]:" is found clear
+ # all flags for that category and then go to next
+ # --global 'Options[..' line if any.
+ if ($fs =~ /^\s*$/) {
+ $$flags{$t} = {};
+ next;
+ } else {
+ for my $f (split /\s*,\s*/,$fs) {
+ $$flags{$t}{$f} = "set";
+ }
}
}
}

View File

@ -6,7 +6,7 @@
Summary: Multi Router Traffic Grapher
Name: mrtg
Version: 2.17.4
Release: 16%{?dist}
Release: 17%{?dist}
URL: http://oss.oetiker.ch/mrtg/
Source0: http://oss.oetiker.ch/mrtg/pub/mrtg-%{version}.tar.gz
Source1: http://oss.oetiker.ch/mrtg/pub/mrtg-%{version}.tar.gz.md5
@ -28,6 +28,8 @@ Patch0: mrtg-2.15.0-lib64.patch
Patch2: mrtg-2.17.2-socket6-fix.patch
# Patch3: some devices return 2**32-2 on ifSpeed (e. g. IBM FibreChannel switches)
Patch3: mrtg-2.17.4-cfgmaker-ifhighspeed.patch
# Patch4: fix uninitialized value errors in cfgmaker
Patch4: mrtg-2.17.4-cfgmaker-uninitialized-value.patch
License: GPLv2+
Group: Applications/Internet
Requires(post): systemd-units
@ -51,6 +53,7 @@ images which provide a LIVE visual representation of this traffic.
%patch0 -p1 -b .lib64
%patch2 -p1 -b .socket6
%patch3 -p1 -b .ifhighspeed
%patch4 -p1 -b .cfgmaker-uninitialized-value
for i in doc/mrtg-forum.1 doc/mrtg-squid.1 CHANGES; do
iconv -f iso-8859-1 -t utf-8 < "$i" > "${i}_"
@ -136,6 +139,10 @@ fi
%{_unitdir}/mrtg.timer
%changelog
* Mon Sep 07 2015 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.17.4-17
- Fix cfgmaker uninitialized value errors
Resolves: #1260062
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.17.4-16
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild