changed debian/source/format to native

This commit is contained in:
Lu zhiping 2022-06-27 15:01:27 +08:00
parent ece77a0814
commit 81793af677
41 changed files with 1 additions and 1927 deletions

View File

@ -1,22 +0,0 @@
From: Hideki Yamane <henrich@debian.org>
Date: Thu, 28 Jan 2016 21:38:09 +0900
Subject: fix Bug#785380 incorrect date format
---
local/traptoemail | 3 +++
1 file changed, 3 insertions(+)
diff --git a/local/traptoemail b/local/traptoemail
index e738ba7..cadc18b 100755
--- a/local/traptoemail
+++ b/local/traptoemail
@@ -13,6 +13,9 @@ use Net::SMTP;
use Getopt::Std;
use POSIX qw(strftime);
+# for sane timestamp format
+$ENV{LANG} = 'C';
+
$opts{'s'} = "localhost";
$opts{'f'} = 'root@' . `hostname`;
chomp($opts{'f'});

View File

@ -1,21 +0,0 @@
From: Hideki Yamane <henrich@debian.org>
Date: Fri, 29 Jan 2016 20:54:57 +0900
Subject: fix #455707 traptoemail use FQDN
---
local/traptoemail | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/local/traptoemail b/local/traptoemail
index cadc18b..3694c3a 100755
--- a/local/traptoemail
+++ b/local/traptoemail
@@ -17,7 +17,7 @@ use POSIX qw(strftime);
$ENV{LANG} = 'C';
$opts{'s'} = "localhost";
-$opts{'f'} = 'root@' . `hostname`;
+$opts{'f'} = 'root@' . `hostname -f`;
chomp($opts{'f'});
getopts("hs:f:", \%opts);

View File

