net-snmp: updated to 5.8

This commit is contained in:
Fredrik Rinnestam 2018-08-04 19:47:18 +02:00
parent 21747a87b1
commit a554e3c9c1
7 changed files with 49 additions and 2858 deletions

View File

@ -6,6 +6,7 @@ drwxr-xr-x root/root etc/snmp/
drwxr-xr-x root/root usr/
drwxr-xr-x root/root usr/bin/
-rwxr-xr-x root/root usr/bin/agentxtrap
-rwxr-xr-x root/root usr/bin/checkbandwidth
-rwxr-xr-x root/root usr/bin/encode_keychange
-rwxr-xr-x root/root usr/bin/fixproc
-rwxr-xr-x root/root usr/bin/ipf-mod.pl
@ -25,10 +26,14 @@ drwxr-xr-x root/root usr/bin/
-rwxr-xr-x root/root usr/bin/snmpgetnext
lrwxrwxrwx root/root usr/bin/snmpinform -> snmptrap
-rwxr-xr-x root/root usr/bin/snmpnetstat
-rwxr-xr-x root/root usr/bin/snmppcap
-rwxr-xr-x root/root usr/bin/snmpping
-rwxr-xr-x root/root usr/bin/snmpps
-rwxr-xr-x root/root usr/bin/snmpset
-rwxr-xr-x root/root usr/bin/snmpstatus
-rwxr-xr-x root/root usr/bin/snmptable
-rwxr-xr-x root/root usr/bin/snmptest
lrwxrwxrwx root/root usr/bin/snmptop -> snmpps
-rwxr-xr-x root/root usr/bin/snmptranslate
-rwxr-xr-x root/root usr/bin/snmptrap
-rwxr-xr-x root/root usr/bin/snmpusm
@ -62,6 +67,7 @@ drwxr-xr-x root/root usr/include/net-snmp/agent/
-rw-r--r-- root/root usr/include/net-snmp/agent/mode_end_call.h
-rw-r--r-- root/root usr/include/net-snmp/agent/multiplexer.h
-rw-r--r-- root/root usr/include/net-snmp/agent/net-snmp-agent-includes.h
-rw-r--r-- root/root usr/include/net-snmp/agent/netsnmp_close_fds.h
-rw-r--r-- root/root usr/include/net-snmp/agent/null.h
-rw-r--r-- root/root usr/include/net-snmp/agent/old_api.h
-rw-r--r-- root/root usr/include/net-snmp/agent/read_only.h
@ -117,6 +123,7 @@ drwxr-xr-x root/root usr/include/net-snmp/library/
-rw-r--r-- root/root usr/include/net-snmp/library/md5.h
-rw-r--r-- root/root usr/include/net-snmp/library/mib.h
-rw-r--r-- root/root usr/include/net-snmp/library/mt_support.h
-rw-r--r-- root/root usr/include/net-snmp/library/netsnmp-attribute-format.h
-rw-r--r-- root/root usr/include/net-snmp/library/oid.h
-rw-r--r-- root/root usr/include/net-snmp/library/oid_stash.h
-rw-r--r-- root/root usr/include/net-snmp/library/parse.h
@ -127,12 +134,15 @@ drwxr-xr-x root/root usr/include/net-snmp/library/
-rw-r--r-- root/root usr/include/net-snmp/library/snmpAliasDomain.h
-rw-r--r-- root/root usr/include/net-snmp/library/snmpCallbackDomain.h
-rw-r--r-- root/root usr/include/net-snmp/library/snmpIPv4BaseDomain.h
-rw-r--r-- root/root usr/include/net-snmp/library/snmpIPv6BaseDomain.h
-rw-r--r-- root/root usr/include/net-snmp/library/snmpSocketBaseDomain.h
-rw-r--r-- root/root usr/include/net-snmp/library/snmpTCPBaseDomain.h
-rw-r--r-- root/root usr/include/net-snmp/library/snmpTCPDomain.h
-rw-r--r-- root/root usr/include/net-snmp/library/snmpTCPIPv6Domain.h
-rw-r--r-- root/root usr/include/net-snmp/library/snmpUDPBaseDomain.h
-rw-r--r-- root/root usr/include/net-snmp/library/snmpUDPDomain.h
-rw-r--r-- root/root usr/include/net-snmp/library/snmpUDPIPv4BaseDomain.h
-rw-r--r-- root/root usr/include/net-snmp/library/snmpUDPIPv6Domain.h
-rw-r--r-- root/root usr/include/net-snmp/library/snmpUnixDomain.h
-rw-r--r-- root/root usr/include/net-snmp/library/snmp_alarm.h
-rw-r--r-- root/root usr/include/net-snmp/library/snmp_api.h
@ -177,6 +187,13 @@ drwxr-xr-x root/root usr/include/net-snmp/system/
-rw-r--r-- root/root usr/include/net-snmp/system/cygwin.h
-rw-r--r-- root/root usr/include/net-snmp/system/darwin.h
-rw-r--r-- root/root usr/include/net-snmp/system/darwin10.h
-rw-r--r-- root/root usr/include/net-snmp/system/darwin11.h
-rw-r--r-- root/root usr/include/net-snmp/system/darwin12.h
-rw-r--r-- root/root usr/include/net-snmp/system/darwin13.h
-rw-r--r-- root/root usr/include/net-snmp/system/darwin14.h
-rw-r--r-- root/root usr/include/net-snmp/system/darwin15.h
-rw-r--r-- root/root usr/include/net-snmp/system/darwin16.h
-rw-r--r-- root/root usr/include/net-snmp/system/darwin17.h
-rw-r--r-- root/root usr/include/net-snmp/system/darwin7.h
-rw-r--r-- root/root usr/include/net-snmp/system/darwin8.h
-rw-r--r-- root/root usr/include/net-snmp/system/darwin9.h
@ -197,13 +214,17 @@ drwxr-xr-x root/root usr/include/net-snmp/system/
-rw-r--r-- root/root usr/include/net-snmp/system/generic.h
-rw-r--r-- root/root usr/include/net-snmp/system/hpux.h
-rw-r--r-- root/root usr/include/net-snmp/system/irix.h
-rw-r--r-- root/root usr/include/net-snmp/system/kfreebsd.h
-rw-r--r-- root/root usr/include/net-snmp/system/linux.h
-rw-r--r-- root/root usr/include/net-snmp/system/mingw32.h
-rw-r--r-- root/root usr/include/net-snmp/system/mingw32msvc.h
-rw-r--r-- root/root usr/include/net-snmp/system/mips.h
-rw-r--r-- root/root usr/include/net-snmp/system/netbsd.h
-rw-r--r-- root/root usr/include/net-snmp/system/nto-qnx6.h
-rw-r--r-- root/root usr/include/net-snmp/system/openbsd.h
-rw-r--r-- root/root usr/include/net-snmp/system/openbsd4.h
-rw-r--r-- root/root usr/include/net-snmp/system/openbsd5.h
-rw-r--r-- root/root usr/include/net-snmp/system/openbsd6.h
-rw-r--r-- root/root usr/include/net-snmp/system/osf5.h
-rw-r--r-- root/root usr/include/net-snmp/system/solaris.h
-rw-r--r-- root/root usr/include/net-snmp/system/solaris2.3.h
@ -221,29 +242,29 @@ drwxr-xr-x root/root usr/include/net-snmp/system/
drwxr-xr-x root/root usr/lib/
-rw-r--r-- root/root usr/lib/libnetsnmp.a
-rwxr-xr-x root/root usr/lib/libnetsnmp.la
lrwxrwxrwx root/root usr/lib/libnetsnmp.so -> libnetsnmp.so.30.0.3
lrwxrwxrwx root/root usr/lib/libnetsnmp.so.30 -> libnetsnmp.so.30.0.3
-rwxr-xr-x root/root usr/lib/libnetsnmp.so.30.0.3
lrwxrwxrwx root/root usr/lib/libnetsnmp.so -> libnetsnmp.so.35.0.0
lrwxrwxrwx root/root usr/lib/libnetsnmp.so.35 -> libnetsnmp.so.35.0.0
-rwxr-xr-x root/root usr/lib/libnetsnmp.so.35.0.0
-rw-r--r-- root/root usr/lib/libnetsnmpagent.a
-rwxr-xr-x root/root usr/lib/libnetsnmpagent.la
lrwxrwxrwx root/root usr/lib/libnetsnmpagent.so -> libnetsnmpagent.so.30.0.3
lrwxrwxrwx root/root usr/lib/libnetsnmpagent.so.30 -> libnetsnmpagent.so.30.0.3
-rwxr-xr-x root/root usr/lib/libnetsnmpagent.so.30.0.3
lrwxrwxrwx root/root usr/lib/libnetsnmpagent.so -> libnetsnmpagent.so.35.0.0
lrwxrwxrwx root/root usr/lib/libnetsnmpagent.so.35 -> libnetsnmpagent.so.35.0.0
-rwxr-xr-x root/root usr/lib/libnetsnmpagent.so.35.0.0
-rw-r--r-- root/root usr/lib/libnetsnmphelpers.a
-rwxr-xr-x root/root usr/lib/libnetsnmphelpers.la
lrwxrwxrwx root/root usr/lib/libnetsnmphelpers.so -> libnetsnmphelpers.so.30.0.3
lrwxrwxrwx root/root usr/lib/libnetsnmphelpers.so.30 -> libnetsnmphelpers.so.30.0.3
-rwxr-xr-x root/root usr/lib/libnetsnmphelpers.so.30.0.3
lrwxrwxrwx root/root usr/lib/libnetsnmphelpers.so -> libnetsnmphelpers.so.35.0.0
lrwxrwxrwx root/root usr/lib/libnetsnmphelpers.so.35 -> libnetsnmphelpers.so.35.0.0
-rwxr-xr-x root/root usr/lib/libnetsnmphelpers.so.35.0.0
-rw-r--r-- root/root usr/lib/libnetsnmpmibs.a
-rwxr-xr-x root/root usr/lib/libnetsnmpmibs.la
lrwxrwxrwx root/root usr/lib/libnetsnmpmibs.so -> libnetsnmpmibs.so.30.0.3
lrwxrwxrwx root/root usr/lib/libnetsnmpmibs.so.30 -> libnetsnmpmibs.so.30.0.3
-rwxr-xr-x root/root usr/lib/libnetsnmpmibs.so.30.0.3
lrwxrwxrwx root/root usr/lib/libnetsnmpmibs.so -> libnetsnmpmibs.so.35.0.0
lrwxrwxrwx root/root usr/lib/libnetsnmpmibs.so.35 -> libnetsnmpmibs.so.35.0.0
-rwxr-xr-x root/root usr/lib/libnetsnmpmibs.so.35.0.0
-rw-r--r-- root/root usr/lib/libnetsnmptrapd.a
-rwxr-xr-x root/root usr/lib/libnetsnmptrapd.la
lrwxrwxrwx root/root usr/lib/libnetsnmptrapd.so -> libnetsnmptrapd.so.30.0.3
lrwxrwxrwx root/root usr/lib/libnetsnmptrapd.so.30 -> libnetsnmptrapd.so.30.0.3
-rwxr-xr-x root/root usr/lib/libnetsnmptrapd.so.30.0.3
lrwxrwxrwx root/root usr/lib/libnetsnmptrapd.so -> libnetsnmptrapd.so.35.0.0
lrwxrwxrwx root/root usr/lib/libnetsnmptrapd.so.35 -> libnetsnmptrapd.so.35.0.0
-rwxr-xr-x root/root usr/lib/libnetsnmptrapd.so.35.0.0
drwxr-xr-x root/root usr/lib/perl5/
drwxr-xr-x root/root usr/lib/perl5/5.26/
drwxr-xr-x root/root usr/lib/perl5/5.26/linux-thread-multi/
@ -251,7 +272,7 @@ drwxr-xr-x root/root usr/lib/perl5/site_perl/
drwxr-xr-x root/root usr/lib/perl5/site_perl/5.26/
drwxr-xr-x root/root usr/lib/perl5/site_perl/5.26/linux-thread-multi/
drwxr-xr-x root/root usr/lib/perl5/site_perl/5.26/linux-thread-multi/Bundle/
-r--r--r-- root/root usr/lib/perl5/site_perl/5.26/linux-thread-multi/Bundle/Makefile.subs.pl
-r--r--r-- root/root usr/lib/perl5/site_perl/5.26/linux-thread-multi/Bundle/MakefileSubs.pm
drwxr-xr-x root/root usr/lib/perl5/site_perl/5.26/linux-thread-multi/NetSNMP/
-r--r--r-- root/root usr/lib/perl5/site_perl/5.26/linux-thread-multi/NetSNMP/ASN.pm
-r--r--r-- root/root usr/lib/perl5/site_perl/5.26/linux-thread-multi/NetSNMP/OID.pm
@ -308,10 +329,12 @@ drwxr-xr-x root/root usr/man/man1/
-rw-r--r-- root/root usr/man/man1/snmpgetnext.1.gz
-rw-r--r-- root/root usr/man/man1/snmpinform.1.gz
-rw-r--r-- root/root usr/man/man1/snmpnetstat.1.gz
-rw-r--r-- root/root usr/man/man1/snmpps.1.gz
-rw-r--r-- root/root usr/man/man1/snmpset.1.gz
-rw-r--r-- root/root usr/man/man1/snmpstatus.1.gz
-rw-r--r-- root/root usr/man/man1/snmptable.1.gz
-rw-r--r-- root/root usr/man/man1/snmptest.1.gz
-rw-r--r-- root/root usr/man/man1/snmptop.1.gz
-rw-r--r-- root/root usr/man/man1/snmptranslate.1.gz
-rw-r--r-- root/root usr/man/man1/snmptrap.1.gz
-rw-r--r-- root/root usr/man/man1/snmpusm.1.gz
@ -525,6 +548,7 @@ drwxr-xr-x root/root usr/share/snmp/mib2c-data/
-rw-r--r-- root/root usr/share/snmp/mib2c.mfd.conf
-rw-r--r-- root/root usr/share/snmp/mib2c.notify.conf
-rw-r--r-- root/root usr/share/snmp/mib2c.old-api.conf
-rw-r--r-- root/root usr/share/snmp/mib2c.org-mode.conf
-rw-r--r-- root/root usr/share/snmp/mib2c.perl.conf
-rw-r--r-- root/root usr/share/snmp/mib2c.raw-table.conf
-rw-r--r-- root/root usr/share/snmp/mib2c.scalar.conf
@ -580,6 +604,7 @@ drwxr-xr-x root/root usr/share/snmp/mibs/
-rw-r--r-- root/root usr/share/snmp/mibs/SNMP-USER-BASED-SM-MIB.txt
-rw-r--r-- root/root usr/share/snmp/mibs/SNMP-USM-AES-MIB.txt
-rw-r--r-- root/root usr/share/snmp/mibs/SNMP-USM-DH-OBJECTS-MIB.txt
-rw-r--r-- root/root usr/share/snmp/mibs/SNMP-USM-HMAC-SHA2-MIB.txt
-rw-r--r-- root/root usr/share/snmp/mibs/SNMP-VIEW-BASED-ACM-MIB.txt
-rw-r--r-- root/root usr/share/snmp/mibs/SNMPv2-CONF.txt
-rw-r--r-- root/root usr/share/snmp/mibs/SNMPv2-MIB.txt

