Update to 5.7.3

This commit is contained in:
Jan Safranek 2015-02-17 15:36:21 +01:00
parent 7d1a0d54c6
commit 8e09123e82
8 changed files with 113 additions and 770 deletions

View File

@ -11,15 +11,15 @@ the code to 'any subsequent version of this License published by Apple'.
According to http://fedoraproject.org/wiki/Licensing, APSL ver. 2.0 is
better for us.
diff -up net-snmp-5.5/COPYING.apsl net-snmp-5.5/COPYING
--- net-snmp-5.5/COPYING.apsl 2010-08-04 12:40:27.494479126 +0200
+++ net-snmp-5.5/COPYING 2010-08-04 12:45:47.713684755 +0200
@@ -292,3 +292,337 @@ ON ANY THEORY OF LIABILITY, WHETHER IN C
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
diff -up net-snmp-5.7.3/COPYING.skiFvk net-snmp-5.7.3/COPYING
--- net-snmp-5.7.3/COPYING.skiFvk 2015-02-17 13:33:15.963257594 +0100
+++ net-snmp-5.7.3/COPYING 2015-02-17 13:33:37.931241818 +0100
@@ -325,3 +325,337 @@ PROFITS; OR BUSINESS INTERRUPTION) HOWEV
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+---- Part 10: APPLE PUBLIC SOURCE LICENSE (APSL 2.0) ----
+---- Part 11: APPLE PUBLIC SOURCE LICENSE (APSL 2.0) ----
+
+Version 2.0 - August 6, 2003
+
@ -333,8 +333,8 @@ diff -up net-snmp-5.5/COPYING.apsl net-snmp-5.5/COPYING
+
+Where You are located in the province of Quebec, Canada, the following clause
+applies: The parties hereby confirm that they have requested that this License
+and all related documents be drafted in English. Les parties ont exigé que le
+présent contrat et tous les documents connexes soient rédigés en anglais.
+and all related documents be drafted in English. Les parties ont exige que le
+present contrat et tous les documents connexes soient rediges en anglais.
+
+EXHIBIT A.
+

View File

@ -1,8 +1,6 @@
Make the man pages multilib safe.
diff -up net-snmp-5.6/man/netsnmp_config_api.3.def.multilib net-snmp-5.6/man/netsnmp_config_api.3.def
--- net-snmp-5.6/man/netsnmp_config_api.3.def.multilib 2010-09-08 17:41:37.000000000 +0200
+++ net-snmp-5.6/man/netsnmp_config_api.3.def 2010-10-25 17:40:43.433726423 +0200
diff -up net-snmp-5.7.3/man/netsnmp_config_api.3.def.oSBcEB net-snmp-5.7.3/man/netsnmp_config_api.3.def
--- net-snmp-5.7.3/man/netsnmp_config_api.3.def.oSBcEB 2014-12-08 21:23:22.000000000 +0100
+++ net-snmp-5.7.3/man/netsnmp_config_api.3.def 2015-02-17 13:32:38.903284207 +0100
@@ -295,7 +295,7 @@ for one particular machine.
.PP
The default list of directories to search is \fC SYSCONFDIR/snmp\fP,
@ -19,24 +17,24 @@ diff -up net-snmp-5.6/man/netsnmp_config_api.3.def.multilib net-snmp-5.6/man/net
-Default: SYSCONFDIR/snmp:DATADIR/snmp:LIBDIR/snmp:$HOME/.snmp
+Default: SYSCONFDIR/snmp:DATADIR/snmp:/usr/lib(64)/snmp:$HOME/.snmp
.SH "SEE ALSO"
.BR mib_api "(3), " snmp_api (3)
netsnmp_mib_api(3), snmp_api(3)
.\" Local Variables:
diff -up net-snmp-5.6/man/snmp_config.5.def.multilib net-snmp-5.6/man/snmp_config.5.def
--- net-snmp-5.6/man/snmp_config.5.def.multilib 2010-09-17 11:51:52.000000000 +0200
+++ net-snmp-5.6/man/snmp_config.5.def 2010-10-25 17:40:12.681976439 +0200
diff -up net-snmp-5.7.3/man/snmp_config.5.def.oSBcEB net-snmp-5.7.3/man/snmp_config.5.def
--- net-snmp-5.7.3/man/snmp_config.5.def.oSBcEB 2015-02-17 13:32:04.251309092 +0100
+++ net-snmp-5.7.3/man/snmp_config.5.def 2015-02-17 13:33:09.217262438 +0100
@@ -10,7 +10,7 @@ First off, there are numerous places tha
found and read from. By default, the applications look for
configuration files in the following 4 directories, in order:
SYSCONFDIR/snmp,
-DATADIR/snmp, LIBDIR/snmp, and $HOME/.snmp. In each of these
+DATADIR/snmp, /usr/lib(64)/snmp, and $HOME/.snmp. In each of these
directories, it looks for files with the extension of both
.IR conf " and " local.conf
(reading the second ones last). In this manner, there are
diff -up net-snmp-5.6/man/snmpd.conf.5.def.multilib net-snmp-5.6/man/snmpd.conf.5.def
--- net-snmp-5.6/man/snmpd.conf.5.def.multilib 2010-09-17 11:51:52.000000000 +0200
+++ net-snmp-5.6/man/snmpd.conf.5.def 2010-10-25 17:40:12.682976925 +0200
@@ -1387,7 +1387,7 @@ filename), and call the initialisation r
directories, it looks for files snmp.conf, snmpd.conf and/or
snmptrapd.conf, as well as snmp.local.conf, snmpd.local.conf
and/or snmptrapd.local.conf. *.local.conf are always
diff -up net-snmp-5.7.3/man/snmpd.conf.5.def.oSBcEB net-snmp-5.7.3/man/snmpd.conf.5.def
--- net-snmp-5.7.3/man/snmpd.conf.5.def.oSBcEB 2014-12-08 21:23:22.000000000 +0100
+++ net-snmp-5.7.3/man/snmpd.conf.5.def 2015-02-17 13:32:04.251309092 +0100
@@ -1502,7 +1502,7 @@ filename), and call the initialisation r
.RS
.IP "Note:"
If the specified PATH is not a fully qualified filename, it will

View File

