Compare commits
No commits in common. 'c9' and 'i10c-beta' have entirely different histories.
@ -1 +1 @@
|
||||
SOURCES/net-snmp-5.9.1.tar.gz
|
||||
SOURCES/net-snmp-5.9.4.tar.gz
|
||||
|
@ -1 +1 @@
|
||||
0326d0e07c86f52100ceadd42c875a446309a846 SOURCES/net-snmp-5.9.1.tar.gz
|
||||
2f5e96165890158c45e73f9e24c5682885355a57 SOURCES/net-snmp-5.9.4.tar.gz
|
||||
|
@ -1,163 +0,0 @@
|
||||
From 9a0cd7c00947d5e1c6ceb54558d454f87c3b8341 Mon Sep 17 00:00:00 2001
|
||||
From: Bill Fenner <fenner@gmail.com>
|
||||
Date: Tue, 24 Aug 2021 07:55:00 -0700
|
||||
Subject: [PATCH] CHANGES: snmpd: recover SET status from delegated request
|
||||
|
||||
Reported by: Yu Zhang of VARAS@IIE, Nanyu Zhong of VARAS@IIE
|
||||
Fixes by: Arista Networks
|
||||
|
||||
When a SET request includes a mix of delegated and
|
||||
non-delegated requests (e.g., objects handled by master
|
||||
agent and agentx sub-agent), the status can get lost while
|
||||
waiting for the reply from the sub-agent. Recover the status
|
||||
into the session from the requests even if it has already
|
||||
been processed.
|
||||
---
|
||||
agent/snmp_agent.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/agent/snmp_agent.c b/agent/snmp_agent.c
|
||||
index 84fbb42b47..095ee70985 100644
|
||||
--- a/agent/snmp_agent.c
|
||||
+++ b/agent/snmp_agent.c
|
||||
@@ -2965,7 +2965,7 @@ netsnmp_check_requests_status(netsnmp_agent_session *asp,
|
||||
if (requests->status != SNMP_ERR_NOERROR &&
|
||||
(!look_for_specific || requests->status == look_for_specific)
|
||||
&& (look_for_specific || asp->index == 0
|
||||
- || requests->index < asp->index)) {
|
||||
+ || requests->index <= asp->index)) {
|
||||
asp->index = requests->index;
|
||||
asp->status = requests->status;
|
||||
}
|
||||
From 67ebb43e9038b2dae6e74ae8838b36fcc10fc937 Mon Sep 17 00:00:00 2001
|
||||
From: Bill Fenner <fenner@gmail.com>
|
||||
Date: Wed, 30 Jun 2021 14:00:28 -0700
|
||||
Subject: [PATCH] CHANGES: snmpd: fix bounds checking in NET-SNMP-AGENT-MIB,
|
||||
NET-SNMP-VACM-MIB, SNMP-VIEW-BASED-ACM-MIB, SNMP-USER-BASED-SM-MIB
|
||||
|
||||
Reported by: Yu Zhang of VARAS@IIE, Nanyu Zhong of VARAS@IIE
|
||||
Fixes by: Arista Networks
|
||||
---
|
||||
agent/mibgroup/agent/nsLogging.c | 6 ++++++
|
||||
agent/mibgroup/agent/nsVacmAccessTable.c | 16 ++++++++++++++--
|
||||
agent/mibgroup/mibII/vacm_vars.c | 3 +++
|
||||
agent/mibgroup/snmpv3/usmUser.c | 2 --
|
||||
4 files changed, 23 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/agent/mibgroup/agent/nsLogging.c b/agent/mibgroup/agent/nsLogging.c
|
||||
index 9abdeb5bb7..7f4290490a 100644
|
||||
--- a/agent/mibgroup/agent/nsLogging.c
|
||||
+++ b/agent/mibgroup/agent/nsLogging.c
|
||||
@@ -147,6 +147,8 @@ handle_nsLoggingTable(netsnmp_mib_handler *handler,
|
||||
continue;
|
||||
logh = (netsnmp_log_handler*)netsnmp_extract_iterator_context(request);
|
||||
table_info = netsnmp_extract_table_info(request);
|
||||
+ if (!table_info || !table_info->indexes)
|
||||
+ continue;
|
||||
|
||||
switch (table_info->colnum) {
|
||||
case NSLOGGING_TYPE:
|
||||
@@ -201,6 +203,8 @@ handle_nsLoggingTable(netsnmp_mib_handler *handler,
|
||||
}
|
||||
logh = (netsnmp_log_handler*)netsnmp_extract_iterator_context(request);
|
||||
table_info = netsnmp_extract_table_info(request);
|
||||
+ if (!table_info || !table_info->indexes)
|
||||
+ continue;
|
||||
|
||||
switch (table_info->colnum) {
|
||||
case NSLOGGING_TYPE:
|
||||
@@ -394,6 +398,8 @@ handle_nsLoggingTable(netsnmp_mib_handler *handler,
|
||||
continue;
|
||||
logh = (netsnmp_log_handler*)netsnmp_extract_iterator_context(request);
|
||||
table_info = netsnmp_extract_table_info(request);
|
||||
+ if (!table_info || !table_info->indexes)
|
||||
+ continue;
|
||||
|
||||
switch (table_info->colnum) {
|
||||
case NSLOGGING_TYPE:
|
||||
diff --git a/agent/mibgroup/agent/nsVacmAccessTable.c b/agent/mibgroup/agent/nsVacmAccessTable.c
|
||||
index cc61fce7e6..6c43210074 100644
|
||||
--- a/agent/mibgroup/agent/nsVacmAccessTable.c
|
||||
+++ b/agent/mibgroup/agent/nsVacmAccessTable.c
|
||||
@@ -170,9 +170,13 @@ nsVacmAccessTable_handler(netsnmp_mib_handler *handler,
|
||||
entry = (struct vacm_accessEntry *)
|
||||
netsnmp_extract_iterator_context(request);
|
||||
table_info = netsnmp_extract_table_info(request);
|
||||
+ if (!table_info || !table_info->indexes)
|
||||
+ continue;
|
||||
|
||||
/* Extract the authType token from the list of indexes */
|
||||
idx = table_info->indexes->next_variable->next_variable->next_variable->next_variable;
|
||||
+ if (idx->val_len >= sizeof(atype))
|
||||
+ continue;
|
||||
memset(atype, 0, sizeof(atype));
|
||||
memcpy(atype, (char *)idx->val.string, idx->val_len);
|
||||
viewIdx = se_find_value_in_slist(VACM_VIEW_ENUM_NAME, atype);
|
||||
@@ -212,6 +216,8 @@ nsVacmAccessTable_handler(netsnmp_mib_handler *handler,
|
||||
entry = (struct vacm_accessEntry *)
|
||||
netsnmp_extract_iterator_context(request);
|
||||
table_info = netsnmp_extract_table_info(request);
|
||||
+ if (!table_info || !table_info->indexes)
|
||||
+ continue;
|
||||
ret = SNMP_ERR_NOERROR;
|
||||
|
||||
switch (table_info->colnum) {
|
||||
@@ -247,6 +253,8 @@ nsVacmAccessTable_handler(netsnmp_mib_handler *handler,
|
||||
* Extract the authType token from the list of indexes
|
||||
*/
|
||||
idx = table_info->indexes->next_variable->next_variable->next_variable->next_variable;
|
||||
+ if (idx->val_len >= sizeof(atype))
|
||||
+ continue;
|
||||
memset(atype, 0, sizeof(atype));
|
||||
memcpy(atype, (char *)idx->val.string, idx->val_len);
|
||||
viewIdx = se_find_value_in_slist(VACM_VIEW_ENUM_NAME, atype);
|
||||
@@ -294,8 +302,10 @@ nsVacmAccessTable_handler(netsnmp_mib_handler *handler,
|
||||
idx = idx->next_variable; model = *idx->val.integer;
|
||||
idx = idx->next_variable; level = *idx->val.integer;
|
||||
entry = vacm_createAccessEntry( gName, cPrefix, model, level );
|
||||
- entry->storageType = ST_NONVOLATILE;
|
||||
- netsnmp_insert_iterator_context(request, (void*)entry);
|
||||
+ if (entry) {
|
||||
+ entry->storageType = ST_NONVOLATILE;
|
||||
+ netsnmp_insert_iterator_context(request, (void*)entry);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -321,6 +331,8 @@ nsVacmAccessTable_handler(netsnmp_mib_handler *handler,
|
||||
|
||||
/* Extract the authType token from the list of indexes */
|
||||
idx = table_info->indexes->next_variable->next_variable->next_variable->next_variable;
|
||||
+ if (idx->val_len >= sizeof(atype))
|
||||
+ continue;
|
||||
memset(atype, 0, sizeof(atype));
|
||||
memcpy(atype, (char *)idx->val.string, idx->val_len);
|
||||
viewIdx = se_find_value_in_slist(VACM_VIEW_ENUM_NAME, atype);
|
||||
diff --git a/agent/mibgroup/mibII/vacm_vars.c b/agent/mibgroup/mibII/vacm_vars.c
|
||||
index 469a1eba59..62c9a3d051 100644
|
||||
--- a/agent/mibgroup/mibII/vacm_vars.c
|
||||
+++ b/agent/mibgroup/mibII/vacm_vars.c
|
||||
@@ -997,6 +997,9 @@ access_parse_oid(oid * oidIndex, size_t oidLen,
|
||||
return 1;
|
||||
}
|
||||
groupNameL = oidIndex[0];
|
||||
+ if ((groupNameL + 1) > (int) oidLen) {
|
||||
+ return 1;
|
||||
+ }
|
||||
contextPrefixL = oidIndex[groupNameL + 1]; /* the initial name length */
|
||||
if ((int) oidLen != groupNameL + contextPrefixL + 4) {
|
||||
return 1;
|
||||
diff --git a/agent/mibgroup/snmpv3/usmUser.c b/agent/mibgroup/snmpv3/usmUser.c
|
||||
index 0f52aaba49..0edea53cfb 100644
|
||||
--- a/agent/mibgroup/snmpv3/usmUser.c
|
||||
+++ b/agent/mibgroup/snmpv3/usmUser.c
|
||||
@@ -1505,8 +1505,6 @@ write_usmUserStatus(int action,
|
||||
if (usmStatusCheck(uptr)) {
|
||||
uptr->userStatus = RS_ACTIVE;
|
||||
} else {
|
||||
- SNMP_FREE(engineID);
|
||||
- SNMP_FREE(newName);
|
||||
return SNMP_ERR_INCONSISTENTVALUE;
|
||||
}
|
||||
} else if (long_ret == RS_CREATEANDWAIT) {
|
||||
|
@ -1,129 +0,0 @@
|
||||
From 4589352dac3ae111c7621298cf231742209efd9b Mon Sep 17 00:00:00 2001
|
||||
From: Bill Fenner <fenner@gmail.com>
|
||||
Date: Fri, 25 Nov 2022 08:41:24 -0800
|
||||
Subject: [PATCH 1/3] snmp_agent: disallow SET with NULL varbind
|
||||
|
||||
---
|
||||
agent/snmp_agent.c | 32 ++++++++++++++++++++++++++++++++
|
||||
1 file changed, 32 insertions(+)
|
||||
|
||||
diff --git a/agent/snmp_agent.c b/agent/snmp_agent.c
|
||||
index 867d0c166f..3f678fe2df 100644
|
||||
--- a/agent/snmp_agent.c
|
||||
+++ b/agent/snmp_agent.c
|
||||
@@ -3719,12 +3719,44 @@ netsnmp_handle_request(netsnmp_agent_session *asp, int status)
|
||||
return 1;
|
||||
}
|
||||
|
||||
+static int
|
||||
+check_set_pdu_for_null_varbind(netsnmp_agent_session *asp)
|
||||
+{
|
||||
+ int i;
|
||||
+ netsnmp_variable_list *v = NULL;
|
||||
+
|
||||
+ for (i = 1, v = asp->pdu->variables; v != NULL; i++, v = v->next_variable) {
|
||||
+ if (v->type == ASN_NULL) {
|
||||
+ /*
|
||||
+ * Protect SET implementations that do not protect themselves
|
||||
+ * against wrong type.
|
||||
+ */
|
||||
+ DEBUGMSGTL(("snmp_agent", "disallowing SET with NULL var for varbind %d\n", i));
|
||||
+ asp->index = i;
|
||||
+ return SNMP_ERR_WRONGTYPE;
|
||||
+ }
|
||||
+ }
|
||||
+ return SNMP_ERR_NOERROR;
|
||||
+}
|
||||
+
|
||||
int
|
||||
handle_pdu(netsnmp_agent_session *asp)
|
||||
{
|
||||
int status, inclusives = 0;
|
||||
netsnmp_variable_list *v = NULL;
|
||||
|
||||
+#ifndef NETSNMP_NO_WRITE_SUPPORT
|
||||
+ /*
|
||||
+ * Check for ASN_NULL in SET request
|
||||
+ */
|
||||
+ if (asp->pdu->command == SNMP_MSG_SET) {
|
||||
+ status = check_set_pdu_for_null_varbind(asp);
|
||||
+ if (status != SNMP_ERR_NOERROR) {
|
||||
+ return status;
|
||||
+ }
|
||||
+ }
|
||||
+#endif /* NETSNMP_NO_WRITE_SUPPORT */
|
||||
+
|
||||
/*
|
||||
* for illegal requests, mark all nodes as ASN_NULL
|
||||
*/
|
||||
|
||||
From 7f4ac4051cc7fec6a5944661923acb95cec359c7 Mon Sep 17 00:00:00 2001
|
||||
From: Bill Fenner <fenner@gmail.com>
|
||||
Date: Fri, 25 Nov 2022 08:41:46 -0800
|
||||
Subject: [PATCH 2/3] apps: snmpset: allow SET with NULL varbind for testing
|
||||
|
||||
---
|
||||
apps/snmpset.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/apps/snmpset.c b/apps/snmpset.c
|
||||
index 48e14bd513..d542713e1b 100644
|
||||
--- a/apps/snmpset.c
|
||||
+++ b/apps/snmpset.c
|
||||
@@ -182,6 +182,7 @@ main(int argc, char *argv[])
|
||||
case 'x':
|
||||
case 'd':
|
||||
case 'b':
|
||||
+ case 'n': /* undocumented */
|
||||
#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
|
||||
case 'I':
|
||||
case 'U':
|
||||
|
||||
From 15f9d7f7e5b90c9b419832ed8e6413feb6570d83 Mon Sep 17 00:00:00 2001
|
||||
From: Bill Fenner <fenner@gmail.com>
|
||||
Date: Fri, 25 Nov 2022 10:23:32 -0800
|
||||
Subject: [PATCH 3/3] Add test for NULL varbind set
|
||||
|
||||
---
|
||||
.../default/T0142snmpv2csetnull_simple | 31 +++++++++++++++++++
|
||||
1 file changed, 31 insertions(+)
|
||||
create mode 100644 testing/fulltests/default/T0142snmpv2csetnull_simple
|
||||
|
||||
diff --git a/testing/fulltests/default/T0142snmpv2csetnull_simple b/testing/fulltests/default/T0142snmpv2csetnull_simple
|
||||
new file mode 100644
|
||||
index 0000000000..0f1b8f386b
|
||||
--- /dev/null
|
||||
+++ b/testing/fulltests/default/T0142snmpv2csetnull_simple
|
||||
@@ -0,0 +1,31 @@
|
||||
+#!/bin/sh
|
||||
+
|
||||
+. ../support/simple_eval_tools.sh
|
||||
+
|
||||
+HEADER SNMPv2c set of system.sysContact.0 with NULL varbind
|
||||
+
|
||||
+SKIPIF NETSNMP_DISABLE_SET_SUPPORT
|
||||
+SKIPIF NETSNMP_NO_WRITE_SUPPORT
|
||||
+SKIPIF NETSNMP_DISABLE_SNMPV2C
|
||||
+SKIPIFNOT USING_MIBII_SYSTEM_MIB_MODULE
|
||||
+
|
||||
+#
|
||||
+# Begin test
|
||||
+#
|
||||
+
|
||||
+# standard V2C configuration: testcomunnity
|
||||
+snmp_write_access='all'
|
||||
+. ./Sv2cconfig
|
||||
+STARTAGENT
|
||||
+
|
||||
+CAPTURE "snmpget -On $SNMP_FLAGS -c testcommunity -v 2c $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.4.0"
|
||||
+
|
||||
+CHECK ".1.3.6.1.2.1.1.4.0 = STRING:"
|
||||
+
|
||||
+CAPTURE "snmpset -On $SNMP_FLAGS -c testcommunity -v 2c $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.4.0 n x"
|
||||
+
|
||||
+CHECK "Reason: wrongType"
|
||||
+
|
||||
+STOPAGENT
|
||||
+
|
||||
+FINISHED
|
||||
|
@ -1,98 +0,0 @@
|
||||
From a1968db524e087a36a19a351b89bf6f1633819aa Mon Sep 17 00:00:00 2001
|
||||
From: minfrin <minfrin@users.noreply.github.com>
|
||||
Date: Tue, 5 Jan 2021 23:17:14 +0000
|
||||
Subject: [PATCH] Add support for digests detected from ECC certificates
|
||||
|
||||
Previously, the digest could be detected on RSA certificates only. This
|
||||
patch adds detection for ECC certificates.
|
||||
|
||||
[ bvanassche: changed _htmap2 into a two-dimensional array and renamed _htmap2
|
||||
back to _htmap ]
|
||||
---
|
||||
snmplib/snmp_openssl.c | 60 +++++++++++++++++++++++++++++++++++-------
|
||||
1 file changed, 50 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/snmplib/snmp_openssl.c b/snmplib/snmp_openssl.c
|
||||
index c092a007a..432cb5c27 100644
|
||||
--- a/snmplib/snmp_openssl.c
|
||||
+++ b/snmplib/snmp_openssl.c
|
||||
@@ -521,18 +521,54 @@ netsnmp_openssl_cert_dump_extensions(X509 *ocert)
|
||||
}
|
||||
}
|
||||
|
||||
-static int _htmap[NS_HASH_MAX + 1] = {
|
||||
- 0, NID_md5WithRSAEncryption, NID_sha1WithRSAEncryption,
|
||||
- NID_sha224WithRSAEncryption, NID_sha256WithRSAEncryption,
|
||||
- NID_sha384WithRSAEncryption, NID_sha512WithRSAEncryption };
|
||||
+static const struct {
|
||||
+ uint16_t nid;
|
||||
+ uint16_t ht;
|
||||
+} _htmap[] = {
|
||||
+ { 0, NS_HASH_NONE },
|
||||
+#ifdef NID_md5WithRSAEncryption
|
||||
+ { NID_md5WithRSAEncryption, NS_HASH_MD5 },
|
||||
+#endif
|
||||
+#ifdef NID_sha1WithRSAEncryption
|
||||
+ { NID_sha1WithRSAEncryption, NS_HASH_SHA1 },
|
||||
+#endif
|
||||
+#ifdef NID_ecdsa_with_SHA1
|
||||
+ { NID_ecdsa_with_SHA1, NS_HASH_SHA1 },
|
||||
+#endif
|
||||
+#ifdef NID_sha224WithRSAEncryption
|
||||
+ { NID_sha224WithRSAEncryption, NS_HASH_SHA224 },
|
||||
+#endif
|
||||
+#ifdef NID_ecdsa_with_SHA224
|
||||
+ { NID_ecdsa_with_SHA224, NS_HASH_SHA224 },
|
||||
+#endif
|
||||
+#ifdef NID_sha256WithRSAEncryption
|
||||
+ { NID_sha256WithRSAEncryption, NS_HASH_SHA256 },
|
||||
+#endif
|
||||
+#ifdef NID_ecdsa_with_SHA256
|
||||
+ { NID_ecdsa_with_SHA256, NS_HASH_SHA256 },
|
||||
+#endif
|
||||
+#ifdef NID_sha384WithRSAEncryption
|
||||
+ { NID_sha384WithRSAEncryption, NS_HASH_SHA384 },
|
||||
+#endif
|
||||
+#ifdef NID_ecdsa_with_SHA384
|
||||
+ { NID_ecdsa_with_SHA384, NS_HASH_SHA384 },
|
||||
+#endif
|
||||
+#ifdef NID_sha512WithRSAEncryption
|
||||
+ { NID_sha512WithRSAEncryption, NS_HASH_SHA512 },
|
||||
+#endif
|
||||
+#ifdef NID_ecdsa_with_SHA512
|
||||
+ { NID_ecdsa_with_SHA512, NS_HASH_SHA512 },
|
||||
+#endif
|
||||
+};
|
||||
|
||||
int
|
||||
_nid2ht(int nid)
|
||||
{
|
||||
int i;
|
||||
- for (i=1; i<= NS_HASH_MAX; ++i) {
|
||||
- if (nid == _htmap[i])
|
||||
- return i;
|
||||
+
|
||||
+ for (i = 0; i < sizeof(_htmap) / sizeof(_htmap[0]); i++) {
|
||||
+ if (_htmap[i].nid == nid)
|
||||
+ return _htmap[i].ht;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -541,9 +577,13 @@ _nid2ht(int nid)
|
||||
int
|
||||
_ht2nid(int ht)
|
||||
{
|
||||
- if ((ht < 0) || (ht > NS_HASH_MAX))
|
||||
- return 0;
|
||||
- return _htmap[ht];
|
||||
+ int i;
|
||||
+
|
||||
+ for (i = 0; i < sizeof(_htmap) / sizeof(_htmap[0]); i++) {
|
||||
+ if (_htmap[i].ht == ht)
|
||||
+ return _htmap[i].nid;
|
||||
+ }
|
||||
+ return 0;
|
||||
}
|
||||
#endif /* NETSNMP_FEATURE_REMOVE_OPENSSL_HT2NID */
|
||||
|
||||
|
@ -1,18 +1,18 @@
|
||||
diff --git a/net-snmp-create-v3-user.in b/net-snmp-create-v3-user.in
|
||||
index ac3c60f..177c00f 100644
|
||||
index afd6fa4..07c26fe 100644
|
||||
--- a/net-snmp-create-v3-user.in
|
||||
+++ b/net-snmp-create-v3-user.in
|
||||
@@ -57,11 +57,11 @@ case $1 in
|
||||
@@ -58,11 +58,11 @@ case $1 in
|
||||
exit 1
|
||||
fi
|
||||
case $1 in
|
||||
- DES|AES|AES128)
|
||||
+ AES|AES128|AES192|AES256)
|
||||
+ DES|AES|AES128|AES192|AES256)
|
||||
Xalgorithm=$1
|
||||
shift
|
||||
;;
|
||||
- des|aes|aes128)
|
||||
+ aes|aes128|aes192|aes256)
|
||||
+ des|aes|aes128|aes192|aes256)
|
||||
Xalgorithm=$(echo "$1" | tr a-z A-Z)
|
||||
shift
|
||||
;;
|
||||
|
@ -1,43 +0,0 @@
|
||||
diff -urNp a/agent/mibgroup/if-mib/data_access/interface_linux.c b/agent/mibgroup/if-mib/data_access/interface_linux.c
|
||||
--- a/agent/mibgroup/if-mib/data_access/interface_linux.c 2024-07-16 10:05:43.294653089 +0200
|
||||
+++ b/agent/mibgroup/if-mib/data_access/interface_linux.c 2024-07-16 10:23:55.392041022 +0200
|
||||
@@ -609,7 +609,6 @@ netsnmp_arch_interface_container_load(ne
|
||||
{
|
||||
FILE *devin;
|
||||
char line[256];
|
||||
- netsnmp_interface_entry *entry = NULL;
|
||||
static char scan_expected = 0;
|
||||
int fd;
|
||||
int interfaces = 0;
|
||||
@@ -690,6 +689,7 @@ netsnmp_arch_interface_container_load(ne
|
||||
* and retrieve (or create) the corresponding data structure.
|
||||
*/
|
||||
while (fgets(line, sizeof(line), devin)) {
|
||||
+ netsnmp_interface_entry *entry = NULL;
|
||||
char *stats, *ifstart = line;
|
||||
u_int flags;
|
||||
oid if_index;
|
||||
@@ -733,8 +733,13 @@ netsnmp_arch_interface_container_load(ne
|
||||
* ip version is to look for ip addresses. If anyone
|
||||
* knows a better way, put it here!
|
||||
*/
|
||||
-#ifdef NETSNMP_ENABLE_IPV6
|
||||
if_index = netsnmp_arch_interface_index_find(ifstart);
|
||||
+ if (if_index == 0) {
|
||||
+ DEBUGMSGTL(("access:interface", "network interface %s is gone",
|
||||
+ ifstart));
|
||||
+ continue;
|
||||
+ }
|
||||
+#ifdef NETSNMP_ENABLE_IPV6
|
||||
_arch_interface_has_ipv6(if_index, &flags, addr_container);
|
||||
#endif
|
||||
netsnmp_access_interface_ioctl_has_ipv4(fd, ifstart, 0, &flags, &ifc);
|
||||
@@ -752,7 +757,7 @@ netsnmp_arch_interface_container_load(ne
|
||||
continue;
|
||||
}
|
||||
|
||||
- entry = netsnmp_access_interface_entry_create(ifstart, 0);
|
||||
+ entry = netsnmp_access_interface_entry_create(ifstart, if_index);
|
||||
if(NULL == entry) {
|
||||
#ifdef NETSNMP_ENABLE_IPV6
|
||||
netsnmp_access_ipaddress_container_free(addr_container, 0);
|
@ -1,180 +0,0 @@
|
||||
diff --git a/agent/mibgroup/ucd-snmp/disk.c b/agent/mibgroup/ucd-snmp/disk.c
|
||||
index 7c756ff..ff22019 100644
|
||||
--- a/agent/mibgroup/ucd-snmp/disk.c
|
||||
+++ b/agent/mibgroup/ucd-snmp/disk.c
|
||||
@@ -153,9 +153,10 @@ static void disk_free_config(void);
|
||||
static void disk_parse_config(const char *, char *);
|
||||
static void disk_parse_config_all(const char *, char *);
|
||||
#if HAVE_FSTAB_H || HAVE_GETMNTENT || HAVE_STATFS
|
||||
-static void find_and_add_allDisks(int minpercent);
|
||||
+static void refresh_disk_table(int addNewDisks, int minpercent);
|
||||
static void add_device(char *path, char *device,
|
||||
- int minspace, int minpercent, int override);
|
||||
+ int minspace, int minpercent, int addNewDisks,
|
||||
+ int override);
|
||||
static void modify_disk_parameters(int index, int minspace,
|
||||
int minpercent);
|
||||
static int disk_exists(char *path);
|
||||
@@ -167,6 +168,7 @@ struct diskpart {
|
||||
char path[STRMAX];
|
||||
int minimumspace;
|
||||
int minpercent;
|
||||
+ int alive;
|
||||
};
|
||||
|
||||
#define MAX_INT_32 0x7fffffff
|
||||
@@ -174,6 +176,7 @@ struct diskpart {
|
||||
|
||||
unsigned int numdisks;
|
||||
int allDisksIncluded = 0;
|
||||
+int allDisksMinPercent = 0;
|
||||
unsigned int maxdisks = 0;
|
||||
struct diskpart *disks;
|
||||
|
||||
@@ -238,6 +241,7 @@ init_disk(void)
|
||||
disk_free_config,
|
||||
"minpercent%");
|
||||
allDisksIncluded = 0;
|
||||
+ allDisksMinPercent = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -253,6 +257,7 @@ disk_free_config(void)
|
||||
disks[i].minpercent = -1;
|
||||
}
|
||||
allDisksIncluded = 0;
|
||||
+ allDisksMinPercent = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -313,7 +318,7 @@ disk_parse_config(const char *token, char *cptr)
|
||||
* check if the disk already exists, if so then modify its
|
||||
* parameters. if it does not exist then add it
|
||||
*/
|
||||
- add_device(path, find_device(path), minspace, minpercent, 1);
|
||||
+ add_device(path, find_device(path), minspace, minpercent, 1, 1);
|
||||
#endif /* HAVE_FSTAB_H || HAVE_GETMNTENT || HAVE_STATFS */
|
||||
}
|
||||
|
||||
@@ -372,7 +377,7 @@ disk_parse_config_all(const char *token, char *cptr)
|
||||
|
||||
#if HAVE_FSTAB_H || HAVE_GETMNTENT || HAVE_STATFS
|
||||
static void
|
||||
-add_device(char *path, char *device, int minspace, int minpercent, int override)
|
||||
+add_device(char *path, char *device, int minspace, int minpercent, int addNewDisks, int override)
|
||||
{
|
||||
int index;
|
||||
|
||||
@@ -402,10 +407,16 @@ add_device(char *path, char *device, int minspace, int minpercent, int override)
|
||||
}
|
||||
|
||||
index = disk_exists(path);
|
||||
- if((index != -1) && (index < maxdisks) && (override==1)) {
|
||||
- modify_disk_parameters(index, minspace, minpercent);
|
||||
+ if((index != -1) && (index < maxdisks)) {
|
||||
+ /* the path is already in the table */
|
||||
+ disks[index].alive = 1;
|
||||
+ /* -> update its device */
|
||||
+ strlcpy(disks[index].device, device, sizeof(disks[index].device));
|
||||
+ if (override == 1) {
|
||||
+ modify_disk_parameters(index, minspace, minpercent);
|
||||
+ }
|
||||
}
|
||||
- else if(index == -1){
|
||||
+ else if(index == -1 && addNewDisks){
|
||||
/* add if and only if the device was found */
|
||||
if(device[0] != 0) {
|
||||
/* The following buffers are cleared above, no need to add '\0' */
|
||||
@@ -413,6 +424,7 @@ add_device(char *path, char *device, int minspace, int minpercent, int override)
|
||||
strlcpy(disks[numdisks].device, device, sizeof(disks[numdisks].device));
|
||||
disks[numdisks].minimumspace = minspace;
|
||||
disks[numdisks].minpercent = minpercent;
|
||||
+ disks[numdisks].alive = 1;
|
||||
numdisks++;
|
||||
}
|
||||
else {
|
||||
@@ -420,6 +432,7 @@ add_device(char *path, char *device, int minspace, int minpercent, int override)
|
||||
disks[numdisks].minpercent = -1;
|
||||
disks[numdisks].path[0] = 0;
|
||||
disks[numdisks].device[0] = 0;
|
||||
+ disks[numdisks].alive = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -444,7 +457,7 @@ int disk_exists(char *path)
|
||||
}
|
||||
|
||||
static void
|
||||
-find_and_add_allDisks(int minpercent)
|
||||
+refresh_disk_table(int addNewDisks, int minpercent)
|
||||
{
|
||||
#if HAVE_GETMNTENT
|
||||
#if HAVE_SYS_MNTTAB_H
|
||||
@@ -480,7 +493,7 @@ find_and_add_allDisks(int minpercent)
|
||||
return;
|
||||
}
|
||||
while (mntfp && NULL != (mntent = getmntent(mntfp))) {
|
||||
- add_device(mntent->mnt_dir, mntent->mnt_fsname, -1, minpercent, 0);
|
||||
+ add_device(mntent->mnt_dir, mntent->mnt_fsname, -1, minpercent, addNewDisks, 0);
|
||||
dummy = 1;
|
||||
}
|
||||
if (mntfp)
|
||||
@@ -497,7 +510,7 @@ find_and_add_allDisks(int minpercent)
|
||||
return;
|
||||
}
|
||||
while ((i = getmntent(mntfp, &mnttab)) == 0) {
|
||||
- add_device(mnttab.mnt_mountp, mnttab.mnt_special, -1, minpercent, 0);
|
||||
+ add_device(mnttab.mnt_mountp, mnttab.mnt_special, -1, minpercent, addNewDisks, 0);
|
||||
dummy = 1;
|
||||
}
|
||||
fclose(mntfp);
|
||||
@@ -514,13 +527,13 @@ find_and_add_allDisks(int minpercent)
|
||||
mntsize = getmntinfo(&mntbuf, MNT_NOWAIT);
|
||||
for (i = 0; i < mntsize; i++) {
|
||||
add_device(mntbuf[i].f_mntonname, mntbuf[i].f_mntfromname, -1,
|
||||
- minpercent, 0);
|
||||
+ minpercent, addNewDisks 0);
|
||||
}
|
||||
}
|
||||
#elif HAVE_FSTAB_H
|
||||
setfsent(); /* open /etc/fstab */
|
||||
while((fstab1 = getfsent()) != NULL) {
|
||||
- add_device(fstab1->fs_file, fstab1->fs_spec, -1, minpercent, 0);
|
||||
+ add_device(fstab1->fs_file, fstab1->fs_spec, -1, minpercent, addNewDisks, 0);
|
||||
dummy = 1;
|
||||
}
|
||||
endfsent(); /* close /etc/fstab */
|
||||
@@ -535,7 +548,7 @@ find_and_add_allDisks(int minpercent)
|
||||
* statfs we default to the root partition "/"
|
||||
*/
|
||||
if (statfs("/", &statf) == 0) {
|
||||
- add_device("/", statf.f_mntfromname, -1, minpercent, 0);
|
||||
+ add_device("/", statf.f_mntfromname, -1, minpercent, addNewDisks, 0);
|
||||
}
|
||||
#endif
|
||||
else {
|
||||
@@ -694,6 +707,10 @@ fill_dsk_entry(int disknum, struct dsk_entry *entry)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+ if (disks[disknum].alive == 0){
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
entry->dskPercentInode = -1;
|
||||
|
||||
#if defined(HAVE_STATVFS) || defined(HAVE_STATFS)
|
||||
@@ -825,6 +842,13 @@ var_extensible_disk(struct variable *vp,
|
||||
static char *errmsg;
|
||||
static char empty_str[1];
|
||||
|
||||
+ int i;
|
||||
+ for (i = 0; i < numdisks; i++){
|
||||
+ disks[i].alive = 0;
|
||||
+ }
|
||||
+ /* dynamically add new disks + update alive flag */
|
||||
+ refresh_disk_table(allDisksIncluded, allDisksMinPercent);
|
||||
+
|
||||
tryAgain:
|
||||
if (header_simple_table
|
||||
(vp, name, length, exact, var_len, write_method, numdisks))
|
@ -1,13 +0,0 @@
|
||||
diff --git a/apps/Makefile.in b/apps/Makefile.in
|
||||
index d4529d3..175242b 100644
|
||||
--- a/apps/Makefile.in
|
||||
+++ b/apps/Makefile.in
|
||||
@@ -237,7 +237,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) $(LIB_LD_LIBS) $(MYSQL_LIBS)
|
||||
$(RANLIB) $@
|
||||
|
||||
snmpinforminstall:
|
@ -1,48 +0,0 @@
|
||||
From 7330e3e3e08d9baff23332e764f9a53561939fff Mon Sep 17 00:00:00 2001
|
||||
From: Bart Van Assche <bvanassche@acm.org>
|
||||
Date: Thu, 2 Sep 2021 21:06:54 -0700
|
||||
Subject: [PATCH] libsnmp: Log "Truncating integer value >32 bits" once
|
||||
|
||||
Log this message once instead of every time sysUpTime and/or
|
||||
hrSystemUptime are accessed after snmpd is running for more than 497 days.
|
||||
|
||||
Fixes: https://github.com/net-snmp/net-snmp/issues/144
|
||||
---
|
||||
snmplib/snmp_client.c | 9 ++++++---
|
||||
1 file changed, 6 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/snmplib/snmp_client.c b/snmplib/snmp_client.c
|
||||
index 0f539c63fe..b00670d973 100644
|
||||
--- a/snmplib/snmp_client.c
|
||||
+++ b/snmplib/snmp_client.c
|
||||
@@ -853,7 +853,8 @@ snmp_set_var_value(netsnmp_variable_list * vars,
|
||||
= (const u_long *) value;
|
||||
*(vars->val.integer) = *val_ulong;
|
||||
if (*(vars->val.integer) > 0xffffffff) {
|
||||
- snmp_log(LOG_ERR,"truncating integer value > 32 bits\n");
|
||||
+ NETSNMP_LOGONCE((LOG_INFO,
|
||||
+ "truncating integer value > 32 bits\n"));
|
||||
*(vars->val.integer) &= 0xffffffff;
|
||||
}
|
||||
}
|
||||
@@ -865,7 +866,8 @@ snmp_set_var_value(netsnmp_variable_list * vars,
|
||||
= (const unsigned long long *) value;
|
||||
*(vars->val.integer) = (long) *val_ullong;
|
||||
if (*(vars->val.integer) > 0xffffffff) {
|
||||
- snmp_log(LOG_ERR,"truncating integer value > 32 bits\n");
|
||||
+ NETSNMP_LOGONCE((LOG_INFO,
|
||||
+ "truncating integer value > 32 bits\n"));
|
||||
*(vars->val.integer) &= 0xffffffff;
|
||||
}
|
||||
}
|
||||
@@ -877,7 +879,8 @@ snmp_set_var_value(netsnmp_variable_list * vars,
|
||||
= (const uintmax_t *) value;
|
||||
*(vars->val.integer) = (long) *val_uintmax_t;
|
||||
if (*(vars->val.integer) > 0xffffffff) {
|
||||
- snmp_log(LOG_ERR,"truncating integer value > 32 bits\n");
|
||||
+ NETSNMP_LOGONCE((LOG_INFO,
|
||||
+ "truncating integer value > 32 bits\n"));
|
||||
*(vars->val.integer) &= 0xffffffff;
|
||||
}
|
||||
}
|
||||
|
@ -1,84 +0,0 @@
|
||||
diff -urNp a/include/net-snmp/library/snmp_openssl.h b/include/net-snmp/library/snmp_openssl.h
|
||||
--- a/include/net-snmp/library/snmp_openssl.h 2021-09-15 07:55:39.829901038 +0200
|
||||
+++ b/include/net-snmp/library/snmp_openssl.h 2021-09-15 07:56:18.656412998 +0200
|
||||
@@ -44,7 +44,6 @@ extern "C" {
|
||||
/*
|
||||
* misc
|
||||
*/
|
||||
- void netsnmp_openssl_err_log(const char *prefix);
|
||||
void netsnmp_openssl_null_checks(SSL *ssl, int *nullAuth, int *nullCipher);
|
||||
|
||||
/*
|
||||
diff -urNp a/snmplib/snmp_openssl.c b/snmplib/snmp_openssl.c
|
||||
--- a/snmplib/snmp_openssl.c 2021-09-15 07:55:39.785900458 +0200
|
||||
+++ b/snmplib/snmp_openssl.c 2021-09-15 07:57:30.914417600 +0200
|
||||
@@ -937,20 +937,6 @@ netsnmp_openssl_cert_issued_by(X509 *iss
|
||||
return (X509_check_issued(issuer, cert) == X509_V_OK);
|
||||
}
|
||||
|
||||
-
|
||||
-#ifndef NETSNMP_FEATURE_REMOVE_OPENSSL_ERR_LOG
|
||||
-void
|
||||
-netsnmp_openssl_err_log(const char *prefix)
|
||||
-{
|
||||
- unsigned long err;
|
||||
- for (err = ERR_get_error(); err; err = ERR_get_error()) {
|
||||
- snmp_log(LOG_ERR,"%s: %ld\n", prefix ? prefix: "openssl error", err);
|
||||
- snmp_log(LOG_ERR, "library=%d, function=%d, reason=%d\n",
|
||||
- ERR_GET_LIB(err), ERR_GET_FUNC(err), ERR_GET_REASON(err));
|
||||
- }
|
||||
-}
|
||||
-#endif /* NETSNMP_FEATURE_REMOVE_OPENSSL_ERR_LOG */
|
||||
-
|
||||
void
|
||||
netsnmp_openssl_null_checks(SSL *ssl, int *null_auth, int *null_cipher)
|
||||
{
|
||||
diff -urNp a/snmplib/transports/snmpTLSBaseDomain.c b/snmplib/transports/snmpTLSBaseDomain.c
|
||||
--- a/snmplib/transports/snmpTLSBaseDomain.c 2021-05-18 11:15:09.247472175 +0200
|
||||
+++ b/snmplib/transports/snmpTLSBaseDomain.c 2021-05-24 09:39:29.297494727 +0200
|
||||
@@ -54,17 +54,6 @@ netsnmp_feature_require(cert_util);
|
||||
|
||||
int openssl_local_index;
|
||||
|
||||
-#ifndef HAVE_ERR_GET_ERROR_ALL
|
||||
-/* A backport of the OpenSSL 1.1.1e ERR_get_error_all() function. */
|
||||
-static unsigned long ERR_get_error_all(const char **file, int *line,
|
||||
- const char **func,
|
||||
- const char **data, int *flags)
|
||||
-{
|
||||
- *func = NULL;
|
||||
- return ERR_get_error_line_data(file, line, data, flags);
|
||||
-}
|
||||
-#endif
|
||||
-
|
||||
/* this is called during negotiation */
|
||||
int verify_callback(int ok, X509_STORE_CTX *ctx) {
|
||||
int err, depth;
|
||||
@@ -1187,27 +1176,6 @@ void _openssl_log_error(int rc, SSL *con
|
||||
ERR_reason_error_string(ERR_get_error()));
|
||||
|
||||
}
|
||||
-
|
||||
- /* other errors */
|
||||
- while ((numerical_reason =
|
||||
- ERR_get_error_all(&file, &line, &func, &data, &flags)) != 0) {
|
||||
- snmp_log(LOG_ERR, "%s (file %s, func %s, line %d)\n",
|
||||
- ERR_error_string(numerical_reason, NULL), file, func, line);
|
||||
-
|
||||
- /* if we have a text translation: */
|
||||
- if (data && (flags & ERR_TXT_STRING)) {
|
||||
- snmp_log(LOG_ERR, " Textual Error: %s\n", data);
|
||||
- /*
|
||||
- * per openssl man page: If it has been allocated by
|
||||
- * OPENSSL_malloc(), *flags&ERR_TXT_MALLOCED is true.
|
||||
- *
|
||||
- * arggh... stupid openssl prototype for ERR_get_error_line_data
|
||||
- * wants a const char **, but returns something that we might
|
||||
- * need to free??
|
||||
- */
|
||||
- if (flags & ERR_TXT_MALLOCED)
|
||||
- OPENSSL_free(NETSNMP_REMOVE_CONST(void *, data)); }
|
||||
- }
|
||||
|
||||
snmp_log(LOG_ERR, "---- End of OpenSSL Errors ----\n");
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
From 298c8103db80b292791616af4fd497342a71867f Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Josef=20=C5=98=C3=ADdk=C3=BD?= <jridky@redhat.com>
|
||||
Date: Wed, 24 May 2023 10:49:41 +0200
|
||||
Subject: [PATCH] libsnmp, UDP transport: Fix sendmsg() error code handling
|
||||
|
||||
This change has been made because of Linux kernel commit "ipv4: Return
|
||||
-ENETUNREACH if we can't create route but saddr is valid"
|
||||
(https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=595e0651d029)
|
||||
|
||||
Fixes: https://github.com/net-snmp/net-snmp/issues/564
|
||||
Fixes: https://github.com/net-snmp/net-snmp/pull/576
|
||||
|
||||
[ bvanassche: edited commit message ]
|
||||
---
|
||||
snmplib/transports/snmpUDPBaseDomain.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/snmplib/transports/snmpUDPBaseDomain.c b/snmplib/transports/snmpUDPBaseDomain.c
|
||||
index ca8f9a5554..cd6b15e2ad 100644
|
||||
--- a/snmplib/transports/snmpUDPBaseDomain.c
|
||||
+++ b/snmplib/transports/snmpUDPBaseDomain.c
|
||||
@@ -315,7 +315,7 @@ int netsnmp_udpbase_sendto_unix(int fd, const struct in_addr *srcip,
|
||||
sizeof(struct sockaddr));
|
||||
else
|
||||
rc = sendmsg(fd, &m, MSG_DONTWAIT);
|
||||
- if (rc >= 0 || errno != EINVAL)
|
||||
+ if (rc >= 0 || (errno != EINVAL && errno != ENETUNREACH))
|
||||
return rc;
|
||||
|
||||
/*
|
||||
|
@ -1,16 +0,0 @@
|
||||
diff --git a/snmplib/transports/snmpUDPIPv6Domain.c b/snmplib/transports/snmpUDPIPv6Domain.c
|
||||
index e6f5b20..41a5e01 100644
|
||||
--- a/snmplib/transports/snmpUDPIPv6Domain.c
|
||||
+++ b/snmplib/transports/snmpUDPIPv6Domain.c
|
||||
@@ -34,6 +34,11 @@
|
||||
#if HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
+
|
||||
+#if defined(HAVE_WINSOCK_H) && !defined(mingw32)
|
||||
+static const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT;
|
||||
+#endif
|
||||
+
|
||||
#if HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h>
|
||||
#endif
|
@ -1,12 +0,0 @@
|
||||
diff --git a/agent/snmpd.c b/agent/snmpd.c
|
||||
index ae73eda..f01b890 100644
|
||||
--- a/agent/snmpd.c
|
||||
+++ b/agent/snmpd.c
|
||||
@@ -289,6 +289,7 @@ usage(char *prog)
|
||||
" -S d|i|0-7\t\tuse -Ls <facility> instead\n"
|
||||
"\n"
|
||||
);
|
||||
+ exit(1);
|
||||
}
|
||||
|
||||
static void
|
@ -1,60 +0,0 @@
|
||||
From 8c1dad23301692799749d75a3c039b8ae7c07f8e Mon Sep 17 00:00:00 2001
|
||||
From: Bart Van Assche <bvanassche@acm.org>
|
||||
Date: Wed, 9 Jun 2021 14:19:46 -0700
|
||||
Subject: [PATCH] Python: Fix snmpwalk with UseNumeric=1
|
||||
|
||||
Fixes: c744be5ffed6 ("Python: Introduce build_python_varbind()")
|
||||
Fixes: https://github.com/net-snmp/net-snmp/issues/303
|
||||
---
|
||||
python/netsnmp/client_intf.c | 9 ++++-----
|
||||
1 file changed, 4 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/python/netsnmp/client_intf.c b/python/netsnmp/client_intf.c
|
||||
index e5e7372303..94da39fe34 100644
|
||||
--- a/python/netsnmp/client_intf.c
|
||||
+++ b/python/netsnmp/client_intf.c
|
||||
@@ -1316,7 +1316,7 @@ netsnmp_delete_session(PyObject *self, PyObject *args)
|
||||
|
||||
static int build_python_varbind(PyObject *varbind, netsnmp_variable_list *vars,
|
||||
int varlist_ind, int sprintval_flag, int *len,
|
||||
- char **str_buf)
|
||||
+ char **str_buf, int getlabel_flag)
|
||||
{
|
||||
struct tree *tp;
|
||||
int type;
|
||||
@@ -1326,7 +1326,6 @@ static int build_python_varbind(PyObject *varbind, netsnmp_variable_list *vars,
|
||||
int buf_over = 0;
|
||||
const char *tag;
|
||||
const char *iid;
|
||||
- int getlabel_flag = NO_FLAGS;
|
||||
|
||||
if (!PyObject_HasAttrString(varbind, "tag"))
|
||||
return TYPE_OTHER;
|
||||
@@ -1523,7 +1522,7 @@ netsnmp_get_or_getnext(PyObject *self, PyObject *args, int pdu_type,
|
||||
|
||||
varbind = PySequence_GetItem(varlist, varlist_ind);
|
||||
type = build_python_varbind(varbind, vars, varlist_ind, sprintval_flag,
|
||||
- &len, &str_buf);
|
||||
+ &len, &str_buf, getlabel_flag);
|
||||
if (type != TYPE_OTHER) {
|
||||
/* save in return tuple as well */
|
||||
if ((type == SNMP_ENDOFMIBVIEW) ||
|
||||
@@ -1832,7 +1831,7 @@ netsnmp_walk(PyObject *self, PyObject *args)
|
||||
|
||||
varbind = py_netsnmp_construct_varbind();
|
||||
if (varbind && build_python_varbind(varbind, vars, varlist_ind,
|
||||
- sprintval_flag, &len, &str_buf) !=
|
||||
+ sprintval_flag, &len, &str_buf, getlabel_flag) !=
|
||||
TYPE_OTHER) {
|
||||
const int hex = is_hex(str_buf, len);
|
||||
|
||||
@@ -2055,7 +2054,7 @@ netsnmp_getbulk(PyObject *self, PyObject *args)
|
||||
|
||||
varbind = py_netsnmp_construct_varbind();
|
||||
if (varbind && build_python_varbind(varbind, vars, varbind_ind,
|
||||
- sprintval_flag, &len, &str_buf) != TYPE_OTHER) {
|
||||
+ sprintval_flag, &len, &str_buf, getlabel_flag) != TYPE_OTHER) {
|
||||
const int hex = is_hex(str_buf, len);
|
||||
|
||||
/* push varbind onto varbinds */
|
||||
|
@ -0,0 +1,175 @@
|
||||
diff -urNp a/man/net-snmp-config.1.def b/man/net-snmp-config.1.def
|
||||
--- a/man/net-snmp-config.1.def 2021-05-26 09:30:07.430790003 +0200
|
||||
+++ b/man/net-snmp-config.1.def 2021-05-26 09:35:36.703673542 +0200
|
||||
@@ -30,7 +30,7 @@ code for a list of available debug token
|
||||
SNMP Setup commands:
|
||||
.TP
|
||||
\fB\-\-create\-snmpv3\-user\fR [\-ro] [\-a authpass] [\-x privpass]
|
||||
-[\-X DES|AES] [\-A MD5|SHA|SHA-512|SHA-384|SHA-256|SHA-224] [username]
|
||||
+[\-X AES] [\-A MD5|SHA|SHA-512|SHA-384|SHA-256|SHA-224] [username]
|
||||
.PP
|
||||
These options produce the various compilation flags needed when
|
||||
building external SNMP applications:
|
||||
diff -urNp a/man/net-snmp-create-v3-user.1.def b/man/net-snmp-create-v3-user.1.def
|
||||
--- a/man/net-snmp-create-v3-user.1.def 2021-05-26 09:30:07.430790003 +0200
|
||||
+++ b/man/net-snmp-create-v3-user.1.def 2021-05-26 09:34:23.702034230 +0200
|
||||
@@ -3,7 +3,7 @@
|
||||
net-snmp-create-v3-user \- create a SNMPv3 user in net-snmp configuration file
|
||||
.SH SYNOPSIS
|
||||
.PP
|
||||
-.B net-snmp-create-v3-user [-ro] [-A authpass] [-a MD5|SHA] [-X privpass] [-x DES|AES]
|
||||
+.B net-snmp-create-v3-user [-ro] [-A authpass] [-a MD5|SHA] [-X privpass] [-x AES]
|
||||
.B [username]
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
@@ -27,5 +27,5 @@ specifies the authentication password ha
|
||||
\fB\-X privpass\fR
|
||||
specifies the encryption password
|
||||
.TP
|
||||
-\fB\-x DES|AES\fR
|
||||
+\fB\-x AES\fR
|
||||
specifies the encryption algorithm
|
||||
diff -urNp a/man/snmpcmd.1.def b/man/snmpcmd.1.def
|
||||
--- a/man/snmpcmd.1.def 2021-05-26 09:30:07.429789994 +0200
|
||||
+++ b/man/snmpcmd.1.def 2021-05-26 09:37:51.104850500 +0200
|
||||
@@ -311,7 +311,7 @@ Overrides the \fIdefSecurityName\fR toke
|
||||
file.
|
||||
.TP
|
||||
.BI \-x " privProtocol"
|
||||
-Set the privacy protocol (DES or AES) used for encrypted SNMPv3 messages.
|
||||
+Set the privacy protocol (AES) used for encrypted SNMPv3 messages.
|
||||
Overrides the \fIdefPrivType\fR token in the
|
||||
.I snmp.conf
|
||||
file. This option is only valid if the Net-SNMP software was build
|
||||
diff -urNp a/man/snmp.conf.5.def b/man/snmp.conf.5.def
|
||||
--- a/man/snmp.conf.5.def 2021-05-26 09:30:07.429789994 +0200
|
||||
+++ b/man/snmp.conf.5.def 2021-05-26 09:40:03.730011937 +0200
|
||||
@@ -221,13 +221,13 @@ The
|
||||
value will be used for the authentication and/or privacy pass phrases
|
||||
if either of the other directives are not specified.
|
||||
.IP "defAuthType MD5|SHA|SHA-512|SHA-384|SHA-256|SHA-224"
|
||||
-.IP "defPrivType DES|AES"
|
||||
+.IP "defPrivType AES"
|
||||
define the default authentication and privacy protocols to use for
|
||||
SNMPv3 requests.
|
||||
These can be overridden using the \fB\-a\fR and \fB\-x\fR options respectively.
|
||||
.IP
|
||||
If not specified, SNMPv3 requests will default to MD5 authentication
|
||||
-and DES encryption.
|
||||
+and AES encryption.
|
||||
.RS
|
||||
.IP "Note:
|
||||
If the software has not been compiled to use the OpenSSL libraries,
|
||||
@@ -262,8 +262,7 @@ master keys which have been converted to
|
||||
suitable for on particular SNMP engine (agent). The length of the key
|
||||
needs to be appropriate for the authentication or encryption type
|
||||
being used (auth keys: MD5=16 bytes, SHA1=20 bytes;
|
||||
-priv keys: DES=16 bytes (8
|
||||
-bytes of which is used as an IV and not a key), and AES=16 bytes).
|
||||
+priv keys: AES=16 bytes).
|
||||
.IP "sshtosnmpsocket PATH"
|
||||
Sets the path of the \fBsshtosnmp\fR socket created by an application
|
||||
(e.g. snmpd) listening for incoming ssh connections through the
|
||||
diff -urNp a/man/snmpd.examples.5.def b/man/snmpd.examples.5.def
|
||||
--- a/man/snmpd.examples.5.def 2021-05-26 09:30:07.429789994 +0200
|
||||
+++ b/man/snmpd.examples.5.def 2021-05-26 09:41:29.170761436 +0200
|
||||
@@ -87,8 +87,8 @@ the same authentication and encryption s
|
||||
.RS
|
||||
.nf
|
||||
createUser me MD5 "single pass phrase"
|
||||
-createUser myself MD5 "single pass phrase" DES
|
||||
-createUser andI MD5 "single pass phrase" DES "single pass phrase"
|
||||
+createUser myself MD5 "single pass phrase" AES
|
||||
+createUser andI MD5 "single pass phrase" AES "single pass phrase"
|
||||
.fi
|
||||
.RE
|
||||
Note that this defines three \fIdistinct\fR users, who could be granted
|
||||
diff -urNp a/man/snmptrapd.conf.5.def b/man/snmptrapd.conf.5.def
|
||||
--- a/man/snmptrapd.conf.5.def 2021-05-26 09:30:07.428789985 +0200
|
||||
+++ b/man/snmptrapd.conf.5.def 2021-05-26 09:42:02.963064029 +0200
|
||||
@@ -117,7 +117,7 @@ to trigger the types of processing liste
|
||||
See
|
||||
.IR snmpd.conf (5)
|
||||
for more details.
|
||||
-.IP "createUser [-e ENGINEID] username (MD5|SHA|SHA-512|SHA-384|SHA-256|SHA-224) authpassphrase [DES|AES]"
|
||||
+.IP "createUser [-e ENGINEID] username (MD5|SHA|SHA-512|SHA-384|SHA-256|SHA-224) authpassphrase [AES]"
|
||||
See the
|
||||
.IR snmpd.conf (5)
|
||||
manual page for a description of how to create SNMPv3 users. This
|
||||
diff -urNp a/man/snmpusm.1.def b/man/snmpusm.1.def
|
||||
--- a/man/snmpusm.1.def 2021-05-26 09:30:07.430790003 +0200
|
||||
+++ b/man/snmpusm.1.def 2021-05-26 09:42:24.178253990 +0200
|
||||
@@ -216,7 +216,7 @@ rwuser initial
|
||||
# lets add the new user we'll create too:
|
||||
rwuser wes
|
||||
# USM configuration entries
|
||||
-createUser initial MD5 setup_passphrase DES
|
||||
+createUser initial MD5 setup_passphrase AES
|
||||
.fi
|
||||
.RE
|
||||
.PP
|
||||
diff -urNp a/net-snmp-create-v3-user.in b/net-snmp-create-v3-user.in
|
||||
--- a/net-snmp-create-v3-user.in 2021-05-26 09:30:07.369789468 +0200
|
||||
+++ b/net-snmp-create-v3-user.in 2021-05-26 09:33:23.966511123 +0200
|
||||
@@ -10,7 +10,7 @@ if @PSCMD@ | egrep ' snmpd *$' > /dev/nu
|
||||
fi
|
||||
|
||||
Aalgorithm="MD5"
|
||||
-Xalgorithm="DES"
|
||||
+Xalgorithm="AES"
|
||||
token=rwuser
|
||||
|
||||
while test "x$done" = "x" -a "x$1" != "x" -a "x$usage" != "xyes"; do
|
||||
@@ -57,11 +57,11 @@ case $1 in
|
||||
exit 1
|
||||
fi
|
||||
case $1 in
|
||||
- DES|AES|AES128|AES192|AES256)
|
||||
+ AES|AES128|AES192|AES256)
|
||||
Xalgorithm=$1
|
||||
shift
|
||||
;;
|
||||
- des|aes|aes128|aes192|aes256)
|
||||
+ aes|aes128|aes192|aes256)
|
||||
Xalgorithm=$(echo "$1" | tr a-z A-Z)
|
||||
shift
|
||||
;;
|
||||
@@ -90,7 +90,7 @@ if test "x$usage" = "xyes"; then
|
||||
echo ""
|
||||
echo "Usage:"
|
||||
echo " net-snmp-create-v3-user [-ro] [-A authpass] [-X privpass]"
|
||||
- echo " [-a MD5|SHA|SHA-512|SHA-384|SHA-256|SHA-224] [-x DES|AES] [username]"
|
||||
+ echo " [-a MD5|SHA|SHA-512|SHA-384|SHA-256|SHA-224] [-x AES] [username]"
|
||||
echo ""
|
||||
exit
|
||||
fi
|
||||
diff -urNp a/README.snmpv3 b/README.snmpv3
|
||||
--- a/README.snmpv3 2021-05-26 09:30:07.352789320 +0200
|
||||
+++ b/README.snmpv3 2021-05-26 09:44:49.109551728 +0200
|
||||
@@ -4,7 +4,7 @@ How to setup SNMPv3, a very brief docume
|
||||
do a better job on since I suck at writing documentation and he
|
||||
doesn't ;-) --Wes:
|
||||
|
||||
-Note: SHA authentication and DES/AES encryption support is only available
|
||||
+Note: SHA authentication and AES encryption support is only available
|
||||
if you have OpenSSL installed or if you've compiled using
|
||||
--with-openssl=internal. If you use --with-openssl=internal please
|
||||
read the documentation in snmplib/openssl/README for important details.
|
||||
@@ -27,7 +27,7 @@ CREATING THE FIRST USER:
|
||||
WARNING: SNMPv3 pass phrases must be at least 8 characters long!
|
||||
|
||||
The above line creates the user "myuser" with a password of
|
||||
- "my_password" (and uses MD5 and DES for protection). (Note that
|
||||
+ "my_password" (and uses MD5 and AES for protection). (Note that
|
||||
encryption support isn't enabled in the binary releases downloadable
|
||||
from the net-snmp web site.) net-snmp-config will also add a line
|
||||
to your snmpd.conf file to let that user have read/write access to
|
||||
@@ -44,7 +44,7 @@ CREATING THE FIRST USER:
|
||||
[ this should return information about how long your agent has been up]
|
||||
|
||||
snmpget -v 3 -u myuser -l authPriv -a MD5 -A my_password
|
||||
- -x DES -X my_password localhost sysUpTime.0
|
||||
+ -x AES -X my_password localhost sysUpTime.0
|
||||
[ this should return similar information, but encrypts the transmission ]
|
||||
|
||||
CREATING A SECOND USER:
|
@ -0,0 +1,43 @@
|
||||
diff -urNp a/local/checkbandwidth b/local/checkbandwidth
|
||||
--- a/local/checkbandwidth 2024-06-21 21:17:01.675417287 +0200
|
||||
+++ b/local/checkbandwidth 2024-06-21 21:19:40.107746544 +0200
|
||||
@@ -326,7 +326,6 @@ See the Net-SNMP COPYING file for licens
|
||||
|
||||
use JSON;
|
||||
use Data::Dumper;
|
||||
-use Mail::Sender;
|
||||
use SNMP;
|
||||
use Fcntl ':flock';
|
||||
|
||||
@@ -744,19 +743,19 @@ sub send_rate_message($$$$$$) {
|
||||
sub send_message($$$) {
|
||||
my ($to, $subject, $text) = @_;
|
||||
|
||||
- my $sender = new Mail::Sender { smtp => $opts{'S'} ,
|
||||
- port => $opts{'P'},
|
||||
- from => $opts{'F'},
|
||||
- };
|
||||
-
|
||||
- my $status =
|
||||
- $sender->MailMsg({
|
||||
- to => $to,
|
||||
- subject => $subject,
|
||||
- msg => $text
|
||||
- });
|
||||
+# my $sender = new Mail::Sender { smtp => $opts{'S'} ,
|
||||
+# port => $opts{'P'},
|
||||
+# from => $opts{'F'},
|
||||
+# };
|
||||
+
|
||||
+ my $status = -1;
|
||||
+# $sender->MailMsg({
|
||||
+# to => $to,
|
||||
+# subject => $subject,
|
||||
+# msg => $text
|
||||
+# });
|
||||
if ($status < 0) {
|
||||
- Log("Failed to send mail with error code $status: $Mail::Sender::Error");
|
||||
+ Log("Failed to send mail with error code $status: Mail::Sender is not available");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,29 @@
|
||||
diff -ruNp a/testing/fulltests/support/simple_eval_tools.sh b/testing/fulltests/support/simple_eval_tools.sh
|
||||
--- a/testing/fulltests/support/simple_eval_tools.sh 2024-02-26 14:36:03.641432345 +0100
|
||||
+++ b/testing/fulltests/support/simple_eval_tools.sh 2024-02-26 14:38:15.946855878 +0100
|
||||
@@ -525,7 +525,6 @@ STARTPROG() {
|
||||
if test -f $CFG_FILE; then
|
||||
COMMAND="$COMMAND -C -c $CFG_FILE"
|
||||
fi
|
||||
- COMMAND="$COMMAND -f"
|
||||
if [ "x$PORT_SPEC" != "x" ]; then
|
||||
COMMAND="$COMMAND $PORT_SPEC"
|
||||
fi
|
||||
@@ -537,10 +536,13 @@ STARTPROG() {
|
||||
OUTPUTENVVARS $LOG_FILE.command
|
||||
echo $COMMAND >> $LOG_FILE.command
|
||||
fi
|
||||
- {
|
||||
- { $COMMAND; } >$LOG_FILE.stdout 2>&1
|
||||
- echo $? >$LOG_FILE.exitcode
|
||||
- } &
|
||||
+ if [ "x$OSTYPE" = "xmsys" ]; then
|
||||
+ $COMMAND > $LOG_FILE.stdout 2>&1 &
|
||||
+ ## COMMAND="cmd.exe //c start //min $COMMAND"
|
||||
+ ## start $COMMAND > $LOG_FILE.stdout 2>&1
|
||||
+ else
|
||||
+ $COMMAND > $LOG_FILE.stdout 2>&1
|
||||
+ fi
|
||||
}
|
||||
|
||||
#------------------------------------ -o-
|
@ -0,0 +1,59 @@
|
||||
Libs.private should contain a list of libraries the library that the package
|
||||
exposes is linked too. So let's filter out unrelated link flags.
|
||||
|
||||
diff --git net-snmp-5.9.1/netsnmp.pc.in~ net-snmp-5.9.1/netsnmp.pc.in
|
||||
index 0a1f5785a4..524ca91d82 100644
|
||||
--- net-snmp-5.9.1/netsnmp.pc.in~
|
||||
+++ net-snmp-5.9.1/netsnmp.pc.in
|
||||
@@ -9,4 +9,4 @@ URL: http://www.net-snmp.org
|
||||
Version: @PACKAGE_VERSION@
|
||||
Cflags: -I${includedir}
|
||||
Libs: -L${libdir} -lnetsnmp
|
||||
-Libs.private: @LDFLAGS@ @LNETSNMPLIBS@ @LIBS@ @PERLLDOPTS_FOR_APPS@
|
||||
+Libs.private: @LNETSNMPLIBS@ @LIBS@
|
||||
diff --git net-snmp-5.9.1/netsnmp-agent.pc.in~ net-snmp-5.9.1/netsnmp-agent.pc.in
|
||||
index 3a1c77bbf8..3d3b308d21 100644
|
||||
--- net-snmp-5.9.1/netsnmp-agent.pc.in~
|
||||
+++ net-snmp-5.9.1/netsnmp-agent.pc.in
|
||||
@@ -9,4 +9,4 @@ URL: http://www.net-snmp.org
|
||||
Version: @PACKAGE_VERSION@
|
||||
Cflags: -I${includedir}
|
||||
Libs: -L${libdir} -lnetsnmpmibs -lnetsnmpagent -lnetsnmp
|
||||
-Libs.private: @LDFLAGS@ @LMIBLIBS@ @LAGENTLIBS@ @PERLLDOPTS_FOR_APPS@ @LNETSNMPLIBS@ @LIBS@
|
||||
+Libs.private: @LMIBLIBS@ @LAGENTLIBS@ @LNETSNMPLIBS@ @LIBS@
|
||||
diff --git net-snmp-5.9.1/net-snmp-config.in~ net-snmp-5.9.1/net-snmp-config.in
|
||||
index 6b5abf8f83..ee81ce98fa 100644
|
||||
--- net-snmp-5.9.1/net-snmp-config.in~
|
||||
+++ net-snmp-5.9.1/net-snmp-config.in
|
||||
@@ -193,13 +193,13 @@ else
|
||||
#################################################### client lib
|
||||
--libs)
|
||||
# use this one == --netsnmp-libs + --external-libs
|
||||
- echo $NSC_LDFLAGS $NSC_LIBDIR $NSC_SNMPLIBS $NSC_LIBS
|
||||
+ echo $NSC_LIBDIR $NSC_SNMPLIBS $NSC_LIBS
|
||||
;;
|
||||
--netsnmp-libs)
|
||||
echo $NSC_LIBDIR $NSC_BASE_SNMP_LIBS
|
||||
;;
|
||||
--external-libs)
|
||||
- echo $NSC_LDFLAGS $NSC_LNETSNMPLIBS $NSC_LIBS @PERLLDOPTS_FOR_APPS@
|
||||
+ echo $NSC_LNETSNMPLIBS $NSC_LIBS
|
||||
;;
|
||||
#################################################### agent lib
|
||||
--base-agent-libs)
|
||||
@@ -210,13 +210,13 @@ else
|
||||
;;
|
||||
--agent-libs)
|
||||
# use this one == --netsnmp-agent-libs + --external-libs
|
||||
- echo $NSC_LDFLAGS $NSC_LIBDIR $NSC_AGENTLIBS $NSC_LIBS
|
||||
+ echo $NSC_LIBDIR $NSC_AGENTLIBS $NSC_LIBS
|
||||
;;
|
||||
--netsnmp-agent-libs)
|
||||
echo $NSC_LIBDIR $NSC_BASE_AGENT_LIBS
|
||||
;;
|
||||
--external-agent-libs)
|
||||
- echo $NSC_LDFLAGS $NSC_LMIBLIBS $NSC_LAGENTLIBS $NSC_LNETSNMPLIBS $NSC_LIBS
|
||||
+ echo $NSC_LMIBLIBS $NSC_LAGENTLIBS $NSC_LNETSNMPLIBS $NSC_LIBS
|
||||
;;
|
||||
####################################################
|
||||
--version|--ver*)
|
Loading…
Reference in new issue