View File

@ -1,6 +0,0 @@
aea518953798008a1db91951eefd8da8 0001-CHANGES-BUG-2712-Fix-Perl-module-compilation.patch
ebbb1fa141e14932882f6c747f3fe4b4 0001-Remove-U64-typedef.patch
fcbab0e8e6c5cc76da637d1d71aaec3b CVE-2018-1000116.patch
d4a3459e1577d0efa8d96ca70a885e53 net-snmp-5.7.3.tar.gz
0ac35ebc69c521313cf0c24b9afb3b22 snmpd
e75939cb0b4648856d07b9c04610af5d snmpd.conf

View File

@ -1,10 +1,7 @@
untrusted comment: verify with /etc/ports/contrib.pub
RWSagIOpLGJF3/Rvzv16A46oD8b9aHaV4XK2ytLDBytIkGzud97TjDkYM0ez2z9eR+VdHQkQoQysKMHz6mgP0jfDeZ13Xy7B4QY=
SHA256 (Pkgfile) = 6597db3298de9e37c021ee96851f67e9a349758a8505b536927e6c3beac2644a
SHA256 (.footprint) = afd799aa2193c96e57af5dd80a1005038de627c33541191580a8352f6c1b5a44
SHA256 (net-snmp-5.7.3.tar.gz) = 12ef89613c7707dc96d13335f153c1921efc9d61d3708ef09f3fc4a7014fb4f0
RWSagIOpLGJF3//Is6YXl13RgJ/Avg9ISP0Y2Gsr29/a2fTX7+s5zzTy5mGmvs7Ywoa1LbVfY+nD6K76tat9KnZzWABaCAHzWQk=
SHA256 (Pkgfile) = c3064a29e53532fe87cdf8dec286f521c4877fd6b4c54c51da956170487ccf47
SHA256 (.footprint) = 2f1a17e25d5343b033933840155988f8cf34c1d6c8f3a8b3a9191a81140ee905
SHA256 (net-snmp-5.8.tar.gz) = b2fc3500840ebe532734c4786b0da4ef0a5f67e51ef4c86b3345d697e4976adf
SHA256 (snmpd) = 2f8945dd66668cccd4ad884bbc1f425dfb5ace1261a5c410182222c928f54a34
SHA256 (snmpd.conf) = fc23c35aa4e275456cb9e7e1a4c2af06a9ec089126932a98aef39093a3c33e3e
SHA256 (0001-Remove-U64-typedef.patch) = 5ba67c44ec792c6509e9f91bc2561b7c74231c7123b67e4f45b997ea6b3fa4ec
SHA256 (0001-CHANGES-BUG-2712-Fix-Perl-module-compilation.patch) = 77b9bf66b7f4ee6be486c945602fcbcf37d48a7b2514f3c9ba1e49550f4cab96
SHA256 (CVE-2018-1000116.patch) = 49b1c3509d53b1346c10282c29ac8e2020d40921f7287017ce4f24e06c0a301d