@ -1,32 +0,0 @@
Bug 965348 - HOST-RESOURCES-MIB::hrFS* not includes btrfs
commit da1fef382591ff45dc92eb3b95a6bfeff9ecfa4f
Author: Jan Safranek <jsafranek@users.sourceforge.net>
Date: Tue May 21 09:13:41 2013 +0200
CHANGES: snmpd: Added btrfs support to hrFSTable
diff -up net-snmp-5.7.2/agent/mibgroup/hardware/fsys/fsys_mntent.c.btrfs net-snmp-5.7.2/agent/mibgroup/hardware/fsys/fsys_mntent.c
--- net-snmp-5.7.2/agent/mibgroup/hardware/fsys/fsys_mntent.c.btrfs 2012-10-10 00:28:58.000000000 +0200
+++ net-snmp-5.7.2/agent/mibgroup/hardware/fsys/fsys_mntent.c 2013-05-21 09:22:11.457405066 +0200
@@ -139,6 +139,7 @@ _fsys_type( char *typename )
!strcmp(typename, MNTTYPE_REISERFS) ||
!strcmp(typename, MNTTYPE_OCFS2) ||
!strcmp(typename, MNTTYPE_CVFS) ||
+ !strcmp(typename, MNTTYPE_BTRFS) ||
!strcmp(typename, MNTTYPE_LOFS))
return NETSNMP_FS_TYPE_OTHER;
diff -up net-snmp-5.7.2/agent/mibgroup/hardware/fsys/mnttypes.h.btrfs net-snmp-5.7.2/agent/mibgroup/hardware/fsys/mnttypes.h
--- net-snmp-5.7.2/agent/mibgroup/hardware/fsys/mnttypes.h.btrfs 2012-10-10 00:28:58.000000000 +0200
+++ net-snmp-5.7.2/agent/mibgroup/hardware/fsys/mnttypes.h 2013-05-21 09:22:33.758303373 +0200
@@ -142,6 +142,9 @@
#ifndef MNTTYPE_CVFS
#define MNTTYPE_CVFS "cvfs"
#endif
+#ifndef MNTTYPE_BTRFS
+#define MNTTYPE_BTRFS "btrfs"
+#endif
/*
* File systems to skip

View File

@ -1,146 +0,0 @@
1071753 - net-snmp: denial of service flaw in Linux implementation of ICMP-MIB
commit 8407b6ce46ca7159b3c816d1024e20a53f9a1c6c
Author: Wes Hardaker <hardaker@users.sourceforge.net>
Date: Wed Feb 19 15:21:57 2014 -0800
bug fix from fenner: fix ICMP mib table handling on linux
diff --git a/agent/mibgroup/mibII/icmp.c b/agent/mibgroup/mibII/icmp.c
index 14c73a6..6d10426 100644
--- a/agent/mibgroup/mibII/icmp.c
+++ b/agent/mibgroup/mibII/icmp.c
@@ -106,10 +106,20 @@ struct icmp_msg_stats_table_entry {
int flags;
};
+#ifdef linux
+/* Linux keeps track of all possible message types */
+#define ICMP_MSG_STATS_IPV4_COUNT 256
+#else
#define ICMP_MSG_STATS_IPV4_COUNT 11
+#endif
#ifdef NETSNMP_ENABLE_IPV6
+#ifdef linux
+/* Linux keeps track of all possible message types */
+#define ICMP_MSG_STATS_IPV6_COUNT 256
+#else
#define ICMP_MSG_STATS_IPV6_COUNT 14
+#endif
#else
#define ICMP_MSG_STATS_IPV6_COUNT 0
#endif /* NETSNMP_ENABLE_IPV6 */
@@ -177,7 +187,7 @@ icmp_msg_stats_load(netsnmp_cache *cache, void *vmagic)
inc = 0;
linux_read_icmp_msg_stat(&v4icmp, &v4icmpmsg, &flag);
if (flag) {
- while (254 != k) {
+ while (255 >= k) {
if (v4icmpmsg.vals[k].InType) {
icmp_msg_stats_table[i].ipVer = 1;
icmp_msg_stats_table[i].icmpMsgStatsType = k;
@@ -267,7 +277,7 @@ icmp_msg_stats_load(netsnmp_cache *cache, void *vmagic)
inc = 0;
linux_read_icmp6_msg_stat(&v6icmp, &v6icmpmsg, &flag);
if (flag) {
- while (254 != k) {
+ while (255 >= k) {
if (v6icmpmsg.vals[k].InType) {
icmp_msg_stats_table[i].ipVer = 2;
icmp_msg_stats_table[i].icmpMsgStatsType = k;
@@ -1050,6 +1060,12 @@ icmp_stats_table_handler(netsnmp_mib_handler *handler,
continue;
table_info = netsnmp_extract_table_info(request);
subid = table_info->colnum;
+ DEBUGMSGTL(( "mibII/icmpStatsTable", "oid: " ));
+ DEBUGMSGOID(( "mibII/icmpStatsTable", request->requestvb->name,
+ request->requestvb->name_length ));
+ DEBUGMSG(( "mibII/icmpStatsTable", " In %d InErr %d Out %d OutErr %d\n",
+ entry->icmpStatsInMsgs, entry->icmpStatsInErrors,
+ entry->icmpStatsOutMsgs, entry->icmpStatsOutErrors ));
switch (subid) {
case ICMP_STAT_INMSG:
@@ -1117,6 +1133,11 @@ icmp_msg_stats_table_handler(netsnmp_mib_handler *handler,
continue;
table_info = netsnmp_extract_table_info(request);
subid = table_info->colnum;
+ DEBUGMSGTL(( "mibII/icmpMsgStatsTable", "oid: " ));
+ DEBUGMSGOID(( "mibII/icmpMsgStatsTable", request->requestvb->name,
+ request->requestvb->name_length ));
+ DEBUGMSG(( "mibII/icmpMsgStatsTable", " In %d Out %d Flags 0x%x\n",
+ entry->icmpMsgStatsInPkts, entry->icmpMsgStatsOutPkts, entry->flags ));
switch (subid) {
case ICMP_MSG_STAT_IN_PKTS:
diff --git a/agent/mibgroup/mibII/kernel_linux.c b/agent/mibgroup/mibII/kernel_linux.c
index b21a166..ba320c7 100644
--- a/agent/mibgroup/mibII/kernel_linux.c
+++ b/agent/mibgroup/mibII/kernel_linux.c
@@ -81,9 +81,9 @@ decode_icmp_msg(char *line, char *data, struct icmp4_msg_mib *msg)
index = strtol(token, &delim, 0);
if (ERANGE == errno) {
continue;
- } else if (index > LONG_MAX) {
+ } else if (index > 255) {
continue;
- } else if (index < LONG_MIN) {
+ } else if (index < 0) {
continue;
}
if (NULL == (token = strtok_r(dataptr, " ", &saveptr1)))
@@ -94,9 +94,9 @@ decode_icmp_msg(char *line, char *data, struct icmp4_msg_mib *msg)
index = strtol(token, &delim, 0);
if (ERANGE == errno) {
continue;
- } else if (index > LONG_MAX) {
+ } else if (index > 255) {
continue;
- } else if (index < LONG_MIN) {
+ } else if (index < 0) {
continue;
}
if(NULL == (token = strtok_r(dataptr, " ", &saveptr1)))
@@ -426,14 +426,21 @@ linux_read_icmp6_parse(struct icmp6_mib *icmp6stat,
vals = name;
if (NULL != icmp6msgstat) {
+ int type;
if (0 == strncmp(name, "Icmp6OutType", 12)) {
strsep(&vals, "e");
- icmp6msgstat->vals[atoi(vals)].OutType = stats;
+ type = atoi(vals);
+ if ( type < 0 || type > 255 )
+ continue;
+ icmp6msgstat->vals[type].OutType = stats;
*support = 1;
continue;
} else if (0 == strncmp(name, "Icmp6InType", 11)) {
strsep(&vals, "e");
- icmp6msgstat->vals[atoi(vals)].InType = stats;
+ type = atoi(vals);
+ if ( type < 0 || type > 255 )
+ continue;
+ icmp6msgstat->vals[type].InType = stats;
*support = 1;
continue;
}
diff --git a/agent/mibgroup/mibII/kernel_linux.h b/agent/mibgroup/mibII/kernel_linux.h
index 6bf5d47..c6dfca9 100644
--- a/agent/mibgroup/mibII/kernel_linux.h
+++ b/agent/mibgroup/mibII/kernel_linux.h
@@ -121,11 +121,11 @@ struct icmp_msg_mib {
/* Lets use wrapper structures for future expansion */
struct icmp4_msg_mib {
- struct icmp_msg_mib vals[255];
+ struct icmp_msg_mib vals[256];
};
struct icmp6_msg_mib {
- struct icmp_msg_mib vals[255];
+ struct icmp_msg_mib vals[256];
};
struct udp_mib {

View File

@ -1,23 +0,0 @@
895357 - net-snmp-python adds zeros to end of IP address (IPADDR type), which is not valid
Source: upstream commit 234158b8e84cc204cbac96e6e9be6959635404b8
--- a/python/netsnmp/client_intf.c
+++ a/python/netsnmp/client_intf.c
@@ -821,14 +821,14 @@ OCT:
case TYPE_IPADDR:
vars->type = ASN_IPADDRESS;
- vars->val.integer = (long *)malloc(sizeof(long));
+ vars->val.integer = (in_addr_t *)malloc(sizeof(in_addr_t));
if (val)
*(vars->val.integer) = inet_addr(val);
else {
ret = FAILURE;
*(vars->val.integer) = 0;
}
- vars->val_len = sizeof(long);
+ vars->val_len = sizeof(in_addr_t);
break;
case TYPE_OBJID:

View File

@ -57,10 +57,9 @@ Date: Tue Aug 9 10:53:43 2011 +0200
- update WantedBy in socket units as recommended by http://0pointer.de/blog/projects/socket-activation.html
- rephrase README.systemd
diff -up net-snmp-5.7.2/agent/snmpd.c.systemd net-snmp-5.7.2/agent/snmpd.c
--- net-snmp-5.7.2/agent/snmpd.c.systemd 2012-10-10 00:28:58.000000000 +0200
+++ net-snmp-5.7.2/agent/snmpd.c 2012-11-12 10:18:46.084369548 +0100
diff -up net-snmp-5.7.3/agent/snmpd.c.MPGqYh net-snmp-5.7.3/agent/snmpd.c
--- net-snmp-5.7.3/agent/snmpd.c.MPGqYh 2014-12-08 21:23:22.000000000 +0100
+++ net-snmp-5.7.3/agent/snmpd.c 2015-02-17 13:34:05.736221851 +0100
@@ -164,6 +164,10 @@ typedef long fd_mask;
#endif
@ -72,7 +71,7 @@ diff -up net-snmp-5.7.2/agent/snmpd.c.systemd net-snmp-5.7.2/agent/snmpd.c
netsnmp_feature_want(logging_file)
netsnmp_feature_want(logging_stdio)
netsnmp_feature_want(logging_syslog)
@@ -441,18 +445,26 @@ main(int argc, char *argv[])
@@ -443,18 +447,26 @@ main(int argc, char *argv[])
int agent_mode = -1;
char *pid_file = NULL;
char option_compatability[] = "-Le";
@ -101,7 +100,7 @@ diff -up net-snmp-5.7.2/agent/snmpd.c.systemd net-snmp-5.7.2/agent/snmpd.c
}
#endif /* #WIN32 */
@@ -1100,6 +1112,19 @@ main(int argc, char *argv[])
@@ -1107,6 +1119,19 @@ main(int argc, char *argv[])
netsnmp_addrcache_initialise();
/*
@ -121,9 +120,9 @@ diff -up net-snmp-5.7.2/agent/snmpd.c.systemd net-snmp-5.7.2/agent/snmpd.c
* Forever monitor the dest_port for incoming PDUs.
*/
DEBUGMSGTL(("snmpd/main", "We're up. Starting to process data.\n"));
diff -up net-snmp-5.7.2/apps/snmptrapd.c.systemd net-snmp-5.7.2/apps/snmptrapd.c
--- net-snmp-5.7.2/apps/snmptrapd.c.systemd 2012-10-10 00:28:58.000000000 +0200
+++ net-snmp-5.7.2/apps/snmptrapd.c 2012-11-12 10:18:46.084369548 +0100
diff -up net-snmp-5.7.3/apps/snmptrapd.c.MPGqYh net-snmp-5.7.3/apps/snmptrapd.c
--- net-snmp-5.7.3/apps/snmptrapd.c.MPGqYh 2014-12-08 21:23:22.000000000 +0100
+++ net-snmp-5.7.3/apps/snmptrapd.c 2015-02-17 13:34:05.736221851 +0100
@@ -125,6 +125,10 @@ SOFTWARE.
#include <net-snmp/net-snmp-features.h>
@ -135,7 +134,7 @@ diff -up net-snmp-5.7.2/apps/snmptrapd.c.systemd net-snmp-5.7.2/apps/snmptrapd.c
#ifndef BSD4_3
#define BSD4_2
#endif
@@ -655,15 +659,22 @@ main(int argc, char *argv[])
@@ -657,15 +661,22 @@ main(int argc, char *argv[])
int agentx_subagent = 1;
#endif
netsnmp_trapd_handler *traph;
@ -160,7 +159,7 @@ diff -up net-snmp-5.7.2/apps/snmptrapd.c.systemd net-snmp-5.7.2/apps/snmptrapd.c
}
#endif /* #WIN32 */
@@ -1311,6 +1322,19 @@ main(int argc, char *argv[])
@@ -1318,6 +1329,19 @@ main(int argc, char *argv[])
#endif
#endif
@ -180,9 +179,9 @@ diff -up net-snmp-5.7.2/apps/snmptrapd.c.systemd net-snmp-5.7.2/apps/snmptrapd.c
#ifdef WIN32SERVICE
trapd_status = SNMPTRAPD_RUNNING;
#endif
diff -up net-snmp-5.7.2/configure.d/config_modules_lib.systemd net-snmp-5.7.2/configure.d/config_modules_lib
--- net-snmp-5.7.2/configure.d/config_modules_lib.systemd 2012-10-10 00:28:58.000000000 +0200
+++ net-snmp-5.7.2/configure.d/config_modules_lib 2012-11-12 10:18:46.085369546 +0100
diff -up net-snmp-5.7.3/configure.d/config_modules_lib.MPGqYh net-snmp-5.7.3/configure.d/config_modules_lib
--- net-snmp-5.7.3/configure.d/config_modules_lib.MPGqYh 2014-12-08 21:23:22.000000000 +0100
+++ net-snmp-5.7.3/configure.d/config_modules_lib 2015-02-17 13:34:05.737221850 +0100
@@ -53,6 +53,14 @@ if test "x$PARTIALTARGETOS" = "xmingw32"
other_ftobjs_list="$other_ftobjs_list winpipe.ft"
fi
@ -198,9 +197,9 @@ diff -up net-snmp-5.7.2/configure.d/config_modules_lib.systemd net-snmp-5.7.2/co
AC_SUBST(other_src_list)
AC_SUBST(other_objs_list)
AC_SUBST(other_lobjs_list)
diff -up net-snmp-5.7.2/configure.d/config_project_with_enable.systemd net-snmp-5.7.2/configure.d/config_project_with_enable
--- net-snmp-5.7.2/configure.d/config_project_with_enable.systemd 2012-10-10 00:28:58.000000000 +0200
+++ net-snmp-5.7.2/configure.d/config_project_with_enable 2012-11-12 10:18:46.086369544 +0100
diff -up net-snmp-5.7.3/configure.d/config_project_with_enable.MPGqYh net-snmp-5.7.3/configure.d/config_project_with_enable
--- net-snmp-5.7.3/configure.d/config_project_with_enable.MPGqYh 2014-12-08 21:23:22.000000000 +0100
+++ net-snmp-5.7.3/configure.d/config_project_with_enable 2015-02-17 13:34:05.737221850 +0100
@@ -690,6 +690,15 @@ if test "x$with_dummy_values" != "xyes";
data for])
fi
@ -217,10 +216,10 @@ diff -up net-snmp-5.7.2/configure.d/config_project_with_enable.systemd net-snmp-
NETSNMP_ARG_ENABLE(set-support,
[ --disable-set-support Do not allow SNMP set requests.])
if test "x$enable_set_support" = "xno"; then
diff -up net-snmp-5.7.2/configure.systemd net-snmp-5.7.2/configure
--- net-snmp-5.7.2/configure.systemd 2012-10-10 00:35:37.000000000 +0200
+++ net-snmp-5.7.2/configure 2012-11-12 10:18:46.099369517 +0100
@@ -950,6 +950,8 @@ with_kmem_usage
diff -up net-snmp-5.7.3/configure.MPGqYh net-snmp-5.7.3/configure
--- net-snmp-5.7.3/configure.MPGqYh 2014-12-08 21:23:37.000000000 +0100
+++ net-snmp-5.7.3/configure 2015-02-17 13:34:05.744221845 +0100
@@ -951,6 +951,8 @@ with_kmem_usage
enable_kmem_usage
with_dummy_values
enable_dummy_values
@ -229,7 +228,7 @@ diff -up net-snmp-5.7.2/configure.systemd net-snmp-5.7.2/configure
enable_set_support
with_set_support
with_sys_contact
@@ -1866,6 +1868,8 @@ Configuring the agent:
@@ -1867,6 +1869,8 @@ Configuring the agent:
This is technically not compliant with the
SNMP specifications, but was how the agent
operated for versions < 4.0.
@ -238,7 +237,7 @@ diff -up net-snmp-5.7.2/configure.systemd net-snmp-5.7.2/configure
--with-sys-contact="who@where" Default system contact.
(Default: LOGIN@DOMAINNAME)
--with-sys-location="location" Default system location.
@@ -4397,6 +4401,24 @@ $as_echo "#define NETSNMP_NO_DUMMY_VALUE
@@ -4398,6 +4402,24 @@ $as_echo "#define NETSNMP_NO_DUMMY_VALUE
fi
@ -263,7 +262,7 @@ diff -up net-snmp-5.7.2/configure.systemd net-snmp-5.7.2/configure
# Check whether --enable-set-support was given.
if test "${enable_set_support+set}" = set; then :
enableval=$enable_set_support;
@@ -18239,6 +18261,14 @@ if test "x$PARTIALTARGETOS" = "xmingw32"
@@ -18639,6 +18661,14 @@ if test "x$PARTIALTARGETOS" = "xmingw32"
other_ftobjs_list="$other_ftobjs_list winpipe.ft"
fi
@ -278,9 +277,9 @@ diff -up net-snmp-5.7.2/configure.systemd net-snmp-5.7.2/configure
diff -up net-snmp-5.7.2/dist/snmpd.service.systemd net-snmp-5.7.2/dist/snmpd.service
--- net-snmp-5.7.2/dist/snmpd.service.systemd 2012-11-12 10:18:46.104369507 +0100
+++ net-snmp-5.7.2/dist/snmpd.service 2012-11-12 10:18:46.104369507 +0100
diff -up net-snmp-5.7.3/dist/snmpd.service.MPGqYh net-snmp-5.7.3/dist/snmpd.service
--- net-snmp-5.7.3/dist/snmpd.service.MPGqYh 2015-02-17 13:34:05.745221844 +0100
+++ net-snmp-5.7.3/dist/snmpd.service 2015-02-17 13:34:05.745221844 +0100
@@ -0,0 +1,18 @@
+#
+# SNMP agent service file for systemd
@ -300,9 +299,9 @@ diff -up net-snmp-5.7.2/dist/snmpd.service.systemd net-snmp-5.7.2/dist/snmpd.ser
+
+[Install]
+WantedBy=multi-user.target
diff -up net-snmp-5.7.2/dist/snmpd.socket.systemd net-snmp-5.7.2/dist/snmpd.socket
--- net-snmp-5.7.2/dist/snmpd.socket.systemd 2012-11-12 10:18:46.104369507 +0100
+++ net-snmp-5.7.2/dist/snmpd.socket 2012-11-12 10:18:46.104369507 +0100
diff -up net-snmp-5.7.3/dist/snmpd.socket.MPGqYh net-snmp-5.7.3/dist/snmpd.socket
--- net-snmp-5.7.3/dist/snmpd.socket.MPGqYh 2015-02-17 13:34:05.745221844 +0100
+++ net-snmp-5.7.3/dist/snmpd.socket 2015-02-17 13:34:05.745221844 +0100
@@ -0,0 +1,17 @@
+[Unit]
+Description=Socket listening for SNMP and AgentX messages
@ -321,9 +320,9 @@ diff -up net-snmp-5.7.2/dist/snmpd.socket.systemd net-snmp-5.7.2/dist/snmpd.sock
+
+[Install]
+WantedBy=sockets.target
diff -up net-snmp-5.7.2/dist/snmptrapd.service.systemd net-snmp-5.7.2/dist/snmptrapd.service
--- net-snmp-5.7.2/dist/snmptrapd.service.systemd 2012-11-12 10:18:46.105369505 +0100
+++ net-snmp-5.7.2/dist/snmptrapd.service 2012-11-12 10:18:46.105369505 +0100
diff -up net-snmp-5.7.3/dist/snmptrapd.service.MPGqYh net-snmp-5.7.3/dist/snmptrapd.service
--- net-snmp-5.7.3/dist/snmptrapd.service.MPGqYh 2015-02-17 13:34:05.745221844 +0100
+++ net-snmp-5.7.3/dist/snmptrapd.service 2015-02-17 13:34:05.745221844 +0100
@@ -0,0 +1,16 @@
+#
+# SNMP trap-processing service file for systemd
@ -341,9 +340,9 @@ diff -up net-snmp-5.7.2/dist/snmptrapd.service.systemd net-snmp-5.7.2/dist/snmpt
+
+[Install]
+WantedBy=multi-user.target
diff -up net-snmp-5.7.2/dist/snmptrapd.socket.systemd net-snmp-5.7.2/dist/snmptrapd.socket
--- net-snmp-5.7.2/dist/snmptrapd.socket.systemd 2012-11-12 10:18:46.105369505 +0100
+++ net-snmp-5.7.2/dist/snmptrapd.socket 2012-11-12 10:18:46.105369505 +0100
diff -up net-snmp-5.7.3/dist/snmptrapd.socket.MPGqYh net-snmp-5.7.3/dist/snmptrapd.socket
--- net-snmp-5.7.3/dist/snmptrapd.socket.MPGqYh 2015-02-17 13:34:05.745221844 +0100
+++ net-snmp-5.7.3/dist/snmptrapd.socket 2015-02-17 13:34:05.745221844 +0100
@@ -0,0 +1,14 @@
+[Unit]
+Description=Socket listening for SNMP trap messages
@ -359,9 +358,9 @@ diff -up net-snmp-5.7.2/dist/snmptrapd.socket.systemd net-snmp-5.7.2/dist/snmptr
+
+[Install]
+WantedBy=sockets.target
diff -up net-snmp-5.7.2/include/net-snmp/library/sd-daemon.h.systemd net-snmp-5.7.2/include/net-snmp/library/sd-daemon.h
--- net-snmp-5.7.2/include/net-snmp/library/sd-daemon.h.systemd 2012-11-12 10:18:46.106369503 +0100
+++ net-snmp-5.7.2/include/net-snmp/library/sd-daemon.h 2012-11-12 10:18:46.106369503 +0100
diff -up net-snmp-5.7.3/include/net-snmp/library/sd-daemon.h.MPGqYh net-snmp-5.7.3/include/net-snmp/library/sd-daemon.h
--- net-snmp-5.7.3/include/net-snmp/library/sd-daemon.h.MPGqYh 2015-02-17 13:34:05.746221843 +0100
+++ net-snmp-5.7.3/include/net-snmp/library/sd-daemon.h 2015-02-17 13:34:05.746221843 +0100
@@ -0,0 +1,286 @@
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
+
@ -649,10 +648,10 @@ diff -up net-snmp-5.7.2/include/net-snmp/library/sd-daemon.h.systemd net-snmp-5.
+#endif
+
+#endif /* SNMPD_SD_DAEMON_H */
diff -up net-snmp-5.7.2/include/net-snmp/net-snmp-config.h.in.systemd net-snmp-5.7.2/include/net-snmp/net-snmp-config.h.in
--- net-snmp-5.7.2/include/net-snmp/net-snmp-config.h.in.systemd 2012-10-10 00:28:58.000000000 +0200
+++ net-snmp-5.7.2/include/net-snmp/net-snmp-config.h.in 2012-11-12 10:18:46.107369501 +0100
@@ -1389,6 +1389,9 @@
diff -up net-snmp-5.7.3/include/net-snmp/net-snmp-config.h.in.MPGqYh net-snmp-5.7.3/include/net-snmp/net-snmp-config.h.in
--- net-snmp-5.7.3/include/net-snmp/net-snmp-config.h.in.MPGqYh 2014-12-08 21:23:22.000000000 +0100
+++ net-snmp-5.7.3/include/net-snmp/net-snmp-config.h.in 2015-02-17 13:34:05.746221843 +0100
@@ -1410,6 +1410,9 @@
/* If you don't have root access don't exit upon kmem errors */
#undef NETSNMP_NO_ROOT_ACCESS
@ -662,9 +661,9 @@ diff -up net-snmp-5.7.2/include/net-snmp/net-snmp-config.h.in.systemd net-snmp-5
/* Define if you want to remove all SET/write access from the code */
#undef NETSNMP_NO_WRITE_SUPPORT
diff -up net-snmp-5.7.2/README.systemd.systemd net-snmp-5.7.2/README.systemd
--- net-snmp-5.7.2/README.systemd.systemd 2012-11-12 10:18:46.108369499 +0100
+++ net-snmp-5.7.2/README.systemd 2012-11-12 10:18:46.108369499 +0100
diff -up net-snmp-5.7.3/README.systemd.MPGqYh net-snmp-5.7.3/README.systemd
--- net-snmp-5.7.3/README.systemd.MPGqYh 2015-02-17 13:34:05.747221843 +0100
+++ net-snmp-5.7.3/README.systemd 2015-02-17 13:34:05.747221843 +0100
@@ -0,0 +1,41 @@
+README.systemd
+--------------
@ -708,9 +707,9 @@ diff -up net-snmp-5.7.2/README.systemd.systemd net-snmp-5.7.2/README.systemd
+start during boot and not after first SNMP trap arrives. Same rules as for snmpd
+applies then.
\ No newline at end of file
diff -up net-snmp-5.7.2/snmplib/sd-daemon.c.systemd net-snmp-5.7.2/snmplib/sd-daemon.c
--- net-snmp-5.7.2/snmplib/sd-daemon.c.systemd 2012-11-12 10:18:46.109369497 +0100
+++ net-snmp-5.7.2/snmplib/sd-daemon.c 2012-11-12 10:18:46.109369497 +0100
diff -up net-snmp-5.7.3/snmplib/sd-daemon.c.MPGqYh net-snmp-5.7.3/snmplib/sd-daemon.c
--- net-snmp-5.7.3/snmplib/sd-daemon.c.MPGqYh 2015-02-17 13:34:05.747221843 +0100
+++ net-snmp-5.7.3/snmplib/sd-daemon.c 2015-02-17 13:34:05.747221843 +0100
@@ -0,0 +1,532 @@
+/*
+ * Systemd integration parts.
@ -1244,9 +1243,9 @@ diff -up net-snmp-5.7.2/snmplib/sd-daemon.c.systemd net-snmp-5.7.2/snmplib/sd-da
+}
+
+#endif /* ! NETSNMP_NO_SYSTEMD */
diff -up net-snmp-5.7.2/snmplib/transports/snmpTCPDomain.c.systemd net-snmp-5.7.2/snmplib/transports/snmpTCPDomain.c
--- net-snmp-5.7.2/snmplib/transports/snmpTCPDomain.c.systemd 2012-10-10 00:28:58.000000000 +0200
+++ net-snmp-5.7.2/snmplib/transports/snmpTCPDomain.c 2012-11-12 10:19:41.767217067 +0100
diff -up net-snmp-5.7.3/snmplib/transports/snmpTCPDomain.c.MPGqYh net-snmp-5.7.3/snmplib/transports/snmpTCPDomain.c
--- net-snmp-5.7.3/snmplib/transports/snmpTCPDomain.c.MPGqYh 2014-12-08 21:23:22.000000000 +0100
+++ net-snmp-5.7.3/snmplib/transports/snmpTCPDomain.c 2015-02-17 13:34:05.748221842 +0100
@@ -43,6 +43,10 @@
#include <net-snmp/library/snmpTCPBaseDomain.h>
#include <net-snmp/library/tools.h>
@ -1326,9 +1325,9 @@ diff -up net-snmp-5.7.2/snmplib/transports/snmpTCPDomain.c.systemd net-snmp-5.7.
}
/*
diff -up net-snmp-5.7.2/snmplib/transports/snmpTCPIPv6Domain.c.systemd net-snmp-5.7.2/snmplib/transports/snmpTCPIPv6Domain.c
--- net-snmp-5.7.2/snmplib/transports/snmpTCPIPv6Domain.c.systemd 2012-10-10 00:28:58.000000000 +0200
+++ net-snmp-5.7.2/snmplib/transports/snmpTCPIPv6Domain.c 2012-11-12 10:20:32.019078971 +0100
diff -up net-snmp-5.7.3/snmplib/transports/snmpTCPIPv6Domain.c.MPGqYh net-snmp-5.7.3/snmplib/transports/snmpTCPIPv6Domain.c
--- net-snmp-5.7.3/snmplib/transports/snmpTCPIPv6Domain.c.MPGqYh 2014-12-08 21:23:22.000000000 +0100
+++ net-snmp-5.7.3/snmplib/transports/snmpTCPIPv6Domain.c 2015-02-17 13:34:05.748221842 +0100
@@ -49,6 +49,10 @@
#include <net-snmp/library/snmpTCPBaseDomain.h>
#include <net-snmp/library/tools.h>
@ -1409,9 +1408,9 @@ diff -up net-snmp-5.7.2/snmplib/transports/snmpTCPIPv6Domain.c.systemd net-snmp-
}
/*
diff -up net-snmp-5.7.2/snmplib/transports/snmpUDPIPv4BaseDomain.c.systemd net-snmp-5.7.2/snmplib/transports/snmpUDPIPv4BaseDomain.c
--- net-snmp-5.7.2/snmplib/transports/snmpUDPIPv4BaseDomain.c.systemd 2012-10-10 00:28:58.000000000 +0200
+++ net-snmp-5.7.2/snmplib/transports/snmpUDPIPv4BaseDomain.c 2012-11-12 10:22:30.279750750 +0100
diff -up net-snmp-5.7.3/snmplib/transports/snmpUDPIPv4BaseDomain.c.MPGqYh net-snmp-5.7.3/snmplib/transports/snmpUDPIPv4BaseDomain.c
--- net-snmp-5.7.3/snmplib/transports/snmpUDPIPv4BaseDomain.c.MPGqYh 2014-12-08 21:23:22.000000000 +0100
+++ net-snmp-5.7.3/snmplib/transports/snmpUDPIPv4BaseDomain.c 2015-02-17 13:36:22.744123462 +0100
@@ -40,6 +40,10 @@
#include <net-snmp/library/snmpSocketBaseDomain.h>
@ -1420,10 +1419,10 @@ diff -up net-snmp-5.7.2/snmplib/transports/snmpUDPIPv4BaseDomain.c.systemd net-s
+#include <net-snmp/library/sd-daemon.h>
+#endif
+
#if (defined(linux) && defined(IP_PKTINFO)) \
|| defined(IP_RECVDSTADDR) && HAVE_STRUCT_MSGHDR_MSG_CONTROL \
&& HAVE_STRUCT_MSGHDR_MSG_FLAGS
@@ -67,6 +71,7 @@ netsnmp_udpipv4base_transport(struct soc
#if defined(HAVE_IP_PKTINFO) || defined(HAVE_IP_RECVDSTADDR)
int netsnmp_udpipv4_recvfrom(int s, void *buf, int len, struct sockaddr *from,
socklen_t *fromlen, struct sockaddr *dstip,
@@ -64,6 +68,7 @@ netsnmp_udpipv4base_transport(struct soc
char *client_socket = NULL;
netsnmp_indexed_addr_pair addr_pair;
socklen_t local_addr_len;
@ -1431,7 +1430,7 @@ diff -up net-snmp-5.7.2/snmplib/transports/snmpUDPIPv4BaseDomain.c.systemd net-s
#ifdef NETSNMP_NO_LISTEN_SUPPORT
if (local)
@@ -91,7 +96,20 @@ netsnmp_udpipv4base_transport(struct soc
@@ -88,7 +93,20 @@ netsnmp_udpipv4base_transport(struct soc
free(str);
}
@ -1453,17 +1452,16 @@ diff -up net-snmp-5.7.2/snmplib/transports/snmpUDPIPv4BaseDomain.c.systemd net-s
DEBUGMSGTL(("UDPBase", "openned socket %d as local=%d\n", t->sock, local));
if (t->sock < 0) {
netsnmp_transport_free(t);
@@ -141,13 +159,15 @@ netsnmp_udpipv4base_transport(struct soc
DEBUGMSGTL(("netsnmp_udp", "set IP_RECVDSTADDR\n"));
@@ -151,12 +169,14 @@ netsnmp_udpipv4base_transport(struct soc
}
}
#endif
#endif /* !defined(WIN32) */
- rc = bind(t->sock, (struct sockaddr *) addr,
- sizeof(struct sockaddr));
- if (rc != 0) {
- netsnmp_socketbase_close(t);
- netsnmp_transport_free(t);
- return NULL;
- }
+ if (!socket_initialized) {
+ rc = bind(t->sock, (struct sockaddr *) addr,
+ sizeof(struct sockaddr));
@ -1472,13 +1470,12 @@ diff -up net-snmp-5.7.2/snmplib/transports/snmpUDPIPv4BaseDomain.c.systemd net-s
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+ }
}
t->data = NULL;
t->data_length = 0;
#else /* NETSNMP_NO_LISTEN_SUPPORT */
diff -up net-snmp-5.7.2/snmplib/transports/snmpUDPIPv6Domain.c.systemd net-snmp-5.7.2/snmplib/transports/snmpUDPIPv6Domain.c
--- net-snmp-5.7.2/snmplib/transports/snmpUDPIPv6Domain.c.systemd 2012-10-10 00:28:58.000000000 +0200
+++ net-snmp-5.7.2/snmplib/transports/snmpUDPIPv6Domain.c 2012-11-12 10:23:19.713603003 +0100
diff -up net-snmp-5.7.3/snmplib/transports/snmpUDPIPv6Domain.c.MPGqYh net-snmp-5.7.3/snmplib/transports/snmpUDPIPv6Domain.c
--- net-snmp-5.7.3/snmplib/transports/snmpUDPIPv6Domain.c.MPGqYh 2014-12-08 21:23:22.000000000 +0100
+++ net-snmp-5.7.3/snmplib/transports/snmpUDPIPv6Domain.c 2015-02-17 13:37:16.256087147 +0100
@@ -67,6 +67,10 @@ static const struct in6_addr in6addr_any
#include <net-snmp/library/snmpSocketBaseDomain.h>
#include <net-snmp/library/tools.h>
@ -1520,8 +1517,8 @@ diff -up net-snmp-5.7.2/snmplib/transports/snmpUDPIPv6Domain.c.systemd net-snmp-
netsnmp_transport_free(t);
return NULL;
@@ -242,13 +259,14 @@ netsnmp_udp6_transport(struct sockaddr_i
}
}
}
}
#endif
-
- rc = bind(t->sock, (struct sockaddr *) addr,
@ -1541,9 +1538,9 @@ diff -up net-snmp-5.7.2/snmplib/transports/snmpUDPIPv6Domain.c.systemd net-snmp-
}
t->local = (unsigned char*)malloc(18);
if (t->local == NULL) {
diff -up net-snmp-5.7.2/snmplib/transports/snmpUnixDomain.c.systemd net-snmp-5.7.2/snmplib/transports/snmpUnixDomain.c
--- net-snmp-5.7.2/snmplib/transports/snmpUnixDomain.c.systemd 2012-10-10 00:28:58.000000000 +0200
+++ net-snmp-5.7.2/snmplib/transports/snmpUnixDomain.c 2012-11-12 10:24:02.803466358 +0100
diff -up net-snmp-5.7.3/snmplib/transports/snmpUnixDomain.c.MPGqYh net-snmp-5.7.3/snmplib/transports/snmpUnixDomain.c
--- net-snmp-5.7.3/snmplib/transports/snmpUnixDomain.c.MPGqYh 2014-12-08 21:23:22.000000000 +0100
+++ net-snmp-5.7.3/snmplib/transports/snmpUnixDomain.c 2015-02-17 13:34:05.749221841 +0100
@@ -37,6 +37,10 @@
#include <net-snmp/library/system.h> /* mkdirhier */
#include <net-snmp/library/tools.h>

View File

@ -1,446 +0,0 @@
commit 7f4a7b891332899cea26e95be0337aae01648742
Author: Jan Safranek <jsafranek@users.sourceforge.net>
Date: Thu Jul 31 13:46:49 2014 +0200
Added checks for printing variables with wrong types.
When -OQ command line argument is used, variable formatter preffers the type
of the varible parsed from a MIB file instead of checking type of the variable
as parsed from SNMP message.
This can lead to crashes when incoming packets contains a variable with
NULL type, while the MIB says the variable should be non-NULL, like Integer.
The formatter then tries to interpret the NULL (from packet) as Integer (from
MIB file).
diff --git a/snmplib/mib.c b/snmplib/mib.c
index 9d3ca41..c6e0010 100644
--- a/snmplib/mib.c
+++ b/snmplib/mib.c
@@ -439,17 +439,16 @@ sprint_realloc_octet_string(u_char ** buf, size_t * buf_len,
u_char *cp;
int output_format, cnt;
- if ((var->type != ASN_OCTET_STR) &&
- (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
- const char str[] = "Wrong Type (should be OCTET STRING): ";
- if (snmp_cstrcat
- (buf, buf_len, out_len, allow_realloc, str)) {
- return sprint_realloc_by_type(buf, buf_len, out_len,
+ if (var->type != ASN_OCTET_STR) {
+ if (!netsnmp_ds_get_boolean(
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) {
+ const char str[] = "Wrong Type (should be OCTET STRING): ";
+ if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc, str))
+ return 0;
+ }
+ return sprint_realloc_by_type(buf, buf_len, out_len,
allow_realloc, var, NULL, NULL,
NULL);
- } else {
- return 0;
- }
}
@@ -702,16 +701,16 @@ sprint_realloc_float(u_char ** buf, size_t * buf_len,
const struct enum_list *enums,
const char *hint, const char *units)
{
- if ((var->type != ASN_OPAQUE_FLOAT) &&
- (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
- if (snmp_cstrcat(buf, buf_len, out_len, allow_realloc,
- "Wrong Type (should be Float): ")) {
- return sprint_realloc_by_type(buf, buf_len, out_len,
+ if (var->type != ASN_OPAQUE_FLOAT) {
+ if (!netsnmp_ds_get_boolean(
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) {
+ u_char str[] = "Wrong Type (should be Float): ";
+ if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str))
+ return 0;
+ }
+ return sprint_realloc_by_type(buf, buf_len, out_len,
allow_realloc, var, NULL, NULL,
NULL);
- } else {
- return 0;
- }
}
if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {
@@ -772,17 +771,16 @@ sprint_realloc_double(u_char ** buf, size_t * buf_len,
const struct enum_list *enums,
const char *hint, const char *units)
{
- if ((var->type != ASN_OPAQUE_DOUBLE) &&
- (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
- if (snmp_cstrcat
- (buf, buf_len, out_len, allow_realloc,
- "Wrong Type (should be Double): ")) {
- return sprint_realloc_by_type(buf, buf_len, out_len,
+ if (var->type != ASN_OPAQUE_DOUBLE) {
+ if (!netsnmp_ds_get_boolean(
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) {
+ u_char str[] = "Wrong Type (should be Double): ";
+ if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str))
+ return 0;
+ }
+ return sprint_realloc_by_type(buf, buf_len, out_len,
allow_realloc, var, NULL, NULL,
NULL);
- } else {
- return 0;
- }
}
if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {
@@ -847,20 +845,21 @@ sprint_realloc_counter64(u_char ** buf, size_t * buf_len, size_t * out_len,
{
char a64buf[I64CHARSZ + 1];
- if ((var->type != ASN_COUNTER64
+ if (var->type != ASN_COUNTER64
#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
&& var->type != ASN_OPAQUE_COUNTER64
&& var->type != ASN_OPAQUE_I64 && var->type != ASN_OPAQUE_U64
#endif
- ) && (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
- if (snmp_cstrcat(buf, buf_len, out_len, allow_realloc,
- "Wrong Type (should be Counter64): ")) {
- return sprint_realloc_by_type(buf, buf_len, out_len,
+ ) {
+ if (!netsnmp_ds_get_boolean(
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) {
+ u_char str[] = "Wrong Type (should be Counter64): ";
+ if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str))
+ return 0;
+ }
+ return sprint_realloc_by_type(buf, buf_len, out_len,
allow_realloc, var, NULL, NULL,
NULL);
- } else {
- return 0;
- }
}
if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {
@@ -948,23 +947,25 @@ sprint_realloc_opaque(u_char ** buf, size_t * buf_len,
const struct enum_list *enums,
const char *hint, const char *units)
{
- if ((var->type != ASN_OPAQUE
+ if (var->type != ASN_OPAQUE
#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
&& var->type != ASN_OPAQUE_COUNTER64
&& var->type != ASN_OPAQUE_U64
&& var->type != ASN_OPAQUE_I64
&& var->type != ASN_OPAQUE_FLOAT && var->type != ASN_OPAQUE_DOUBLE
#endif /* NETSNMP_WITH_OPAQUE_SPECIAL_TYPES */
- ) && (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
- if (snmp_cstrcat(buf, buf_len, out_len, allow_realloc,
- "Wrong Type (should be Opaque): ")) {
- return sprint_realloc_by_type(buf, buf_len, out_len,
+ ) {
+ if (!netsnmp_ds_get_boolean(
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) {
+ u_char str[] = "Wrong Type (should be Opaque): ";
+ if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str))
+ return 0;
+ }
+ return sprint_realloc_by_type(buf, buf_len, out_len,
allow_realloc, var, NULL, NULL,
NULL);
- } else {
- return 0;
- }
}
+
#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
switch (var->type) {
case ASN_OPAQUE_COUNTER64:
@@ -1040,17 +1041,16 @@ sprint_realloc_object_identifier(u_char ** buf, size_t * buf_len,
{
int buf_overflow = 0;
- if ((var->type != ASN_OBJECT_ID) &&
- (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
- u_char str[] =
- "Wrong Type (should be OBJECT IDENTIFIER): ";
- if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
- return sprint_realloc_by_type(buf, buf_len, out_len,
+ if (var->type != ASN_OBJECT_ID) {
+ if (!netsnmp_ds_get_boolean(
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) {
+ u_char str[] = "Wrong Type (should be OBJECT IDENTIFIER): ";
+ if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str))
+ return 0;
+ }
+ return sprint_realloc_by_type(buf, buf_len, out_len,
allow_realloc, var, NULL, NULL,
NULL);
- } else {
- return 0;
- }
}
if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {
@@ -1110,16 +1110,16 @@ sprint_realloc_timeticks(u_char ** buf, size_t * buf_len, size_t * out_len,
{
char timebuf[40];
- if ((var->type != ASN_TIMETICKS) &&
- (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
- u_char str[] = "Wrong Type (should be Timeticks): ";
- if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
- return sprint_realloc_by_type(buf, buf_len, out_len,
+ if (var->type != ASN_TIMETICKS) {
+ if (!netsnmp_ds_get_boolean(
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) {
+ u_char str[] = "Wrong Type (should be Timeticks): ";
+ if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str))
+ return 0;
+ }
+ return sprint_realloc_by_type(buf, buf_len, out_len,
allow_realloc, var, NULL, NULL,
NULL);
- } else {
- return 0;
- }
}
if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_NUMERIC_TIMETICKS)) {
@@ -1277,17 +1277,18 @@ sprint_realloc_integer(u_char ** buf, size_t * buf_len, size_t * out_len,
{
char *enum_string = NULL;
- if ((var->type != ASN_INTEGER) &&
- (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
- u_char str[] = "Wrong Type (should be INTEGER): ";
- if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
- return sprint_realloc_by_type(buf, buf_len, out_len,
+ if (var->type != ASN_INTEGER) {
+ if (!netsnmp_ds_get_boolean(
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) {
+ u_char str[] = "Wrong Type (should be INTEGER): ";
+ if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str))
+ return 0;
+ }
+ return sprint_realloc_by_type(buf, buf_len, out_len,
allow_realloc, var, NULL, NULL,
NULL);
- } else {
- return 0;
- }
}
+
for (; enums; enums = enums->next) {
if (enums->value == *var->val.integer) {
enum_string = enums->label;
@@ -1380,16 +1381,16 @@ sprint_realloc_uinteger(u_char ** buf, size_t * buf_len, size_t * out_len,
{
char *enum_string = NULL;
- if ((var->type != ASN_UINTEGER) &&
- (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
- u_char str[] = "Wrong Type (should be UInteger32): ";
- if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
- return sprint_realloc_by_type(buf, buf_len, out_len,
+ if (var->type != ASN_UINTEGER) {
+ if (!netsnmp_ds_get_boolean(
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) {
+ u_char str[] = "Wrong Type (should be UInteger32): ";
+ if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str))
+ return 0;
+ }
+ return sprint_realloc_by_type(buf, buf_len, out_len,
allow_realloc, var, NULL, NULL,
NULL);
- } else {
- return 0;
- }
}
for (; enums; enums = enums->next) {
@@ -1477,17 +1478,16 @@ sprint_realloc_gauge(u_char ** buf, size_t * buf_len, size_t * out_len,
{
char tmp[32];
- if ((var->type != ASN_GAUGE) &&
- (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
- u_char str[] =
- "Wrong Type (should be Gauge32 or Unsigned32): ";
- if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
- return sprint_realloc_by_type(buf, buf_len, out_len,
+ if (var->type != ASN_GAUGE) {
+ if (!netsnmp_ds_get_boolean(
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) {
+ u_char str[] = "Wrong Type (should be Gauge32 or Unsigned32): ";
+ if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str))
+ return 0;
+ }
+ return sprint_realloc_by_type(buf, buf_len, out_len,
allow_realloc, var, NULL, NULL,
NULL);
- } else {
- return 0;
- }
}
if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {
@@ -1550,16 +1550,16 @@ sprint_realloc_counter(u_char ** buf, size_t * buf_len, size_t * out_len,
{
char tmp[32];
- if ((var->type != ASN_COUNTER) &&
- (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
- u_char str[] = "Wrong Type (should be Counter32): ";
- if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
- return sprint_realloc_by_type(buf, buf_len, out_len,
+ if (var->type != ASN_COUNTER) {
+ if (!netsnmp_ds_get_boolean(
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) {
+ u_char str[] = "Wrong Type (should be Counter32): ";
+ if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str))
+ return 0;
+ }
+ return sprint_realloc_by_type(buf, buf_len, out_len,
allow_realloc, var, NULL, NULL,
NULL);
- } else {
- return 0;
- }
}
if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {
@@ -1613,16 +1613,16 @@ sprint_realloc_networkaddress(u_char ** buf, size_t * buf_len,
{
size_t i;
- if ((var->type != ASN_IPADDRESS) &&
- (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
- u_char str[] = "Wrong Type (should be NetworkAddress): ";
- if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
- return sprint_realloc_by_type(buf, buf_len, out_len,
+ if (var->type != ASN_IPADDRESS) {
+ if (!netsnmp_ds_get_boolean(
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) {
+ u_char str[] = "Wrong Type (should be NetworkAddress): ";
+ if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str))
+ return 0;
+ }
+ return sprint_realloc_by_type(buf, buf_len, out_len,
allow_realloc, var, NULL, NULL,
NULL);
- } else {
- return 0;
- }
}
if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {
@@ -1679,16 +1679,16 @@ sprint_realloc_ipaddress(u_char ** buf, size_t * buf_len, size_t * out_len,
{
u_char *ip = var->val.string;
- if ((var->type != ASN_IPADDRESS) &&
- (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
- u_char str[] = "Wrong Type (should be IpAddress): ";
- if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
- return sprint_realloc_by_type(buf, buf_len, out_len,
+ if (var->type != ASN_IPADDRESS) {
+ if (!netsnmp_ds_get_boolean(
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) {
+ u_char str[] = "Wrong Type (should be IpAddress): ";
+ if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str))
+ return 0;
+ }
+ return sprint_realloc_by_type(buf, buf_len, out_len,
allow_realloc, var, NULL, NULL,
NULL);
- } else {
- return 0;
- }
}
if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {
@@ -1737,20 +1737,20 @@ sprint_realloc_null(u_char ** buf, size_t * buf_len, size_t * out_len,
const struct enum_list *enums,
const char *hint, const char *units)
{
- if ((var->type != ASN_NULL) &&
- (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
- u_char str[] = "Wrong Type (should be NULL): ";
- if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
- return sprint_realloc_by_type(buf, buf_len, out_len,
+ if (var->type != ASN_NULL) {
+ if (!netsnmp_ds_get_boolean(
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) {
+ u_char str[] = "Wrong Type (should be NULL): ";
+ if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str))
+ return 0;
+ }
+ return sprint_realloc_by_type(buf, buf_len, out_len,
allow_realloc, var, NULL, NULL,
NULL);
- } else {
- return 0;
- }
- } else {
- u_char str[] = "NULL";
- return snmp_strcat(buf, buf_len, out_len, allow_realloc, str);
}
+
+ u_char str[] = "NULL";
+ return snmp_strcat(buf, buf_len, out_len, allow_realloc, str);
}
@@ -1785,16 +1785,16 @@ sprint_realloc_bitstring(u_char ** buf, size_t * buf_len, size_t * out_len,
u_char *cp;
char *enum_string;
- if ((var->type != ASN_BIT_STR && var->type != ASN_OCTET_STR) &&
- (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
- u_char str[] = "Wrong Type (should be BITS): ";
- if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
- return sprint_realloc_by_type(buf, buf_len, out_len,
+ if (var->type != ASN_BIT_STR && var->type != ASN_OCTET_STR) {
+ if (!netsnmp_ds_get_boolean(
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) {
+ u_char str[] = "Wrong Type (should be BITS): ";
+ if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str))
+ return 0;
+ }
+ return sprint_realloc_by_type(buf, buf_len, out_len,
allow_realloc, var, NULL, NULL,
NULL);
- } else {
- return 0;
- }
}
if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {
@@ -1869,16 +1869,16 @@ sprint_realloc_nsapaddress(u_char ** buf, size_t * buf_len,
const struct enum_list *enums, const char *hint,
const char *units)
{
- if ((var->type != ASN_NSAP) &&
- (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
- u_char str[] = "Wrong Type (should be NsapAddress): ";
- if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
- return sprint_realloc_by_type(buf, buf_len, out_len,
+ if (var->type != ASN_NSAP) {
+ if (!netsnmp_ds_get_boolean(
+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) {
+ u_char str[] = "Wrong Type (should be NsapAddress): ";
+ if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str))
+ return 0;
+ }
+ return sprint_realloc_by_type(buf, buf_len, out_len,
allow_realloc, var, NULL, NULL,
NULL);
- } else {
- return 0;
- }
}
if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {

View File

@ -10,8 +10,8 @@
Summary: A collection of SNMP protocol tools and libraries
Name: net-snmp
Version: 5.7.2
Release: 24%{?dist}
Version: 5.7.3
Release: 1%{?dist}
Epoch: 1
License: BSD
@ -36,15 +36,11 @@ Patch3: net-snmp-5.6-multilib.patch
Patch4: net-snmp-5.5-apsl-copying.patch
Patch5: net-snmp-5.6-test-debug.patch
Patch6: net-snmp-5.7.2-systemd.patch
Patch7: net-snmp-5.7.2-python-ipaddress-size.patch
Patch8: net-snmp-5.7.2-create-user-multilib.patch
Patch9: net-snmp-5.7.2-autoreconf.patch
Patch10: net-snmp-5.7.2-btrfs.patch
Patch11: net-snmp-5.7-agentx-crash.patch
Patch12: net-snmp-5.5-agentx-disconnect-crash.patch
Patch13: net-snmp-5.7.2-icmp-mib.patch
Patch14: net-snmp-CVE-2014-3565.patch
Patch15: net-snmp-5.7.2-cert-path.patch
Patch7: net-snmp-5.7.2-create-user-multilib.patch
Patch8: net-snmp-5.7.2-autoreconf.patch
Patch9: net-snmp-5.7-agentx-crash.patch
Patch10: net-snmp-5.5-agentx-disconnect-crash.patch
Patch11: net-snmp-5.7.2-cert-path.patch
Requires(post): chkconfig
Requires(preun): chkconfig
@ -205,15 +201,11 @@ cp %{SOURCE12} .
%patch4 -p1 -b .apsl
%patch5 -p1
%patch6 -p1 -b .systemd
%patch7 -p1 -b .ipaddress-size
%patch8 -p1 -b .multilib
%patch9 -p1 -b .autoreconf
%patch10 -p1 -b .btrfs
%patch11 -p1 -b .agentx-crash
%patch12 -p1 -b .agentx-disconnect-crash
%patch13 -p1 -b .icmp-mib
%patch14 -p1 -b .CVE-2014-3565
%patch15 -p1 -b .cert-path
%patch7 -p1 -b .multilib
%patch8 -p1 -b .autoreconf
%patch9 -p1 -b .agentx-crash
%patch10 -p1 -b .agentx-disconnect-crash
%patch11 -p1 -b .cert-path
%ifarch sparc64 s390 s390x
# disable failing test - see https://bugzilla.redhat.com/show_bug.cgi?id=680697
@ -515,6 +507,9 @@ rm -rf ${RPM_BUILD_ROOT}
%{_initrddir}/snmptrapd
%changelog
* Tue Feb 17 2015 Jan Safranek <jsafrane@redhat.com> - 1:5.7.3-1
- Update to 5.7.3
* Fri Sep 05 2014 Jitka Plesnikova <jplesnik@redhat.com> - 1:5.7.2-24
- Perl 5.20 rebuild