@ -1,26 +0,0 @@
Description: Ignore interfaces without statistics
Author: Net-SNMP Packaging Team <pkg-net-snmp-devel@lists.alioth.debian.org>
Reviewed-by: Craig Small <csmall@debian.org>
Last-Update: 2019-02-07
--- a/agent/mibgroup/mibII/interfaces.c
+++ b/agent/mibgroup/mibII/interfaces.c
@@ -1588,6 +1588,10 @@
struct ifnet *nnew;
char *stats, *ifstart = line;
+ /* Ignore interfaces with no statistics. */
+ if (strstr(line, "No statistics available."))
+ continue;
+
if (line[strlen(line) - 1] == '\n')
line[strlen(line) - 1] = '\0';
@@ -1620,7 +1624,7 @@
&coll) != 5)) {
if ((scan_line_to_use == scan_line_2_2)
&& !strstr(line, "No statistics available"))
- snmp_log(LOG_ERR,
+ snmp_log(LOG_DEBUG,
"/proc/net/dev data format error, line ==|%s|",
line);
continue;

View File

@ -1,62 +0,0 @@
Description: Update Makefiles
Makefile patch to include libwrap and libsensors libraries and install
extra MIB files.
Author: Net-SNMP Packaging Team <pkg-net-snmp-devel@lists.alioth.debian.org>
Reviewed-by: Craig Small <csmall@debian.org>
Last-Update: 2019-02-07
---
Makefile.in | 4 ++--
Makefile.top | 1 +
local/Makefile.in | 2 +-
mibs/Makefile.in | 6 +++---
4 files changed, 7 insertions(+), 6 deletions(-)
--- a/Makefile.in
+++ b/Makefile.in
@@ -173,7 +173,7 @@
#
# override LD_RUN_PATH to avoid dependencies on the build directory
perlmodules: perlmakefiles subdirs
- @(cd perl ; $(MAKE) LD_RUN_PATH="$(libdir):`$(PERL) -e 'use Config; print qq($$Config{archlibexp}/CORE);'`") ; \
+ @(cd perl ; $(MAKE) LD_RUN_PATH="") ; \
if test $$? != 0 ; then \
exit 1 ; \
fi
--- a/Makefile.top
+++ b/Makefile.top
@@ -28,6 +28,7 @@
snmplibdir = $(datadir)/snmp
mibdir = $(snmplibdir)/mibs
persistentdir = @PERSISTENT_DIRECTORY@
+sysconfdir = @sysconfdir@
DESTDIR = @INSTALL_PREFIX@
INSTALL_PREFIX = $(DESTDIR)
--- a/local/Makefile.in
+++ b/local/Makefile.in
@@ -101,7 +101,7 @@
mib2c.made: $(srcdir)/mib2c
if test "x$(PERL)" != "x" ; then \
- $(PERL) -p -e 's%^#!.*/perl.*%#!$(PERL)%;s#/usr/local/share/snmp#$(snmplibdir)#;' ${srcdir}/mib2c > mib2c.made; \
+ $(PERL) -p -e 's%^#!.*/perl.*%#!$(PERL)%;s#/usr/local/share/snmp#$(snmplibdir)#;s#/usr/local/etc/snmp#$(SNMPCONFPATH)#;' ${srcdir}/mib2c > mib2c.made; \
else \
touch mib2c.made; \
fi
--- a/mibs/Makefile.in
+++ b/mibs/Makefile.in
@@ -47,11 +47,11 @@
UCDMIBS = UCD-SNMP-MIB.txt UCD-DEMO-MIB.txt UCD-IPFWACC-MIB.txt \
UCD-DLMOD-MIB.txt UCD-DISKIO-MIB.txt
+EXTRAMIBS = GNOME-SMI LM-SENSORS-MIB
+
DEFAULTMIBS = @default_mibs_install@
-MIBS = $(V1MIBS) $(V2MIBS) $(V3MIBS) $(RFCMIBS) \
- $(AGENTMIBS) $(IANAMIBS) \
- $(NETSNMPMIBS) $(UCDMIBS) $(DEFAULTMIBS)
+MIBS = $(NETSNMPMIBS) $(UCDMIBS) $(DEFAULTMIBS) $(EXTRAMIBS)
all: standardall

View File

@ -1,26 +0,0 @@
From: Net-SNMP Packaging Team <pkg-net-snmp-devel@lists.alioth.debian.org>
Date: Thu, 18 Jun 2015 06:12:04 +0900
Subject: _searchdirs
Makefile patch to include libwrap and libsensors libraries and install extra
MIB files.
---
local/mib2c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/local/mib2c b/local/mib2c
index 2016f06..6926321 100755
--- a/local/mib2c
+++ b/local/mib2c
@@ -61,8 +61,9 @@ $currentlevel = -1;
if($ENV{MIB2C_DIR}) {
push @def_search_dirs, split(/:/, $ENV{MIB2C_DIR});
}
-push @def_search_dirs, "/usr/local/share/snmp/";
-push @def_search_dirs, "/usr/local/share/snmp/mib2c-data";
+push @def_search_dirs, "/etc/snmp/";
+push @def_search_dirs, "/usr/share/snmp/";
+push @def_search_dirs, "/usr/share/snmp/mib2c-data";
push @def_search_dirs, "./mib2c-conf.d";
sub usage {

View File

@ -1,104 +0,0 @@
From: Net-SNMP Packaging Team <pkg-net-snmp-devel@lists.alioth.debian.org>
Date: Thu, 18 Jun 2015 06:12:04 +0900
Subject: _extramibs
Extra MIB files shipped with Debian.
---
mibs/GNOME-SMI.txt | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 88 insertions(+)
create mode 100644 mibs/GNOME-SMI.txt
diff --git a/mibs/GNOME-SMI.txt b/mibs/GNOME-SMI.txt
new file mode 100644
index 0000000..a496ee4
--- /dev/null
+++ b/mibs/GNOME-SMI.txt
@@ -0,0 +1,88 @@
+GNOME-SMI DEFINITIONS ::= BEGIN
+
+IMPORTS
+ MODULE-IDENTITY,
+ OBJECT-IDENTITY,
+ enterprises
+ FROM SNMPv2-SMI;
+
+gnome MODULE-IDENTITY
+ LAST-UPDATED "200709070000Z"
+ ORGANIZATION "GNOME project"
+ CONTACT-INFO
+ "GNU Network Object Model Environment project
+
+ see http://www.gnome.org for contact persons of a particular
+ area or subproject of GNOME.
+
+ Administrative contact for MIB module:
+
+ Jochen Friedrich
+ Ramsaystr. 9
+ 63450 Hanau
+ Germany
+
+ email: jochen@scram.de"
+ DESCRIPTION
+ "The Structure of GNOME."
+
+ -- revision history
+
+ REVISION "200709070000Z" -- Sep 07, 2007
+ DESCRIPTION
+ "Fixed wrong enterprise number (how comes this
+ typo was unnoticed for so long?)."
+
+ REVISION "200505070000Z" -- May 07, 2005
+ DESCRIPTION
+ "Added gnomeLDAP subtree for LDAP definitions."
+
+ REVISION "200312070000Z" -- December 07, 2003
+ DESCRIPTION
+ "Added gnomeSysadmin subtree for GNOME project system administration.
+ Updated contact info."
+
+ REVISION "9809010000Z" -- September 01, 1998
+ DESCRIPTION
+ "Initial version."
+
+ ::= { enterprises 3319 } -- assigned by IANA
+
+gnomeProducts OBJECT-IDENTITY
+ STATUS current
+ DESCRIPTION
+ "gnomeProducts is the root OBJECT IDENTIFIER from
+ which sysObjectID values are assigned."
+ ::= { gnome 1 }
+
+gnomeMgmt OBJECT-IDENTITY
+ STATUS current
+ DESCRIPTION
+ "gnomeMgmt defines the subtree for production GNOME related
+ MIB registrations."
+ ::= { gnome 2 }
+
+gnomeTest OBJECT-IDENTITY
+ STATUS current
+ DESCRIPTION
+ "gnomeTest defines the subtree for testing GNOME related
+ MIB registrations."
+ ::= { gnome 3 }
+
+gnomeSysadmin OBJECT-IDENTITY
+ STATUS current
+ DESCRIPTION
+ "gnomeSysadmin defines the subtree for GNOME related Sysadmin
+ MIB registrations."
+ ::= { gnome 4 }
+
+gnomeLDAP OBJECT-IDENTITY
+ STATUS current
+ DESCRIPTION
+ "gnomeLDAP defines the subtree for GNOME related LDAP
+ registrations."
+ ::= { gnome 5 }
+
+-- more to come if necessary.
+
+END

View File

@ -1,102 +0,0 @@
Description: Document paths
Patch documentation files to change paths to Debian specific locations.
Author: Net-SNMP Packaging Team <pkg-net-snmp-devel@lists.alioth.debian.org>
Reviewed-by: Craig Small <csmall@debian.org>
Last-Update: 2019-02-07
--- a/EXAMPLE.conf.def
+++ b/EXAMPLE.conf.def
@@ -23,7 +23,7 @@
# SNMPv3 AUTHENTICATION
#
# Note that these particular settings don't actually belong here.
-# They should be copied to the file /var/net-snmp/snmpd.conf
+# They should be copied to the file /var/lib/snmp/snmpd.conf
# and the passwords changed, before being uncommented in that file *only*.
# Then restart the agent
--- a/FAQ
+++ b/FAQ
@@ -108,7 +108,7 @@
How do I configure access control?
How do I configure SNMPv3 users?
The 'createUser' line disappears when I start the agent. Why?
- What's the difference between /var/net-snmp and /usr/local/share/snmp?
+ What's the difference between /var/lib/snmp and /usr/share/snmp?
My new agent is ignoring the old snmpd.conf file. Why?
Where should the snmpd.conf file go?
Why am I getting "Connection refused"?
@@ -699,7 +699,7 @@
There are two steps required to add a new MIB file to the tools.
Firstly, copy the MIB file into the appropriate location:
- cp MY-MIB.txt /usr/local/share/snmp/mibs
+ cp MY-MIB.txt /usr/share/snmp/mibs
(which makes it available to everyone on the system)
or
mkdir $HOME/.snmp
@@ -1395,7 +1395,7 @@
If this is the case, then you can specify this interpreter
explicitly as part of the trap handle directive:
- traphandle default /usr/bin/perl /usr/local/bin/log_it
+ traphandle default /usr/bin/perl /usr/bin/log_it
In this case, it's almost certain that you'll also
need to give the full path to the traphandle script (as shown)
@@ -1489,7 +1489,7 @@
string to use.
Some of these (such as MIB information), might be best put in a
- shared snmp.conf file (typically /usr/local/share/snmp/snmp.conf or
+ shared snmp.conf file (typically /usr/share/snmp/snmp.conf or
/etc/snmp/snmp.conf) to apply to all users of the system. Others
(particularly the SNMPv3 security settings), are more likely to refer
to a particular user, and should probably go in a personal snmp.conf
@@ -2663,7 +2663,7 @@
createUser {myUser} MD5 {myPassword} DES
- to the file /var/net-snmp/snmpd.conf (where {myUser} and
+ to the file /var/lib/snmp/snmpd.conf (where {myUser} and
{myPassword} are the appropriate values for username and password,
_without_ the braces!). Then re-start the snmpd agent.
@@ -2672,7 +2672,7 @@
net-snmp-config --create-snmpv3-user
and follow the prompts given. This will create an entry
- in the /var/net-snmp/snmpd.conf file similar to the above.
+ in the /var/lib/snmp/snmpd.conf file similar to the above.
Then re-start the snmpd agent.
3) Make sure the agent is running, and will respond to an SNMPv3
@@ -2706,16 +2706,16 @@
-What's the difference between /var/net-snmp and /usr/local/share/snmp?
----------------------------------------------------------------------
+What's the difference between /var/lib/snmp and /usr/share/snmp?
+----------------------------------------------------------------
- The /var/net-snmp location is primarily used for information set
+ The /var/lib/snmp location is primarily used for information set
during the running of the agent, which needs to be persistent between
one run of the agent and the next. Apart from "createUser" (see
the previous entry), you shouldn't need to touch this file.
All other user-provided configuration should go in the traditional
- location (typically /usr/local/share/snmp/snmpd.conf or /etc/snmp).
+ location (typically /usr/share/snmp or /etc/snmp).
@@ -2736,7 +2736,7 @@
-----------------------------------
The default location for this file with the basic distribution is
- /usr/local/share/snmp/snmpd.conf (or PREFIX/share/snmp/snmpd.conf).
+ /usr/share/snmp/snmpd.conf (or PREFIX/share/snmp/snmpd.conf).
Ready-installed versions often look for the file as /etc/snmpd.conf,
or /etc/snmp/snmpd.conf.

View File

@ -1,64 +0,0 @@
Description: Preliminary support for kfreebsd.
Author: Net-SNMP Packaging Team <pkg-net-snmp-devel@lists.alioth.debian.org>
Reviewed-by: Craig Small <csmall@debian.org>
Last-Update: 2019-02-07
--- a/agent/mibgroup/hardware/cpu/cpu_sysctl.c
+++ b/agent/mibgroup/hardware/cpu/cpu_sysctl.c
@@ -12,7 +12,7 @@
#include <unistd.h>
#include <sys/types.h>
-#if defined(__FreeBSD__)
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
#include <sys/resource.h>
#if !defined(CPUSTATES)
#include <sys/dkstat.h>
@@ -92,7 +92,7 @@
#elif defined(KERN_CPTIME) /* OpenBSD */
#define NETSNMP_KERN_CPU KERN_CPTIME
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
#define NETSNMP_KERN_MCPU 1 /* Enable support for multi-cpu stats. Valid for FreeBSD >=6.4, >=7.1, >=8.0 and beyond */
#define NETSNMP_KERN_MCPU_TYPE NETSNMP_CPU_STATS
@@ -132,7 +132,7 @@
#define NETSNMP_VM_STATS_TYPE struct uvmexp
#endif /* VM_UVMEXP2 || VM_UVMEXP */
-#elif defined(__FreeBSD__) /* FreeBSD */
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) /* FreeBSD */
#define NETSNMP_VM_STATS VM_METER
#define NETSNMP_VM_STATS_TYPE struct vmmeter
#define NS_VM_INTR v_intr
@@ -172,10 +172,10 @@
*/
NETSNMP_CPU_STATS cpu_stats[CPUSTATES];
size_t cpu_size = sizeof(cpu_stats);
-#if !defined(__FreeBSD__) && !defined(__NetBSD__)
+#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__) && !defined(__NetBSD__)
int cpu_mib[] = { CTL_KERN, NETSNMP_KERN_CPU };
#endif
-#ifdef __FreeBSD__
+#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__))
static int cp_times = -1;
#endif
#ifdef KERN_CPTIME2
@@ -192,7 +192,7 @@
size_t mem_size = sizeof(NETSNMP_VM_STATS_TYPE);
netsnmp_cpu_info *cpu = netsnmp_cpu_get_byIdx( -1, 0 );
-#if defined(__FreeBSD__) || defined(__NetBSD__)
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__)
sysctlbyname("kern.cp_time", cpu_stats, &cpu_size, NULL, 0);
#else
sysctl(cpu_mib, 2, cpu_stats, &cpu_size, NULL, 0);
@@ -229,7 +229,7 @@
mcpu_size = cpu_num*sizeof(cpu_stats);
mcpu_stats = malloc(mcpu_size);
sysctlbyname("kern.cp_time", mcpu_stats, &mcpu_size, NULL, 0);
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
if (cp_times == -1) {
int ret = sysctlbyname("kern.cp_times", NULL, &mcpu_size, NULL, 0);
cp_times = ret == -1 ? 0 : 1;

View File

@ -1,29 +0,0 @@
Description: ICMP parameters for kFreeBSD
Author: Net-SNMP Packaging Team <pkg-net-snmp-devel@lists.alioth.debian.org>
Reviewed-by: Craig Small <csmall@debian.org>
Last-Update: 2019-02-07
--- a/agent/mibgroup/mibII/icmp.h
+++ b/agent/mibgroup/mibII/icmp.h
@@ -16,6 +16,7 @@
config_arch_require(freebsd10, mibII/kernel_sysctl)
config_arch_require(freebsd11, mibII/kernel_sysctl)
config_arch_require(freebsd12, mibII/kernel_sysctl)
+config_arch_require(kfreebsd, mibII/kernel_sysctl)
config_arch_require(netbsd, mibII/kernel_netbsd)
config_arch_require(netbsdelf, mibII/kernel_netbsd)
config_arch_require(openbsd4, mibII/kernel_sysctl)
--- a/agent/mibgroup/mibII/kernel_sysctl.c
+++ b/agent/mibgroup/mibII/kernel_sysctl.c
@@ -14,6 +14,12 @@
#include <netinet/icmp_var.h>
#include <netinet/icmp6.h>
+#if defined(__FreeBSD_kernel__) && defined(__GLIBC__)
+/* definitions unavailable in GNU libc's icmp6.h */
+#define ICMP6_MAXTYPE 201
+#define ICMPV6CTL_STATS 1
+#endif
+
#include <net-snmp/net-snmp-config.h>
#include <net-snmp/net-snmp-includes.h>
#include <net-snmp/agent/net-snmp-agent-includes.h>

View File

@ -1,218 +0,0 @@
From: Net-SNMP Packaging Team <pkg-net-snmp-devel@lists.alioth.debian.org>
Date: Thu, 18 Jun 2015 06:12:05 +0900
Subject: _libsensors_api
Patch from Jonathan Nieder <jrnieder@gmail.com> to update lmsensors API to libsensors4.
---
agent/mibgroup/ucd-snmp/lmSensors.c | 162 +++++++++++++++++-------------------
1 file changed, 78 insertions(+), 84 deletions(-)
diff --git a/agent/mibgroup/ucd-snmp/lmSensors.c b/agent/mibgroup/ucd-snmp/lmSensors.c
index 05c60b7..888731f 100644
--- a/agent/mibgroup/ucd-snmp/lmSensors.c
+++ b/agent/mibgroup/ucd-snmp/lmSensors.c
@@ -94,7 +94,6 @@ netsnmp_feature_require(table_container)
#endif
#else
#include <sensors/sensors.h>
- #define CONFIG_FILE_NAME "/etc/sensors.conf"
#endif
#include "lmSensors.h"
@@ -357,9 +356,7 @@ sensor_init(void)
{
int res;
#ifndef solaris2
- char filename[] = CONFIG_FILE_NAME;
time_t t = time(NULL);
- FILE *fp = fopen(filename, "r");
int i = 0;
DEBUGMSG(("ucd-snmp/lmSensors", "=> sensor_init\n"));
@@ -371,13 +368,7 @@ sensor_init(void)
sensor_array[i].sensor = NULL;
}
- if (!fp)
- {
- res = 1;
- goto leaving;
- }
-
- if (sensors_init(fp))
+ if (sensors_init(NULL))
{
res = 2;
goto leaving;
@@ -395,7 +386,7 @@ static int
sensor_load(void)
{
int rc = 0;
- time_t t = time(NULL);
+ time_t t = time(NULL);
if (t > timestamp + 7) /* this may require some tuning - currently 7 seconds*/
{
@@ -947,7 +938,8 @@ else{
#else /* end solaris2 only ie. ifdef everything else */
const sensors_chip_name *chip;
- const sensors_feature_data *data;
+ const sensors_feature *feature;
+ const sensors_subfeature *subfeature;
int chip_nr = 0;
unsigned int i = 0;
@@ -969,78 +961,80 @@ else{
sensor_array[i].current_len = DEFAULT_SENSORS;
} /* end for */
- while ((chip = sensors_get_detected_chips(&chip_nr))) {
- int a = 0;
- int b = 0;
-
- while ((data = sensors_get_all_features(*chip, &a, &b))) {
- char *label = NULL;
- double val;
-
- if ((data->mode & SENSORS_MODE_R) &&
- (data->mapping == SENSORS_NO_MAPPING) &&
- !sensors_get_label(*chip, data->number, &label) &&
- !sensors_get_feature(*chip, data->number, &val)) {
- int type = -1;
- float mul = 0;
- _sensor_array *array;
-
- /* The label, as determined for a given chip in sensors.conf,
- * is used to place each sensor in the appropriate bucket.
- * Volt, Fan, Temp, and Misc. If the text being looked for below
- * is not in the label of a given sensor (e.g., the temp1 sensor
- * has been labeled 'CPU' and not 'CPU temp') it will end up being
- * lumped in the MISC bucket. */
-
- if (strstr(label, "V")) {
- type = VOLT_TYPE;
- mul = 1000.0;
- }
- if (strstr(label, "fan") || strstr(label, "Fan")) {
- type = FAN_TYPE;
- mul = 1.0;
- }
- if (strstr(label, "temp") || strstr(label, "Temp")) {
- type = TEMP_TYPE;
- mul = 1000.0;
- }
- if (type == -1) {
- type = MISC_TYPE;
- mul = 1000.0;
- }
-
- array = &sensor_array[type];
- if ( array->current_len <= array->n) {
- _sensor* old_buffer = array->sensor;
- size_t new_size = (sizeof(_sensor) * array->current_len) + (sizeof(_sensor) * DEFAULT_SENSORS);
- array->sensor = (_sensor*)realloc(array->sensor, new_size);
- if (array->sensor == NULL)
- {
- /* Continuing would be unsafe */
- snmp_log(LOG_ERR, "too many sensors to fit, and failed to alloc more, failing on %s\n", label);
- free(old_buffer);
- old_buffer = NULL;
- if (label) {
- free(label);
- label = NULL;
- } /* end if label */
- return 1;
- } /* end if array->sensor */
- array->current_len = new_size / sizeof(_sensor);
- DEBUGMSG(("ucd-snmp/lmSensors", "type #%d increased to %d elements\n", type, (int)array->current_len));
- } /* end if array->current */
- strlcpy(array->sensor[array->n].name, label, MAX_NAME);
- array->sensor[array->n].value = (int) (val * mul);
- DEBUGMSGTL(("sensors","sensor %s, value %d\n",
- array->sensor[array->n].name,
- array->sensor[array->n].value));
- array->n++;
- } /* end if data-mode */
- if (label) {
- free(label);
- label = NULL;
- } /* end if label */
- } /* end while data */
+ while ((chip = sensors_get_detected_chips(NULL, &chip_nr))) {
+ int a = 0;
+ while ((feature = sensors_get_features(chip, &a))) {
+ int b = 0;
+ while ((subfeature = sensors_get_all_subfeatures(chip,
+ feature, &b))) {
+ char *label = NULL;
+ double val;
+
+ if ((subfeature->flags & SENSORS_MODE_R) &&
+ (label = sensors_get_label(chip, feature)) &&
+ !sensors_get_value(chip, subfeature->number, &val)) {
+ int type = -1;
+ float mul;
+ _sensor_array *array;
+
+ /* The label, as determined for a given chip in
+ * sensors.conf, is used to place each sensor in the
+ * appropriate bucket. Volt, Fan, Temp, and Misc.
+ * If the text being looked for below is not in the
+ * label of a given sensor (e.g., the temp1 sensor
+ * has been labeled 'CPU' and not 'CPU temp') it
+ * will end up being lumped in the MISC bucket. */
+
+ if (strstr(label, "V")) {
+ type = VOLT_TYPE;
+ mul = 1000.0;
+ }
+ if (strstr(label, "fan") || strstr(label, "Fan")) {
+ type = FAN_TYPE;
+ mul = 1.0;
+ }
+ if (strstr(label, "temp") || strstr(label, "Temp")) {
+ type = TEMP_TYPE;
+ mul = 1000.0;
+ }
+ if (type == -1) {
+ type = MISC_TYPE;
+ mul = 1000.0;
+ }
+
+ array = &sensor_array[type];
+ if ( array->current_len <= array->n) {
+ _sensor* old_buffer = array->sensor;
+ size_t new_size = (sizeof(_sensor) * array->current_len) + (sizeof(_sensor) * DEFAULT_SENSORS);
+ array->sensor = (_sensor*)realloc(array->sensor, new_size);
+ if (array->sensor == NULL)
+ {
+ /* Continuing would be unsafe */
+ snmp_log(LOG_ERR, "too many sensors to fit, and failed to alloc more, failing on %s\n", label);
+ free(old_buffer);
+ old_buffer = NULL;
+ if (label) {
+ free(label);
+ label = NULL;
+ } /* end if label */
+ return (rc=1);
+ } /* end if array->sensor */
+ array->current_len = new_size / sizeof(_sensor);
+ DEBUGMSG(("ucd-snmp/lmSensors", "type #%d increased to %d elements\n", type, array->current_len));
+ } /* end if array->current */
+ strncpy(array->sensor[array->n].name, label, MAX_NAME);
+ array->sensor[array->n].value = (int) (val * mul);
+ DEBUGMSGTL(("sensors","sensor %d, value %d\n",
+ array->sensor[array->n].name,
+ array->sensor[array->n].value));
+ array->n++;
+ } /* end if data-mode */
+ if (label) {
+ free(label);
+ label = NULL;
+ } /* end if label */
+ } /* end while subfeature */
+ } /* end while feature */
} /* end while chip */
DEBUGMSG(("ucd-snmp/lmSensors", "<= sensor_load\n"));
#endif /* end else ie. ifdef everything else */

View File

@ -1,32 +0,0 @@
Description: Add base-lib-cflags option
Add option "--base-lib-cflags" to net-snmp-config. This flag returns
options needed to link against libnetsnmp. In particular, no perl
specific options are provided.
.
It was reported in "libsnmp-base: forcing perl headers in net-snmp-config
--cflags breaks perl builds"
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=502806
Author: Net-SNMP Packaging Team <pkg-net-snmp-devel@lists.alioth.debian.org>
Reviewed-by: Craig Small <csmall@debian.org>
Last-Update: 2019-02-07
--- a/net-snmp-config.in
+++ b/net-snmp-config.in
@@ -142,6 +142,9 @@
--base-cflags)
echo @CFLAGS@ @CPPFLAGS@ -I${NSC_INCLUDEDIR}
;;
+ --base-lib-cflags)
+ echo @LIBCFLAGS@ @CPPFLAGS@ -I${NSC_INCLUDEDIR}
+ ;;
--cflags|--cf*)
echo @CFLAGS@ @DEVFLAGS@ @CPPFLAGS@ -I. -I${NSC_INCLUDEDIR}
;;
@@ -704,6 +707,8 @@
echo " These options produce the various compilation flags needed when"
echo " building external SNMP applications:"
echo ""
+ echo " --base-lib-cflags lists additional compilation flags needed for linking"
+ echo " against libsnmp"
echo " --base-cflags lists additional compilation flags needed"
echo " --cflags lists additional compilation flags needed"
echo " (includes -I. and extra developer warning flags)"

View File

@ -1,45 +0,0 @@
Description: Add missing libraries to Makefile
Author: Net-SNMP Packaging Team <pkg-net-snmp-devel@lists.alioth.debian.org>
Reviewed-by: Craig Small <csmall@debian.org>
Last-Update: 2019-02-07
--- a/apps/Makefile.in
+++ b/apps/Makefile.in
@@ -93,6 +93,8 @@
USEAGENTLIBS = $(MIBLIB) $(AGENTLIB) $(USELIBS)
MYSQL_LIBS = @MYSQL_LIBS@
MYSQL_INCLUDES = @MYSQL_INCLUDES@
+LIBCRYPTO = @LIBCRYPTO@
+LIBWRAP = @LIBWRAP@
VAL_LIBS = @VAL_LIBS@
LIBS = $(USELIBS) $(VAL_LIBS) @LIBS@
@@ -183,7 +185,7 @@
$(LINK) ${CFLAGS} -o $@ snmptest.$(OSUFFIX) ${LDFLAGS} ${LIBS}
snmptrapd$(EXEEXT): $(TRAPD_OBJECTS) $(USETRAPLIBS) $(INSTALLLIBS)
- $(LINK) ${CFLAGS} -o $@ $(TRAPD_OBJECTS) $(INSTALLLIBS) ${LDFLAGS} ${TRAPLIBS}
+ $(LINK) ${CFLAGS} -o $@ $(TRAPD_OBJECTS) $(INSTALLLIBS) ${LDFLAGS} ${TRAPLIBS} $(LIBWRAP)
snmptrap$(EXEEXT): snmptrap.$(OSUFFIX) $(USELIBS)
$(LINK) ${CFLAGS} -o $@ snmptrap.$(OSUFFIX) ${LDFLAGS} ${LIBS}
@@ -200,7 +202,7 @@
$(LINK) ${CFLAGS} -o $@ snmpset.$(OSUFFIX) ${LDFLAGS} ${LIBS}
snmpusm$(EXEEXT): snmpusm.$(OSUFFIX) $(USELIBS)
- $(LINK) ${CFLAGS} -o $@ snmpusm.$(OSUFFIX) ${LDFLAGS} ${LIBS}
+ $(LINK) ${CFLAGS} -o $@ snmpusm.$(OSUFFIX) ${LDFLAGS} ${LIBS} $(LIBCRYPTO)
snmpvacm$(EXEEXT): snmpvacm.$(OSUFFIX) $(USELIBS)
$(LINK) ${CFLAGS} -o $@ snmpvacm.$(OSUFFIX) ${LDFLAGS} ${LIBS}
--- a/configure.ac
+++ b/configure.ac
@@ -102,6 +102,9 @@
AC_SUBST(PARTIALTARGETFLAGS)
AC_SUBST(ac_cv_NETSNMP_SYSTEM_INCLUDE_FILE)
+LIBWRAP="$_wraplibs"
+AC_SUBST(LIBWRAP)
+AC_SUBST(LIBCRYPTO)
AC_CONFIG_FILES([Makefile:Makefile.top:Makefile.in:Makefile.rules])
AC_CONFIG_FILES([snmplib/Makefile:Makefile.top:snmplib/Makefile.in:Makefile.rules:snmplib/Makefile.depend])

View File

@ -1,32 +0,0 @@
From 9432f629e66e4f9500f6335eab3ad427f84523b2 Mon Sep 17 00:00:00 2001
From: Adam Williamson <awilliam@redhat.com>
Date: Thu, 20 Jul 2017 10:31:47 -0700
Subject: [PATCH] Link libnetsnmptrapd against MYSQL_LIBS
When building with MySQL (MariaDB) support, this library must
be linked against the MySQL client library, or else it will
have unresolved symbols.
Origin: https://bugzilla.redhat.com/attachment.cgi?id=1301954
Bug: https://sourceforge.net/p/net-snmp/bugs/2792/
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=886221
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/net-snmp/+bug/1814254
Reviewed By: Rafael David Tinoco <rafaeldtinoco@ubuntu.com>
Last-Update: 2019-12-12
---
apps/Makefile.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/apps/Makefile.in b/apps/Makefile.in
index 1ea4415..e77d433 100644
--- a/apps/Makefile.in
+++ b/apps/Makefile.in
@@ -232,7 +232,7 @@ snmppcap$(EXEEXT): snmppcap.$(OSUFFIX) $(USELIBS)
$(LINK) ${CFLAGS} -o $@ snmppcap.$(OSUFFIX) ${LDFLAGS} ${LIBS} -lpcap
libnetsnmptrapd.$(LIB_EXTENSION)$(LIB_VERSION): $(LLIBTRAPD_OBJS)
- $(LIB_LD_CMD) $@ ${LLIBTRAPD_OBJS} $(MIBLIB) $(USELIBS) $(PERLLDOPTS_FOR_LIBS) $(LDFLAGS)
+ $(LIB_LD_CMD) $@ ${LLIBTRAPD_OBJS} $(MIBLIB) $(USELIBS) $(PERLLDOPTS_FOR_LIBS) $(LDFLAGS) $(MYSQL_LIBS)
$(RANLIB) $@
snmpinforminstall:

View File

@ -1,21 +0,0 @@
From: Net-SNMP Packaging Team <pkg-net-snmp-devel@lists.alioth.debian.org>
Date: Thu, 18 Jun 2015 06:12:05 +0900
Subject: add_rocommunity6
---
EXAMPLE.conf.def | 2 ++
1 file changed, 2 insertions(+)
diff --git a/EXAMPLE.conf.def b/EXAMPLE.conf.def
index f619c8e..0c21dee 100644
--- a/EXAMPLE.conf.def
+++ b/EXAMPLE.conf.def
@@ -49,6 +49,8 @@ view systemonly included .1.3.6.1.2.1.25.1
#rocommunity public localhost
# Default access to basic system info
rocommunity public default -V systemonly
+ # rocommunity6 is for IPv6
+ rocommunity6 public default -V systemonly
# Full access from an example network
# Adjust this network address to match your local

View File

@ -1,29 +0,0 @@
Description: Makefile add correct flags
The sedscript creation was missing CPPGLAGS
More seriously the libnetsnmptrapd library linking was missing LDFLAGS
Author: Craig Small <csmall@debian.org>
Bug: https://github.com/net-snmp/net-snmp/issues/29
Reviewed-by: Craig Small <csmall@debian.org>
Last-Update: 2019-10-16
--- a/Makefile.in
+++ b/Makefile.in
@@ -114,7 +114,7 @@
# local build rules
#
sedscript: sedscript.in include/net-snmp/net-snmp-config.h $(srcdir)/agent/mibgroup/mibdefs.h
- $(CPP) $(srcdir)/sedscript.in | egrep '^s[/#]' | sed 's/REMOVEME//g;s# */#/#g;s/ *#/#/g;s#/ *#/#g;s/# g/#g/;' > sedscript
+ $(CPP) $(CPPFLAGS) $(srcdir)/sedscript.in | egrep '^s[/#]' | sed 's/REMOVEME//g;s# */#/#g;s/ *#/#/g;s#/ *#/#g;s/# g/#g/;' > sedscript
echo 's/VERSIONINFO/$(VERSION)/g' >> sedscript
echo 's#DATADIR#$(datadir)#g' >> sedscript
echo 's#LIBDIR#$(libdir)#g' >> sedscript
--- a/apps/Makefile.in
+++ b/apps/Makefile.in
@@ -232,7 +232,7 @@
$(LINK) ${CFLAGS} -o $@ snmppcap.$(OSUFFIX) ${LDFLAGS} ${LIBS} -lpcap
libnetsnmptrapd.$(LIB_EXTENSION)$(LIB_VERSION): $(LLIBTRAPD_OBJS)
- $(LIB_LD_CMD) $@ ${LLIBTRAPD_OBJS} $(MIBLIB) $(USELIBS) $(PERLLDOPTS_FOR_LIBS) $(LIB_LD_LIBS)
+ $(LIB_LD_CMD) $@ ${LLIBTRAPD_OBJS} $(MIBLIB) $(USELIBS) $(PERLLDOPTS_FOR_LIBS) $(LDFLAGS)
$(RANLIB) $@
snmpinforminstall:

View File

@ -1,36 +0,0 @@
HOST-MIB: Fix a recently introduced bug
Fixes: cf41e6e91015 ("HOST-MIB: Skip autofs entries")
Note: this bug was not introduced by Josef but by me.
Description: HOST-MIB: Fix a recently introduced bug
Author: Bart Van Assche <bvanassche@acm.org>
Origin: upstream, https://github.com/net-snmp/net-snmp/commit/a0df31c18c
Applied-Upstream: v5.8.rc4-386-ga0df31c18 (drop after v5.8.1.pre1)
Bug: https://sourceforge.net/p/net-snmp/bugs/2968/
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=935325
Bug-Ubuntu: https://bugs.launchpad.net/bugs/1835818
Reviewed-by: Rafael David Tinoco <rafaeldtinoco@ubuntu.com>
Last-Update: 2019-12-16
---
agent/mibgroup/host/hrh_storage.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/agent/mibgroup/host/hrh_storage.c b/agent/mibgroup/host/hrh_storage.c
index 6f8ff6c53..c7c53922a 100644
--- a/agent/mibgroup/host/hrh_storage.c
+++ b/agent/mibgroup/host/hrh_storage.c
@@ -371,7 +371,7 @@ really_try_next:
NETSNMP_DS_AGENT_SKIPNFSINHOSTRESOURCES) &&
Check_HR_FileSys_NFS())
return NULL;
- if (Check_HR_FileSys_AutoFs())
+ if (HRFS_entry && Check_HR_FileSys_AutoFs())
return NULL;
if (store_idx <= NETSNMP_MEM_TYPE_MAX ) {
mem = (netsnmp_memory_info*)ptr;
--
2.24.0

View File

@ -1,237 +0,0 @@
HOST-MIB: Skip autofs entries
Do not call statfs() for autofs entries.
See also https://sourceforge.net/p/net-snmp/patches/1350/.
See also https://sourceforge.net/p/net-snmp/bugs/2968/.
[ bvanassche: Made several small edits ]
Description: HOST-MIB: Skip autofs entries
Author: Josef Ridky <jridky@redhat.com>
Origin: upstream, https://github.com/net-snmp/net-snmp/commit/cf41e6e910
Applied-Upstream: v5.8.rc4-366-gcf41e6e91 (drop after v5.8.1.pre1)
Bug: https://sourceforge.net/p/net-snmp/bugs/2968/
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=935325
Bug-Ubuntu: https://bugs.launchpad.net/bugs/1835818
Reviewed-by: Rafael David Tinoco <rafaeldtinoco@ubuntu.com>
Last-Update: 2019-12-16
---
agent/mibgroup/hardware/fsys/fsys_mntctl.c | 8 ++++++--
agent/mibgroup/hardware/fsys/fsys_mntent.c | 11 +++++++++++
agent/mibgroup/hardware/fsys/mnttypes.h | 3 +++
agent/mibgroup/host/hr_filesys.c | 21 +++++++++++++++++++++
agent/mibgroup/host/hr_filesys.h | 1 +
agent/mibgroup/host/hr_storage.c | 5 ++++-
agent/mibgroup/host/hrh_filesys.c | 6 ++++++
agent/mibgroup/host/hrh_filesys.h | 1 +
agent/mibgroup/host/hrh_storage.c | 5 ++++-
include/net-snmp/agent/hardware/fsys.h | 1 +
10 files changed, 58 insertions(+), 4 deletions(-)
diff --git a/agent/mibgroup/hardware/fsys/fsys_mntctl.c b/agent/mibgroup/hardware/fsys/fsys_mntctl.c
index e7d9a1c5a..782c8edd2 100644
--- a/agent/mibgroup/hardware/fsys/fsys_mntctl.c
+++ b/agent/mibgroup/hardware/fsys/fsys_mntctl.c
@@ -43,8 +43,9 @@ _fsys_type( int type)
case MNT_NFS:
case MNT_NFS3:
- case MNT_AUTOFS:
return NETSNMP_FS_TYPE_NFS;
+ case MNT_AUTOFS:
+ return NETSNMP_FS_TYPE_AUTOFS;
/*
* The following code covers selected filesystems
@@ -155,12 +156,15 @@ netsnmp_fsys_arch_load( void )
*/
/*
- * Optionally skip retrieving statistics for remote mounts
+ * Skip retrieving statistics for AUTOFS and optionally for remote
+ * mounts.
*/
if ( (entry->flags & NETSNMP_FS_FLAG_REMOTE) &&
netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
NETSNMP_DS_AGENT_SKIPNFSINHOSTRESOURCES))
continue;
+ if (entry->type == NETSNMP_FS_TYPE_AUTOFS)
+ continue;
if ( statfs( entry->path, &stat_buf ) < 0 ) {
snprintf( tmpbuf, sizeof(tmpbuf), "Cannot statfs %s", entry->path );
diff --git a/agent/mibgroup/hardware/fsys/fsys_mntent.c b/agent/mibgroup/hardware/fsys/fsys_mntent.c
index 3cdcea1fb..79e6e4f72 100644
--- a/agent/mibgroup/hardware/fsys/fsys_mntent.c
+++ b/agent/mibgroup/hardware/fsys/fsys_mntent.c
@@ -150,6 +150,13 @@ _fsys_type( char *typename )
!strcmp(typename, MNTTYPE_LOFS))
return NETSNMP_FS_TYPE_OTHER;
+ /* Detection of AUTOFS.
+ * This file system will be ignored by default
+ */
+ else if (!strcmp(typename, MNTTYPE_AUTOFS))
+ return NETSNMP_FS_TYPE_AUTOFS;
+
+
/*
* All other types are silently skipped
*/
@@ -239,6 +246,10 @@ netsnmp_fsys_arch_load( void )
NETSNMP_DS_AGENT_SKIPNFSINHOSTRESOURCES))
continue;
+ /* Skip AUTOFS entries */
+ if (entry->type == NETSNMP_FS_TYPE_AUTOFS)
+ continue;
+
#ifdef irix6
if ( NSFS_STATFS( entry->path, &stat_buf, sizeof(struct statfs), 0) < 0 )
#else
diff --git a/agent/mibgroup/hardware/fsys/mnttypes.h b/agent/mibgroup/hardware/fsys/mnttypes.h
index bb1b40173..53f1cc896 100644
--- a/agent/mibgroup/hardware/fsys/mnttypes.h
+++ b/agent/mibgroup/hardware/fsys/mnttypes.h
@@ -165,6 +165,9 @@
#ifndef MNTTYPE_APP
#define MNTTYPE_APP "app"
#endif
+#ifndef MNTTYPE_AUTOFS
+#define MNTTYPE_AUTOFS "autofs"
+#endif
#ifndef MNTTYPE_DEVPTS
#define MNTTYPE_DEVPTS "devpts"
#endif
diff --git a/agent/mibgroup/host/hr_filesys.c b/agent/mibgroup/host/hr_filesys.c
index 56c8b2095..8caeecf4e 100644
--- a/agent/mibgroup/host/hr_filesys.c
+++ b/agent/mibgroup/host/hr_filesys.c
@@ -834,6 +834,27 @@ Check_HR_FileSys_NFS (void)
return 0; /* no NFS file system */
}
+/* This function checks whether current file system is an AutoFs
+ * HRFS_entry must be valid prior to calling this function
+ * return 1 if AutoFs, 0 otherwise
+ */
+int
+Check_HR_FileSys_AutoFs(void)
+{
+#if HAVE_GETFSSTAT
+ if (HRFS_entry->HRFS_type != NULL &&
+#if defined(MNTTYPE_AUTOFS)
+ !strcmp(HRFS_entry->HRFS_type, MNTTYPE_AUTOFS)
+#else
+ !strcmp(HRFS_entry->HRFS_type, "autofs")
+#endif
+ )
+#endif /* HAVE_GETFSSTAT */
+ return 1; /* AUTOFS */
+
+ return 0; /* no AUTOFS */
+}
+
void
End_HR_FileSys(void)
{
diff --git a/agent/mibgroup/host/hr_filesys.h b/agent/mibgroup/host/hr_filesys.h
index 2f00355f3..36cd7dd08 100644
--- a/agent/mibgroup/host/hr_filesys.h
+++ b/agent/mibgroup/host/hr_filesys.h
@@ -10,6 +10,7 @@ extern void Init_HR_FileSys(void);
extern FindVarMethod var_hrfilesys;
extern int Get_Next_HR_FileSys(void);
extern int Check_HR_FileSys_NFS(void);
+extern int Check_HR_FileSys_AutoFs(void);
extern int Get_FSIndex(char *);
extern long Get_FSSize(char *); /* Temporary */
diff --git a/agent/mibgroup/host/hr_storage.c b/agent/mibgroup/host/hr_storage.c
index a86898451..6b459ec51 100644
--- a/agent/mibgroup/host/hr_storage.c
+++ b/agent/mibgroup/host/hr_storage.c
@@ -544,6 +544,8 @@ really_try_next:
NETSNMP_DS_AGENT_SKIPNFSINHOSTRESOURCES) &&
Check_HR_FileSys_NFS())
return NULL; /* or goto try_next; */
+ if (Check_HR_FileSys_AutoFs())
+ return NULL;
if (HRFS_statfs(HRFS_entry->HRFS_mount, &stat_buf) < 0) {
snmp_log_perror(HRFS_entry->HRFS_mount);
goto try_next;
@@ -683,7 +685,8 @@ Get_Next_HR_Store(void)
if (HRS_index >= 0) {
if (!(netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
NETSNMP_DS_AGENT_SKIPNFSINHOSTRESOURCES) &&
- Check_HR_FileSys_NFS())) {
+ Check_HR_FileSys_NFS()) &&
+ !Check_HR_FileSys_AutoFs()) {
return HRS_index + NETSNMP_MEM_TYPE_MAX;
}
} else {
diff --git a/agent/mibgroup/host/hrh_filesys.c b/agent/mibgroup/host/hrh_filesys.c
index 5ad82b20f..5d2102e24 100644
--- a/agent/mibgroup/host/hrh_filesys.c
+++ b/agent/mibgroup/host/hrh_filesys.c
@@ -429,3 +429,9 @@ Check_HR_FileSys_NFS (void)
{
return (HRFS_entry->flags & NETSNMP_FS_FLAG_REMOTE) ? 1 : 0;
}
+
+int
+Check_HR_FileSys_AutoFs (void)
+{
+ return HRFS_entry->type == NETSNMP_FS_TYPE_AUTOFS;
+}
diff --git a/agent/mibgroup/host/hrh_filesys.h b/agent/mibgroup/host/hrh_filesys.h
index 568917e09..c0f5d6e8c 100644
--- a/agent/mibgroup/host/hrh_filesys.h
+++ b/agent/mibgroup/host/hrh_filesys.h
@@ -10,6 +10,7 @@ extern void Init_HR_FileSys(void);
extern FindVarMethod var_hrhfilesys;
extern int Get_Next_HR_FileSys(void);
extern int Check_HR_FileSys_NFS(void);
+extern int Check_HR_FileSys_AutoFs(void);
extern int Get_FSIndex(char *);
extern long Get_FSSize(char *); /* Temporary */
diff --git a/agent/mibgroup/host/hrh_storage.c b/agent/mibgroup/host/hrh_storage.c
index 810766946..6f8ff6c53 100644
--- a/agent/mibgroup/host/hrh_storage.c
+++ b/agent/mibgroup/host/hrh_storage.c
@@ -371,6 +371,8 @@ really_try_next:
NETSNMP_DS_AGENT_SKIPNFSINHOSTRESOURCES) &&
Check_HR_FileSys_NFS())
return NULL;
+ if (Check_HR_FileSys_AutoFs())
+ return NULL;
if (store_idx <= NETSNMP_MEM_TYPE_MAX ) {
mem = (netsnmp_memory_info*)ptr;
}
@@ -508,7 +510,8 @@ Get_Next_HR_Store(void)
if (HRS_index >= 0) {
if (!(netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
NETSNMP_DS_AGENT_SKIPNFSINHOSTRESOURCES) &&
- Check_HR_FileSys_NFS())) {
+ Check_HR_FileSys_NFS()) &&
+ !Check_HR_FileSys_AutoFs()) {
return HRS_index + NETSNMP_MEM_TYPE_MAX;
}
} else {
diff --git a/include/net-snmp/agent/hardware/fsys.h b/include/net-snmp/agent/hardware/fsys.h
index 3f2b28440..54ab9d806 100644
--- a/include/net-snmp/agent/hardware/fsys.h
+++ b/include/net-snmp/agent/hardware/fsys.h
@@ -41,6 +41,7 @@ typedef struct netsnmp_fsys_info_s netsnmp_fsys_info;
#define NETSNMP_FS_TYPE_SYSFS (4 | _NETSNMP_FS_TYPE_LOCAL | _NETSNMP_FS_TYPE_SKIP_BIT)
#define NETSNMP_FS_TYPE_TMPFS (5 | _NETSNMP_FS_TYPE_LOCAL)
#define NETSNMP_FS_TYPE_USBFS (6 | _NETSNMP_FS_TYPE_LOCAL)
+#define NETSNMP_FS_TYPE_AUTOFS (7 | _NETSNMP_FS_TYPE_LOCAL | _NETSNMP_FS_TYPE_SKIP_BIT)
#define NETSNMP_FS_FLAG_ACTIVE 0x01
#define NETSNMP_FS_FLAG_REMOTE 0x02
--
2.24.0

View File

@ -1,21 +0,0 @@
From: Net-SNMP Packaging Team <pkg-net-snmp-devel@lists.alioth.debian.org>
Date: Mon, 5 Mar 2018 21:13:51 +1100
Subject: callback_print
---
perl/SNMP/SNMP.xs | 4 ++++
1 file changed, 4 insertions(+)
--- a/perl/SNMP/SNMP.xs
+++ b/perl/SNMP/SNMP.xs
@@ -1296,6 +1296,10 @@
netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_PRINT_NUMERIC_OIDS, 1);
netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_OID_OUTPUT_FORMAT, NETSNMP_OID_OUTPUT_NUMERIC);
}
+ if (SvIV(*hv_fetch((HV*)SvRV(sess_ref),"UseEnums", 8, 1)))
+ sprintval_flag = USE_ENUMS;
+ if (SvIV(*hv_fetch((HV*)SvRV(sess_ref),"UseSprintValue", 14, 1)))
+ sprintval_flag = USE_SPRINT_VALUE;
sv_bless(varlist_ref, gv_stashpv("SNMP::VarList",0));
for(vars = (pdu?pdu->variables:NULL); vars; vars = vars->next_variable) {

View File

@ -1,138 +0,0 @@
From: Net-SNMP Packaging Team <pkg-net-snmp-devel@lists.alioth.debian.org>
Date: Mon, 5 Mar 2018 21:13:51 +1100
Subject: do_not_callback_for_failed_reports
===================================================================
---
snmplib/snmp_api.c | 106 ++++++++++++++++++++++++++---------------------------
1 file changed, 53 insertions(+), 53 deletions(-)
diff --git a/snmplib/snmp_api.c b/snmplib/snmp_api.c
index 85cc720..d155c99 100644
--- a/snmplib/snmp_api.c
+++ b/snmplib/snmp_api.c
@@ -5347,71 +5347,71 @@ _sess_process_packet(void *sessp, netsnmp_session * sp,
* should be per session !
*/
- if (callback == NULL
- || callback(NETSNMP_CALLBACK_OP_RECEIVED_MESSAGE, sp,
- pdu->reqid, pdu, magic) == 1) {
- if (pdu->command == SNMP_MSG_REPORT) {
- if (sp->s_snmp_errno == SNMPERR_NOT_IN_TIME_WINDOW ||
- snmpv3_get_report_type(pdu) ==
- SNMPERR_NOT_IN_TIME_WINDOW) {
- /*
- * trigger immediate retry on recoverable Reports
- * * (notInTimeWindow), incr_retries == TRUE to prevent
- * * inifinite resend
- */
- if (rp->retries <= sp->retries) {
- snmp_resend_request(slp, rp, TRUE);
- break;
- } else {
- /* We're done with retries, so no longer waiting for a response */
- if (magic) {
- ((struct synch_state*)magic)->waiting = 0;
- }
- }
+ if (pdu->command == SNMP_MSG_REPORT) {
+ if (sp->s_snmp_errno == SNMPERR_NOT_IN_TIME_WINDOW ||
+ snmpv3_get_report_type(pdu) ==
+ SNMPERR_NOT_IN_TIME_WINDOW) {
+ /*
+ * trigger immediate retry on recoverable Reports
+ * * (notInTimeWindow), incr_retries == TRUE to prevent
+ * * inifinite resend
+ */
+ if (rp->retries <= sp->retries) {
+ snmp_resend_request(slp, rp, TRUE);
+ break;
} else {
- if (SNMPV3_IGNORE_UNAUTH_REPORTS) {
- break;
- } else { /* Set the state to no longer be waiting, since we're done with retries */
- if (magic) {
- ((struct synch_state*)magic)->waiting = 0;
- }
+ /* We're done with retries, so no longer waiting for a response */
+ if (magic) {
+ ((struct synch_state*)magic)->waiting = 0;
}
}
+ } else {
+ if (SNMPV3_IGNORE_UNAUTH_REPORTS) {
+ break;
+ } else { /* Set the state to no longer be waiting, since we're done with retries */
+ if (magic) {
+ ((struct synch_state*)magic)->waiting = 0;
+ }
+ }
+ }
- /*
- * Handle engineID discovery.
- */
- if (!sp->securityEngineIDLen && pdu->securityEngineIDLen) {
- sp->securityEngineID =
- (u_char *) malloc(pdu->securityEngineIDLen);
- if (sp->securityEngineID == NULL) {
+ /*
+ * Handle engineID discovery.
+ */
+ if (!sp->securityEngineIDLen && pdu->securityEngineIDLen) {
+ sp->securityEngineID =
+ (u_char *) malloc(pdu->securityEngineIDLen);
+ if (sp->securityEngineID == NULL) {
+ /*
+ * TODO FIX: recover after message callback *?
+ */
+ return -1;
+ }
+ memcpy(sp->securityEngineID, pdu->securityEngineID,
+ pdu->securityEngineIDLen);
+ sp->securityEngineIDLen = pdu->securityEngineIDLen;
+ if (!sp->contextEngineIDLen) {
+ sp->contextEngineID =
+ (u_char *) malloc(pdu->
+ securityEngineIDLen);
+ if (sp->contextEngineID == NULL) {
/*
* TODO FIX: recover after message callback *?
- */
+ */
return -1;
}
- memcpy(sp->securityEngineID, pdu->securityEngineID,
+ memcpy(sp->contextEngineID,
+ pdu->securityEngineID,
pdu->securityEngineIDLen);
- sp->securityEngineIDLen = pdu->securityEngineIDLen;
- if (!sp->contextEngineIDLen) {
- sp->contextEngineID =
- (u_char *) malloc(pdu->
- securityEngineIDLen);
- if (sp->contextEngineID == NULL) {
- /*
- * TODO FIX: recover after message callback *?
- */
- return -1;
- }
- memcpy(sp->contextEngineID,
- pdu->securityEngineID,
- pdu->securityEngineIDLen);
- sp->contextEngineIDLen =
- pdu->securityEngineIDLen;
- }
+ sp->contextEngineIDLen =
+ pdu->securityEngineIDLen;
}
}
+ }
+ if (callback == NULL ||
+ callback(NETSNMP_CALLBACK_OP_RECEIVED_MESSAGE, sp,
+ pdu->reqid, pdu, magic) == 1) {
/*
* Successful, so delete request.
*/

View File

@ -1,36 +0,0 @@
Description: HOST-MIB, hr_filesys: Fix Check_HR_FileSys_AutoFs()
On Linux getmntent() is available but getfsstat() not. Hence remove #if
HAVE_GETFSSTAT from around the HRFS_type check.
See also https://sourceforge.net/p/net-snmp/patches/1350/.
Fixes: cf41e6e91015 ("HOST-MIB: Skip autofs entries").
Author: Bart Van Assche <bvanassche@acm.org>
Origin: upstream, https://github.com/net-snmp/net-snmp/commit/bcb1a6b8afc444bbcd099a195e08f0b01cbc8f6b
Bug: https://sourceforge.net/p/net-snmp/patches/1350/
Bug-Ubuntu: https://launchpad.net/bugs/1843036
Index: net-snmp-5.7.3+dfsg/agent/mibgroup/host/hr_filesys.c
===================================================================
--- net-snmp-5.7.3+dfsg.orig/agent/mibgroup/host/hr_filesys.c
+++ net-snmp-5.7.3+dfsg/agent/mibgroup/host/hr_filesys.c
@@ -846,18 +846,8 @@ Check_HR_FileSys_NFS (void)
int
Check_HR_FileSys_AutoFs(void)
{
-#if HAVE_GETFSSTAT
- if (HRFS_entry->HRFS_type != NULL &&
-#if defined(MNTTYPE_AUTOFS)
- !strcmp(HRFS_entry->HRFS_type, MNTTYPE_AUTOFS)
-#else
- !strcmp(HRFS_entry->HRFS_type, "autofs")
-#endif
- )
-#endif /* HAVE_GETFSSTAT */
- return 1; /* AUTOFS */
-
- return 0; /* no AUTOFS */
+ return HRFS_entry->HRFS_type &&
+ strcmp(HRFS_entry->HRFS_type, MNTTYPE_AUTOFS) == 0;
}
void

View File

@ -1,16 +0,0 @@
Description: fix-request-id-0
Author: Net-SNMP Packaging Team <pkg-net-snmp-devel@lists.alioth.debian.org>
Reviewed-by: Craig Small <csmall@debian.org>
Last-Update: 2019-02-07
--- a/snmplib/snmp_api.c
+++ b/snmplib/snmp_api.c
@@ -5367,6 +5367,9 @@
/*
* No response expected...
*/
+ if ((reqid == 0) && (pdu->command == SNMP_MSG_RESPONSE)) {
+ reqid = 2;
+ }
if (reqid) {
/*
* Free v1 or v2 TRAP PDU iff no error

View File

@ -1,19 +0,0 @@
Description: Fix engineID reprobe
Do not probe for engineID when we already know it
Author: Net-SNMP Packaging Team <pkg-net-snmp-devel@lists.alioth.debian.org>
Reviewed-by: Craig Small <csmall@debian.org>
Last-Updated: 2019-02-07
--- a/snmplib/snmpusm.c
+++ b/snmplib/snmpusm.c
@@ -3258,6 +3258,11 @@
int status, i;
struct session_list *slp = (struct session_list *) slpv;
+ if (slp->session->securityEngineIDLen != 0) {
+ DEBUGMSGTL(("snmp_api", "engineID already known, skipping probe\n"));
+ return SNMPERR_SUCCESS;
+ }
+
if (usm_build_probe_pdu(&pdu) != 0) {
DEBUGMSGTL(("snmp_api", "unable to create probe PDU\n"));
return SNMP_ERR_GENERR;

View File

@ -1,15 +0,0 @@
Description: Fix man page groff errors
Author: Hideki Yamane <henrich@debian.org>
Reviewed-by: Craig Small <csmall@debian.org>
Last-Update: 2019-02-07
--- a/man/netsnmp_config_api.3.def
+++ b/man/netsnmp_config_api.3.def
@@ -365,7 +365,7 @@
SNMPCONFPATH
A colon separated list of directories to search for configuration
files in.
-Default:
+Default\:
.br
SYSCONFDIR/snmp:\:DATADIR/snmp:\:LIBDIR/snmp:\:$HOME/.snmp
.SH "SEE ALSO"

View File

@ -1,90 +0,0 @@
Description: Fix perl bulk gets
Author: Net-SNMP Packaging Team <pkg-net-snmp-devel@lists.alioth.debian.org>
Reviewed-by: Craig Small <csmall@debian.org>
Last-Updated: 2019-02-07
--- a/perl/SNMP/SNMP.pm
+++ b/perl/SNMP/SNMP.pm
@@ -866,22 +866,11 @@
$vbl = $_[$#_] if ($state->{'options'}{'callback'});
- while ($#$vbl > -1 && !$this->{ErrorNum}) {
- if (($#$vbl + 1) % ($#{$state->{'stopconds'}} + 1) != 0) {
- if ($vbl->[$#$vbl][2] ne 'ENDOFMIBVIEW') {
- # unless it's an end of mib view we didn't get the
- # proper number of results back.
- print STDERR "ack: gettable results not appropriate\n";
- }
- my @k = keys(%{$state->{'result_hash'}});
- last if ($#k > -1); # bail with what we have
- return;
- }
-
- $state->{'varbinds'} = [];
- my $newstopconds;
+ my $num_vbls = defined($vbl) ? scalar @$vbl : 0;
+ my $num_stopconds = scalar @{$state->{'stopconds'}};
- my $lastsetstart = ($state->{'repeatcount'}-1) * ($#{$state->{'stopconds'}}+1);
+ while ($num_vbls > 0 && !$this->{ErrorNum}) {
+ my @found_eof = (0) x $num_stopconds;
for (my $i = 0; $i <= $#$vbl; $i++) {
my $row_oid = SNMP::translateObj($vbl->[$i][0]);
@@ -890,9 +879,11 @@
my $row_value = $vbl->[$i][2];
my $row_type = $vbl->[$i][3];
- if ($row_oid =~
- /^$state->{'stopconds'}[$i % ($#{$state->{'stopconds'}}+1)]/ &&
- $row_value ne 'ENDOFMIBVIEW' ){
+ my $stopcond_num = $i % $num_stopconds;
+ my $stopcond = $state->{'stopconds'}[$stopcond_num];
+ if ($row_oid !~ /^\Q$stopcond\E/ || $row_value eq 'ENDOFMIBVIEW') {
+ $found_eof[$stopcond_num] = 1;
+ } else {
if ($row_type eq "OBJECTID") {
@@ -903,26 +894,30 @@
}
+ # continue past this next time
+
+ $state->{'varbinds'}[$stopcond_num] = [ $row_text, $row_index ];
+
# Place the results in a hash
$state->{'result_hash'}{$row_index}{$row_text} = $row_value;
+ }
+ }
- # continue past this next time
- if ($i >= $lastsetstart) {
- push @$newstopconds,
- $state->{'stopconds'}->[$i%($#{$state->{'stopconds'}}+1)];
- push @{$state->{'varbinds'}},[$vbl->[$i][0],$vbl->[$i][1]];
- }
+ my @newstopconds = ();
+ my @newvarbinds = ();
+ for (my $i = 0; $i < $num_stopconds; ++$i) {
+ unless ($found_eof[$i]) {
+ push @newstopconds, $state->{'stopconds'}[$i];
+ push @newvarbinds, $state->{'varbinds'}[$i];
}
}
- if ($#$newstopconds == -1) {
+ if ($#newstopconds == -1) {
last;
}
- if ($#{$state->{'varbinds'}} == -1) {
- print "gettable ack. shouldn't get here\n";
- }
+ $state->{'varbinds'} = \@newvarbinds;
+ $state->{'stopconds'} = \@newstopconds;
$vbl = $state->{'varbinds'};
- $state->{'stopconds'} = $newstopconds;
#
# if we've been configured with a callback, then call the

View File

@ -1,36 +0,0 @@
Description: Fix regular expression
>>> import os
>>> import re
>>> import string
>>> import sys
>>> netsnmp_libs="-Wl,-z,relro -Wl,-z,now -L/usr/lib/x86_64-linux-gnu -lnetsnmp -lcrypto -lm"
>>> print netsnmp_libs
-Wl,-z,relro -Wl,-z,now -L/usr/lib/x86_64-linux-gnu -lnetsnmp -lcrypto -lm
>>> re.findall(r"-l(\S+)", netsnmp_libs)
['inux-gnu', 'netsnmp', 'crypto', 'm']
.
Just inserting space will fix this.
>>> re.findall(r" -l(\S+)", netsnmp_libs)
['netsnmp', 'crypto', 'm']
Author: Hideki Yamane <henrich@debian.org>
Reviewed-by: Craig Small <csmall@debian.org>
LAst-Update: 2019-02-07
--- a/python/setup.py
+++ b/python/setup.py
@@ -18,14 +18,14 @@
netsnmp_libs = os.popen(basedir+'/net-snmp-config --libs').read()
libdir = os.popen(basedir+'/net-snmp-config --build-lib-dirs '+basedir).read()
incdir = os.popen(basedir+'/net-snmp-config --build-includes '+basedir).read() + " " + os.popen(basedir+'/net-snmp-config --base-cflags '+basedir).read()
- libs = re.findall(r"-l(\S+)", netsnmp_libs)
+ libs = re.findall(r" -l(\S+)", netsnmp_libs)
libdirs = re.findall(r"-L(\S+)", libdir)
incdirs = re.findall(r"-I(\S+)", incdir)
else:
netsnmp_libs = os.popen('net-snmp-config --libs').read()
libdirs = re.findall(r"-L(\S+)", netsnmp_libs)
incdirs = []
- libs = re.findall(r"-l(\S+)", netsnmp_libs)
+ libs = re.findall(r" -l(\S+)", netsnmp_libs)
setup(
name="netsnmp-python", version="1.0a1",

View File

@ -1,19 +0,0 @@
From: Net-SNMP Packaging Team <pkg-net-snmp-devel@lists.alioth.debian.org>
Date: Thu, 18 Jun 2015 06:12:05 +0900
Subject: fix_snmpcheck_perl_path
Author: Hideki Yamane <henrich@debian.org>
---
local/snmpcheck.def | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/local/snmpcheck.def b/local/snmpcheck.def
index ad392ee..df3450e 100755
--- a/local/snmpcheck.def
+++ b/local/snmpcheck.def
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl -w
+#!/usr/bin/perl
use strict 'refs';
require Net::Ping;

View File

@ -1,28 +0,0 @@
Description: Spelling Errors
Fix some minor spelling errors in the code
Author: Net-SNMP Packaging Team <pkg-net-snmp-devel@lists.alioth.debian.org>
Reviewed-by: Craig Small <csmall@debian.org>
Last-Update: 2019-02-07
--- a/apps/snmpnetstat/inet.c
+++ b/apps/snmpnetstat/inet.c
@@ -452,7 +452,7 @@
struct stat_table icmpstats_tbl[] = {
{ 1, "%14lu total message%s received"},
{ 2, "%14lu message%s dropped due to errors"},
- {14, "%14lu ouput message request%s"},
+ {14, "%14lu output message request%s"},
{15, "%14lu output message%s discarded"},
{ 0, ""}
};
--- a/apps/snmpnetstat/inet6.c
+++ b/apps/snmpnetstat/inet6.c
@@ -333,7 +333,7 @@
struct stat_table icmp6stats_tbl[] = {
{ 1, "%14d total message%s received"},
{ 2, "%14d message%s dropped due to errors"},
- {18, "%14d ouput message request%s"},
+ {18, "%14d output message request%s"},
{19, "%14d output message%s discarded"},
{ 0, ""}
};

View File

@ -1,21 +0,0 @@
From: Net-SNMP Packaging Team <pkg-net-snmp-devel@lists.alioth.debian.org>
Date: Thu, 18 Jun 2015 06:12:05 +0900
Subject: fix_typo_in_snmpd.conf
---
EXAMPLE.conf.def | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/EXAMPLE.conf.def b/EXAMPLE.conf.def
index 180713c..f619c8e 100644
--- a/EXAMPLE.conf.def
+++ b/EXAMPLE.conf.def
@@ -63,7 +63,7 @@ view systemonly included .1.3.6.1.2.1.25.1
#rwuser authPrivUser priv
# It's no longer typically necessary to use the full 'com2sec/group/access' configuration
-# r[ou]user and r[ow]community, together with suitable views, should cover most requirements
+# r[ow]user and r[ow]community, together with suitable views, should cover most requirements

View File

@ -1,94 +0,0 @@
Description: Let Perl access EngineID
Author: Net-SNMP Packaging Team <pkg-net-snmp-devel@lists.alioth.debian.org>
Reviewed-by: Craig Small <csmall@debian.org>
Last-Update: 2019-02-07
--- a/perl/SNMP/SNMP.pm
+++ b/perl/SNMP/SNMP.pm
@@ -1243,6 +1243,16 @@
return(wantarray() ? @res : $res[0]);
}
+sub get_sec_engine_id {
+ my $this = shift;
+ return SNMP::_get_sec_engine_id($this);
+}
+
+sub get_context_engine_id {
+ my $this = shift;
+ return SNMP::_get_context_engine_id($this);
+}
+
package SNMP::TrapSession;
@SNMP::TrapSession::ISA = ('SNMP::Session');
@@ -2043,6 +2053,17 @@
=back
+=item $sess->get_sec_engine_id
+
+Returns the security engine ID for the current session, whether probed
+or provided by the client, in hex format suitable for the SecEngineId
+parameter when creating a session in the future. Returns undef if we have not
+had not had any contact with the remote agent yet.
+
+=item $sess->get_context_engine_id
+
+Like get_sec_engine_id, but for the context engine ID (ContextEngineId).
+
=back
=head1 SNMP::TrapSession
--- a/perl/SNMP/SNMP.xs
+++ b/perl/SNMP/SNMP.xs
@@ -4739,6 +4739,50 @@
char *
+snmp_get_sec_engine_id(sess_ref)
+ SV * sess_ref
+ CODE:
+ {
+ RETVAL = NULL;
+ if (SvROK(sess_ref)) {
+ SV **sess_ptr_sv = hv_fetch((HV*)SvRV(sess_ref), "SessPtr", 7, 1);
+ SnmpSession *ss = (SnmpSession *)SvIV((SV*)SvRV(*sess_ptr_sv));
+ if (ss->securityEngineIDLen > 0) {
+ binary_to_hex(ss->securityEngineID,
+ ss->securityEngineIDLen,
+ &RETVAL);
+ }
+ }
+ }
+ OUTPUT:
+ RETVAL
+ CLEANUP:
+ netsnmp_free(RETVAL);
+
+
+char *
+snmp_get_context_engine_id(sess_ref)
+ SV * sess_ref
+ CODE:
+ {
+ RETVAL = NULL;
+ if (SvROK(sess_ref)) {
+ SV **sess_ptr_sv = hv_fetch((HV*)SvRV(sess_ref), "SessPtr", 7, 1);
+ SnmpSession *ss = (SnmpSession *)SvIV((SV*)SvRV(*sess_ptr_sv));
+ if (ss->contextEngineIDLen > 0) {
+ binary_to_hex(ss->contextEngineID,
+ ss->contextEngineIDLen,
+ &RETVAL);
+ }
+ }
+ }
+ OUTPUT:
+ RETVAL
+ CLEANUP:
+ netsnmp_free(RETVAL);
+
+
+char *
snmp_get_type(tag, best_guess)
char * tag
int best_guess

View File

@ -1,27 +0,0 @@
Description: MIB-II: Only log once that opening /proc/net/if_inet6 failed
If IPv6 has been disabled (ipv6.disable=1) then opening /proc/net/if_inet6
fails. Only log this once instead of thousand of times a day.
Reported-by: Fif <lefif@users.sourceforge.net>
Origin: upstream, https://sourceforge.net/p/net-snmp/code/ci/cd09fd8252
Bug: https://sourceforge.net/p/net-snmp/bugs/2903/
Bug-Ubuntu: https://bugs.launchpad.net/bugs/1871307
Reviewed-by: Rafael David Tinoco <rafaeldtinoco@ubuntu.com>
Last-Update: 2020-04-09
---
agent/mibgroup/ip-mib/data_access/ipaddress_linux.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c
+++ b/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c
@@ -234,7 +234,7 @@
#define PROCFILE "/proc/net/if_inet6"
if (!(in = fopen(PROCFILE, "r"))) {
- snmp_log_perror("ipaddress_linux: could not open " PROCFILE);
+ NETSNMP_LOGONCE((LOG_ERR, "ipaddress_linux: could not open " PROCFILE));
return -2;
}

View File

@ -1,26 +0,0 @@
apps/snmptrapd_sql: Fix build against MySQL 8
See also https://sourceforge.net/p/net-snmp/bugs/2922/.
[bvanassche: changed 'int' into 'char']
Description: apps/snmptrapd_sql: Fix build against MySQL 8
Author: Andreas Hasenack <ahasenack2@users.sourceforge.net>
Origin: upstream, https://github.com/net-snmp/net-snmp/commit/9f4af8c42d
Bug: https://sourceforge.net/p/net-snmp/bugs/2922/
Bug-Ubuntu: https://bugs.launchpad.net/bugs/1814270
Applied-Upstream: v5.8.rc4-180-g9f4af8c42 (drop after v5.8.1.pre1)
Reviewed-by: Rafael David Tinoco <rafaeldtinoco@ubuntu.com>
Last-Update: 2019-12-16
--- a/apps/snmptrapd_sql.c
+++ b/apps/snmptrapd_sql.c
@@ -194,7 +194,7 @@ typedef struct sql_buf_t {
* static bind structures, plus 2 static buffers to bind to.
*/
static MYSQL_BIND _tbind[TBIND_MAX], _vbind[VBIND_MAX];
-static my_bool _no_v3;
+static char _no_v3;
static void _sql_process_queue(u_int dontcare, void *meeither);

View File

@ -1,12 +0,0 @@
--- a/man/netsnmp_mib_api.3.def
+++ b/man/netsnmp_mib_api.3.def
@@ -278,7 +278,9 @@
The default list of modules will depend on how the Net-SNMP software
was originally compiled, but is typically:
.br
+.ad l
IP\-MIB:\:IF\-MIB:\:TCP\-MIB:\:UDP\-MIB:\:SNMPv2\-MIB:\:RFC1213\-MIB:\:UCD\-SNMP\-MIB:\:HOST\-RESOURCES\-MIB
+.ad
.IP
If the value of the
.B MIBS

View File

@ -1,39 +0,0 @@
Description: Set default port of 0 when parsing addresses
Default port should be zero when address parsing so other parts of the
library can set the emphereal source port.
Author: Bill Fenner
Origin: https://sourceforge.net/p/net-snmp/code/ci/06a02b7c708c1ea2bf67e59c333001e8ce128dff
Bug: https://sourceforge.net/p/net-snmp/bugs/2978/
Reviewed-by: Craig Small <csmall@debian.org>
Last-Update: 2019-09-30
--- a/snmplib/transports/snmpUDPIPv4BaseDomain.c
+++ b/snmplib/transports/snmpUDPIPv4BaseDomain.c
@@ -317,7 +317,7 @@
if (NULL != tspec->source) {
struct sockaddr_in src_addr, *srcp = &src_addr;
/** get sockaddr from source */
- if (!netsnmp_sockaddr_in2(&src_addr, tspec->source, NULL))
+ if (!netsnmp_sockaddr_in2(&src_addr, tspec->source, ":0"))
return NULL;
return netsnmp_udpipv4base_transport_with_source(&addr, local, srcp);
} else {
--- a/snmplib/transports/snmpUDPIPv6Domain.c
+++ b/snmplib/transports/snmpUDPIPv6Domain.c
@@ -383,7 +383,7 @@
if (NULL != tspec->source) {
struct sockaddr_in6 src_addr, *srcp = &src_addr;
/** get sockaddr from source */
- if (!netsnmp_sockaddr_in6_2(&src_addr, tspec->source, NULL))
+ if (!netsnmp_sockaddr_in6_2(&src_addr, tspec->source, ":0"))
return NULL;
return netsnmp_udp6_transport_with_source(&addr, local, srcp);
} else {
@@ -464,7 +464,7 @@
NETSNMP_DS_LIB_CLIENT_ADDR);
if (client_socket) {
struct sockaddr_in6 client_addr;
- if(!netsnmp_sockaddr_in6_2(&client_addr, client_socket, NULL)) {
+ if(!netsnmp_sockaddr_in6_2(&client_addr, client_socket, ":0")) {
return netsnmp_udp6_transport_with_source(addr, local,
&client_addr);
}

View File

@ -1,13 +0,0 @@
Description: Use perl path directly
Original script used /usr/bin/env perl to find the interpreter. This is
against Debian policy 10.4
Author: Craig Small <csmall@debian.org>
Last-Update: 2019-01-05
--- a/perl/SNMP/examples/pingmib.pl
+++ b/perl/SNMP/examples/pingmib.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/env perl
+#!/usr/bin/perl
# Ping a host via the CISCO-PING-MIB. For more information about the
# CISCO-PING-MIB, see also

39
debian/patches/series vendored
View File

@ -1,39 +0,0 @@
pingmib_perl_path
02_statistics.patch
03_makefiles.patch
05_searchdirs.patch
06_extramibs.patch
07_docfiles.patch
26_kfreebsd.patch
27_kfreebsd.patch
60_libsensors_api.patch
62_add_lib_cflags.patch
64_missing_lib.patch
fix_snmpcheck_perl_path.patch
fix_regular_expression.patch
snmptranslate.1.patch
fix_spelling_error.patch
fix_typo_in_snmpd.conf.patch
fix_manpage-has-errors_break_line.patch
add_rocommunity6.patch
fix-request-id-0.patch
0026-fix-Bug-785380-incorrect-date-format.patch
0027-fix-455707-traptoemail-use-FQDN.patch
let_perl_access_engineid.diff
fix_perl_bulk_gets.diff
#do_not_callback_for_failed_reports.diff
callback_print.diff
fix_engineid_reprobe.diff
snmpwalk_args_in_snmpcheck
snmpd_pidfile_mode
parsing_default_port
snmpcmd_1_groff
netsnmp_mib_api_3_groff
snmplib_error_subcontainer
apps_makefile_use_ldflags
Link-libnetsnmptrapd-against-MYSQL_LIBS.patch
mysql8-replace-bool.patch
autofs-skip-autofs-entries.patch
autofs-fix-a-recently-introduced-bug.patch
fix-check-hr-filesys-autofs.patch
lp1871307-log-once-proc-net-if_inet6-failure.patch

View File

@ -1,13 +0,0 @@
--- a/man/snmpcmd.1.def
+++ b/man/snmpcmd.1.def
@@ -905,8 +905,9 @@
Defaults to .iso.org.dod.internet.mgmt.mib\-2
.IP MIBS
The list of MIBs to load. Defaults to
-.br
+.ad l
SNMPv2\-TC:\:SNMPv2\-MIB:\:IF\-MIB:\:IP\-MIB:\:TCP\-MIB:\:UDP\-MIB:\:SNMP\-VACM\-MIB.
+.ad
.br
Overridden by the
.B \-m

View File

@ -1,18 +0,0 @@
Description: Make snmpd pidfile word-readable
Almost all pid files are mode 644, including snmptrapd. For some unknown
reason, snmpd had mode 0600. Now it has 644 like everyone else.
Author: Craig Small <csmall@debian.org>
Bug-Debian: https://bugs.debian.org/528103
Reviewed-by: Craig Small <csmall@debian.org>
Last-Update: 2019-04-30
--- a/agent/snmpd.c
+++ b/agent/snmpd.c
@@ -984,7 +984,7 @@
* already exists.
*/
unlink(pid_file);
- fd = open(pid_file, O_CREAT | O_EXCL | O_WRONLY, 0600);
+ fd = open(pid_file, O_CREAT | O_EXCL | O_WRONLY, 0644);
if (fd == -1) {
snmp_log_perror(pid_file);
if (!netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,

View File

@ -1,22 +0,0 @@
Description: Change logging on ia_addr message
Message about error with subcontainers is just debug, not a filtered by
keyword debug. This (along with logging options set to high in the init
script) made snmpd very chatty.
Author: Pik Master <pikmaster@wp.pl>
Origin: upstream, http://sourceforge.net/p/net-snmp/patches/1322/
Bug-Debian: https://bugs.debian.org/684721
Reviewed-by: Craig Small <csmall@debian.org>
Last-Update: 2019-10-10
--- a/snmplib/container.c
+++ b/snmplib/container.c
@@ -334,8 +334,8 @@
if(x) {
int rc = x->insert(x,k);
if(rc)
- snmp_log(LOG_DEBUG,"error on subcontainer '%s' insert (%d)\n",
- x->container_name ? x->container_name : "", rc);
+ DEBUGMSGTL(("container:insert_helper", "error on subcontainer '%s' insert (%d)\n",
+ x->container_name ? x->container_name : "", rc));
else {
rc = CONTAINER_INSERT_HELPER(x->next, k);
if(rc)

View File

@ -1,52 +0,0 @@
Description: snmptranslate.1 groff errors
Author: Hideki Yamane <henrich@debian.org>
Reviewed-by: Craig Small <csmall@debian.org>
Last-Update: 2019-02-07
--- a/man/snmptranslate.1.def
+++ b/man/snmptranslate.1.def
@@ -179,22 +179,22 @@
.nf
+--system(1)
|
- +-- -R-- String sysDescr(1)
+ +-- \-R-- String sysDescr(1)
| Textual Convention: DisplayString
| Size: 0..255
- +-- -R-- ObjID sysObjectID(2)
- +-- -R-- TimeTicks sysUpTime(3)
- +-- -RW- String sysContact(4)
+ +-- \-R-- ObjID sysObjectID(2)
+ +-- \-R-- TimeTicks sysUpTime(3)
+ +-- \-RW- String sysContact(4)
| Textual Convention: DisplayString
| Size: 0..255
- +-- -RW- String sysName(5)
+ +-- \-RW- String sysName(5)
| Textual Convention: DisplayString
| Size: 0..255
- +-- -RW- String sysLocation(6)
+ +-- \-RW- String sysLocation(6)
| Textual Convention: DisplayString
| Size: 0..255
- +-- -R-- Integer sysServices(7)
- +-- -R-- TimeTicks sysORLastChange(8)
+ +-- \-R-- Integer sysServices(7)
+ +-- \-R-- TimeTicks sysORLastChange(8)
| Textual Convention: TimeStamp
|
+--sysORTable(9)
@@ -202,11 +202,11 @@
+--sysOREntry(1)
|
+-- ---- Integer sysORIndex(1)
- +-- -R-- ObjID sysORID(2)
- +-- -R-- String sysORDescr(3)
+ +-- \-R-- ObjID sysORID(2)
+ +-- \-R-- String sysORDescr(3)
| Textual Convention: DisplayString
| Size: 0..255
- +-- -R-- TimeTicks sysORUpTime(4)
+ +-- \-R-- TimeTicks sysORUpTime(4)
Textual Convention: TimeStamp
.fi

View File

@ -1,26 +0,0 @@
From: Craig Small <csmall@debian.org>
Date: Fri, 20 Jul 2018 20:32:41 +1000
Subject: Correct snmpwalk args in snmpcheck
snmpcheck used the old command line arguments for snmpwalk giving an
error and no data.
Closes: #898197
References:
https://bugs.kali.org/view.php?id=4655
---
--- a/local/snmpcheck.def
+++ b/local/snmpcheck.def
@@ -27,8 +27,8 @@ $mibupdateconfig="$mibheadall.VERSIONMIB
'.LOADAVEMIBNUM.1' => 1,
'.ERRORMIBNUM' => 1);
$errlog="/net/tyfon/1/OV/log/ece-log";
-$default_get_args = "-v 1 %s private";
-$default_set_args = "-v 1 %s private";
+$default_get_args = "-v 1 -c private %s";
+$default_set_args = "-v 1 -c private %s";
$andlog=0;
$snmppath="BINDIR";
$eraseline=" \r";

View File

@ -1 +1 @@
3.0 (quilt) 3.0 (native)