View File

@ -1,182 +0,0 @@
From 4e793461e96a2b4fd81142ab312d074d5c8841fa Mon Sep 17 00:00:00 2001
From: Bart Van Assche <bvanassche@acm.org>
Date: Sat, 23 Jul 2016 18:41:10 -0700
Subject: [PATCH] CHANGES: BUG: 2712: Fix Perl module compilation
Avoid that building the Net-SNMP Perl modules fails as follows:
ERROR from evaluation of /sources/net-snmp-5.7.3/perl/ASN/Makefile.PL: Bizarre \ copy of HASH in list assignment at /usr/lib/perl5/site_perl/5.24.0/Carp.pm line\ 229.
See also https://sourceforge.net/p/net-snmp/bugs/2712/.
---
perl/ASN/Makefile.PL | 4 +---
perl/Makefile.PL | 4 +---
perl/OID/Makefile.PL | 5 +----
perl/SNMP/Makefile.PL | 5 +----
perl/TrapReceiver/Makefile.PL | 5 +----
perl/agent/Makefile.PL | 5 +----
perl/agent/Support/Makefile.PL | 5 +----
perl/agent/default_store/Makefile.PL | 5 +----
perl/default_store/Makefile.PL | 6 +-----
9 files changed, 9 insertions(+), 35 deletions(-)
diff --git a/perl/ASN/Makefile.PL b/perl/ASN/Makefile.PL
index f895a41..0e52b3a 100644
--- a/perl/ASN/Makefile.PL
+++ b/perl/ASN/Makefile.PL
@@ -7,9 +7,7 @@ my $lib_version;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
-%MakeParams = InitMakeParams();
-
-WriteMakefile(%MakeParams);
+WriteMakefile(InitMakeParams());
Check_Version();
diff --git a/perl/Makefile.PL b/perl/Makefile.PL
index f70f991..ac36c15 100644
--- a/perl/Makefile.PL
+++ b/perl/Makefile.PL
@@ -3,9 +3,7 @@ use Config;
use Getopt::Long;
require 5;
-%MakeParams = InitMakeParams();
-
-WriteMakefile(%MakeParams);
+WriteMakefile(InitMakeParams());
sub InitMakeParams {
$nsconfig="net-snmp-config"; # in path by default
diff --git a/perl/OID/Makefile.PL b/perl/OID/Makefile.PL
index 5d94338..676c439 100644
--- a/perl/OID/Makefile.PL
+++ b/perl/OID/Makefile.PL
@@ -6,11 +6,8 @@ require 5;
use Config;
use Getopt::Long;
my $lib_version;
-my %MakeParams = ();
-%MakeParams = InitMakeParams();
-
-WriteMakefile(%MakeParams);
+WriteMakefile(InitMakeParams());
Check_Version();
diff --git a/perl/SNMP/Makefile.PL b/perl/SNMP/Makefile.PL
index 928cb67..d7b5a2a 100644
--- a/perl/SNMP/Makefile.PL
+++ b/perl/SNMP/Makefile.PL
@@ -3,15 +3,12 @@ require 5;
use Config;
use Getopt::Long;
my $lib_version;
-my %MakeParams = ();
my $opts;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
-%MakeParams = InitMakeParams();
-
-WriteMakefile(%MakeParams);
+WriteMakefile(InitMakeParams());
Check_Version();
diff --git a/perl/TrapReceiver/Makefile.PL b/perl/TrapReceiver/Makefile.PL
index 5c9463a..0af6aaf 100644
--- a/perl/TrapReceiver/Makefile.PL
+++ b/perl/TrapReceiver/Makefile.PL
@@ -3,11 +3,8 @@ require 5;
use Config;
use Getopt::Long;
my $lib_version;
-my %MakeParams = ();
-%MakeParams = InitMakeParams();
-
-WriteMakefile(%MakeParams);
+WriteMakefile(InitMakeParams());
Check_Version();
diff --git a/perl/agent/Makefile.PL b/perl/agent/Makefile.PL
index b4b358a..fe105ea 100644
--- a/perl/agent/Makefile.PL
+++ b/perl/agent/Makefile.PL
@@ -3,11 +3,8 @@ require 5;
use Config;
use Getopt::Long;
my $lib_version;
-my %MakeParams = ();
-%MakeParams = InitMakeParams();
-
-WriteMakefile(%MakeParams);
+WriteMakefile(InitMakeParams());
Check_Version();
diff --git a/perl/agent/Support/Makefile.PL b/perl/agent/Support/Makefile.PL
index 3a4f200..0dcb3f6 100644
--- a/perl/agent/Support/Makefile.PL
+++ b/perl/agent/Support/Makefile.PL
@@ -3,14 +3,11 @@ require 5;
use Config;
use Getopt::Long;
my $lib_version;
-my %MakeParams = ();
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
-%MakeParams = InitMakeParams();
-
-WriteMakefile(%MakeParams);
+WriteMakefile(InitMakeParams());
Check_Version();
diff --git a/perl/agent/default_store/Makefile.PL b/perl/agent/default_store/Makefile.PL
index 67d5ff0..5c6a5d6 100644
--- a/perl/agent/default_store/Makefile.PL
+++ b/perl/agent/default_store/Makefile.PL
@@ -3,11 +3,8 @@ require 5;
use Config;
use Getopt::Long;
my $lib_version;
-my %MakeParams = ();
-%MakeParams = InitMakeParams();
-
-WriteMakefile(%MakeParams);
+WriteMakefile(InitMakeParams());
Check_Version();
diff --git a/perl/default_store/Makefile.PL b/perl/default_store/Makefile.PL
index 54996ab..221d4ed 100644
--- a/perl/default_store/Makefile.PL
+++ b/perl/default_store/Makefile.PL
@@ -3,12 +3,8 @@ require 5;
use Config;
use Getopt::Long;
my $lib_version;
-my %MakeParams = ();
-
-%MakeParams = InitMakeParams();
-
-WriteMakefile(%MakeParams);
+WriteMakefile(InitMakeParams());
sub InitMakeParams {
my $opts;
--
2.10.0

File diff suppressed because it is too large Load Diff

View File

@ -1,117 +0,0 @@
--- a/snmplib/snmp_api.c
+++ b/snmplib/snmp_api.c
@@ -4350,10 +4350,9 @@ snmp_pdu_parse(netsnmp_pdu *pdu, u_char
u_char type;
u_char msg_type;
u_char *var_val;
- int badtype = 0;
size_t len;
size_t four;
- netsnmp_variable_list *vp = NULL;
+ netsnmp_variable_list *vp = NULL, *vplast = NULL;
oid objid[MAX_OID_LEN];
u_char *p;
@@ -4493,38 +4492,24 @@ snmp_pdu_parse(netsnmp_pdu *pdu, u_char
(ASN_SEQUENCE | ASN_CONSTRUCTOR),
"varbinds");
if (data == NULL)
- return -1;
+ goto fail;
/*
* get each varBind sequence
*/
while ((int) *length > 0) {
- netsnmp_variable_list *vptemp;
- vptemp = (netsnmp_variable_list *) malloc(sizeof(*vptemp));
- if (NULL == vptemp) {
- return -1;
- }
- if (NULL == vp) {
- pdu->variables = vptemp;
- } else {
- vp->next_variable = vptemp;
- }
- vp = vptemp;
+ vp = SNMP_MALLOC_TYPEDEF(netsnmp_variable_list);
+ if (NULL == vp)
+ goto fail;
- vp->next_variable = NULL;
- vp->val.string = NULL;
vp->name_length = MAX_OID_LEN;
- vp->name = NULL;
- vp->index = 0;
- vp->data = NULL;
- vp->dataFreeHook = NULL;
DEBUGDUMPSECTION("recv", "VarBind");
data = snmp_parse_var_op(data, objid, &vp->name_length, &vp->type,
&vp->val_len, &var_val, length);
if (data == NULL)
- return -1;
+ goto fail;
if (snmp_set_var_objid(vp, objid, vp->name_length))
- return -1;
+ goto fail;
len = MAX_PACKET_LENGTH;
DEBUGDUMPHEADER("recv", "Value");
@@ -4604,7 +4589,7 @@ snmp_pdu_parse(netsnmp_pdu *pdu, u_char
vp->val.string = (u_char *) malloc(vp->val_len);
}
if (vp->val.string == NULL) {
- return -1;
+ goto fail;
}
p = asn_parse_string(var_val, &len, &vp->type, vp->val.string,
&vp->val_len);
@@ -4619,7 +4604,7 @@ snmp_pdu_parse(netsnmp_pdu *pdu, u_char
vp->val_len *= sizeof(oid);
vp->val.objid = (oid *) malloc(vp->val_len);
if (vp->val.objid == NULL) {
- return -1;
+ goto fail;
}
memmove(vp->val.objid, objid, vp->val_len);
break;
@@ -4631,7 +4616,7 @@ snmp_pdu_parse(netsnmp_pdu *pdu, u_char
case ASN_BIT_STR:
vp->val.bitstring = (u_char *) malloc(vp->val_len);
if (vp->val.bitstring == NULL) {
- return -1;
+ goto fail;
}
p = asn_parse_bitstring(var_val, &len, &vp->type,
vp->val.bitstring, &vp->val_len);
@@ -4640,12 +4625,28 @@ snmp_pdu_parse(netsnmp_pdu *pdu, u_char
break;
default:
snmp_log(LOG_ERR, "bad type returned (%x)\n", vp->type);
- badtype = -1;
+ goto fail;
break;
}
DEBUGINDENTADD(-4);
+
+ if (NULL == vplast) {
+ pdu->variables = vp;
+ } else {
+ vplast->next_variable = vp;
+ }
+ vplast = vp;
+ vp = NULL;
}
- return badtype;
+ return 0;
+
+ fail:
+ DEBUGMSGTL(("recv", "error while parsing VarBindList\n"));
+ /** if we were parsing a var, remove it from the pdu and free it */
+ if (vp)
+ snmp_free_var(vp);
+
+ return -1;
}
/*

View File

@ -4,22 +4,15 @@
# Depends on: lm_sensors
name=net-snmp
version=5.7.3
release=5
version=5.8
release=1
source=(http://download.sourceforge.net/$name/$name-$version.tar.gz \
snmpd snmpd.conf \
0001-Remove-U64-typedef.patch \
0001-CHANGES-BUG-2712-Fix-Perl-module-compilation.patch \
CVE-2018-1000116.patch)
snmpd snmpd.conf)
build() {
cd $name-$version
patch -p1 -i $SRC/0001-Remove-U64-typedef.patch
patch -p1 -i $SRC/0001-CHANGES-BUG-2712-Fix-Perl-module-compilation.patch
patch -p1 -i $SRC/CVE-2018-1000116.patch
export NETSNMP_DONT_CHECK_VERSION=1
#export NETSNMP_DONT_CHECK_VERSION=1
./configure --prefix=/usr \
--sysconfdir=/etc \
--mandir=/usr/man \