Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
e8349ae7ac | ||
|
a299db445d |
5
.gitignore
vendored
5
.gitignore
vendored
@ -5,8 +5,3 @@ net-snmp-5.5.tar.gz
|
|||||||
/net-snmp-5.7.1.tar.gz
|
/net-snmp-5.7.1.tar.gz
|
||||||
/net-snmp-5.7.2.tar.gz
|
/net-snmp-5.7.2.tar.gz
|
||||||
/net-snmp-5.7.3.tar.gz
|
/net-snmp-5.7.3.tar.gz
|
||||||
/net-snmp-5.8.tar.gz
|
|
||||||
/net-snmp-5.9.tar.gz
|
|
||||||
/net-snmp-5.9.1.tar.gz
|
|
||||||
/net-snmp-5.9.3.tar.gz
|
|
||||||
/net-snmp-5.9.4.tar.gz
|
|
||||||
|
270
net-snmp-5.5-agentx-disconnect-crash.patch
Normal file
270
net-snmp-5.5-agentx-disconnect-crash.patch
Normal file
@ -0,0 +1,270 @@
|
|||||||
|
955511 - net-snmpd crash on time out
|
||||||
|
969061 - net-snmpd crash on time out
|
||||||
|
1038011 - net-snmp: snmpd crashes/hangs when AgentX subagent times-out
|
||||||
|
|
||||||
|
Based on usptream commit 793d596838ff7cb48a73b675d62897c56c9e62df,
|
||||||
|
heavily backported to net-snmp-5.5
|
||||||
|
|
||||||
|
diff -up net-snmp-5.7.2/agent/mibgroup/agentx/master_admin.c.disconnect-crash net-snmp-5.7.2/agent/mibgroup/agentx/master_admin.c
|
||||||
|
--- net-snmp-5.7.2/agent/mibgroup/agentx/master_admin.c.disconnect-crash 2013-07-03 15:26:35.884813210 +0200
|
||||||
|
+++ net-snmp-5.7.2/agent/mibgroup/agentx/master_admin.c 2013-07-03 15:26:35.908813135 +0200
|
||||||
|
@@ -158,6 +158,7 @@ close_agentx_session(netsnmp_session * s
|
||||||
|
for (sp = session->subsession; sp != NULL; sp = sp->next) {
|
||||||
|
|
||||||
|
if (sp->sessid == sessid) {
|
||||||
|
+ netsnmp_remove_delegated_requests_for_session(sp);
|
||||||
|
unregister_mibs_by_session(sp);
|
||||||
|
unregister_index_by_session(sp);
|
||||||
|
unregister_sysORTable_by_session(sp);
|
||||||
|
diff -up net-snmp-5.7.2/agent/mibgroup/agentx/master.c.disconnect-crash net-snmp-5.7.2/agent/mibgroup/agentx/master.c
|
||||||
|
--- net-snmp-5.7.2/agent/mibgroup/agentx/master.c.disconnect-crash 2013-07-03 15:26:35.000000000 +0200
|
||||||
|
+++ net-snmp-5.7.2/agent/mibgroup/agentx/master.c 2013-07-03 15:29:00.644362208 +0200
|
||||||
|
@@ -222,7 +222,7 @@ agentx_got_response(int operation,
|
||||||
|
/* response is too late, free the cache */
|
||||||
|
if (magic)
|
||||||
|
netsnmp_free_delegated_cache((netsnmp_delegated_cache*) magic);
|
||||||
|
- return 0;
|
||||||
|
+ return 1;
|
||||||
|
}
|
||||||
|
requests = cache->requests;
|
||||||
|
|
||||||
|
diff -up net-snmp-5.7.2/agent/snmp_agent.c.disconnect-crash net-snmp-5.7.2/agent/snmp_agent.c
|
||||||
|
--- net-snmp-5.7.2/agent/snmp_agent.c.disconnect-crash 2013-07-03 15:26:35.893813182 +0200
|
||||||
|
+++ net-snmp-5.7.2/agent/snmp_agent.c 2013-07-03 15:28:28.979460861 +0200
|
||||||
|
@@ -1446,6 +1446,7 @@ free_agent_snmp_session(netsnmp_agent_se
|
||||||
|
netsnmp_free_cachemap(asp->cache_store);
|
||||||
|
asp->cache_store = NULL;
|
||||||
|
}
|
||||||
|
+ agent_snmp_session_release_cancelled(asp);
|
||||||
|
SNMP_FREE(asp);
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -1457,6 +1458,11 @@ netsnmp_check_for_delegated(netsnmp_agen
|
||||||
|
|
||||||
|
if (NULL == asp->treecache)
|
||||||
|
return 0;
|
||||||
|
+
|
||||||
|
+ if (agent_snmp_session_is_cancelled(asp)) {
|
||||||
|
+ printf("request %p cancelled\n", asp);
|
||||||
|
+ return 0;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
for (i = 0; i <= asp->treecache_num; i++) {
|
||||||
|
for (request = asp->treecache[i].requests_begin; request;
|
||||||
|
@@ -1535,39 +1541,48 @@ int
|
||||||
|
netsnmp_remove_delegated_requests_for_session(netsnmp_session *sess)
|
||||||
|
{
|
||||||
|
netsnmp_agent_session *asp;
|
||||||
|
- int count = 0;
|
||||||
|
+ int total_count = 0;
|
||||||
|
|
||||||
|
for (asp = agent_delegated_list; asp; asp = asp->next) {
|
||||||
|
/*
|
||||||
|
* check each request
|
||||||
|
*/
|
||||||
|
+ int i;
|
||||||
|
+ int count = 0;
|
||||||
|
netsnmp_request_info *request;
|
||||||
|
- for(request = asp->requests; request; request = request->next) {
|
||||||
|
- /*
|
||||||
|
- * check session
|
||||||
|
- */
|
||||||
|
- netsnmp_assert(NULL!=request->subtree);
|
||||||
|
- if(request->subtree->session != sess)
|
||||||
|
- continue;
|
||||||
|
+ for (i = 0; i <= asp->treecache_num; i++) {
|
||||||
|
+ for (request = asp->treecache[i].requests_begin; request;
|
||||||
|
+ request = request->next) {
|
||||||
|
+ /*
|
||||||
|
+ * check session
|
||||||
|
+ */
|
||||||
|
+ netsnmp_assert(NULL!=request->subtree);
|
||||||
|
+ if(request->subtree->session != sess)
|
||||||
|
+ continue;
|
||||||
|
|
||||||
|
- /*
|
||||||
|
- * matched! mark request as done
|
||||||
|
- */
|
||||||
|
- netsnmp_request_set_error(request, SNMP_ERR_GENERR);
|
||||||
|
- ++count;
|
||||||
|
+ /*
|
||||||
|
+ * matched! mark request as done
|
||||||
|
+ */
|
||||||
|
+ netsnmp_request_set_error(request, SNMP_ERR_GENERR);
|
||||||
|
+ ++count;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ if (count) {
|
||||||
|
+ agent_snmp_session_mark_cancelled(asp);
|
||||||
|
+ total_count += count;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* if we found any, that request may be finished now
|
||||||
|
*/
|
||||||
|
- if(count) {
|
||||||
|
+ if(total_count) {
|
||||||
|
DEBUGMSGTL(("snmp_agent", "removed %d delegated request(s) for session "
|
||||||
|
- "%8p\n", count, sess));
|
||||||
|
- netsnmp_check_outstanding_agent_requests();
|
||||||
|
+ "%8p\n", total_count, sess));
|
||||||
|
+ netsnmp_check_delegated_requests();
|
||||||
|
}
|
||||||
|
|
||||||
|
- return count;
|
||||||
|
+ return total_count;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
@@ -2739,19 +2754,11 @@ handle_var_requests(netsnmp_agent_sessio
|
||||||
|
return final_status;
|
||||||
|
}
|
||||||
|
|
||||||
|
-/*
|
||||||
|
- * loop through our sessions known delegated sessions and check to see
|
||||||
|
- * if they've completed yet. If there are no more delegated sessions,
|
||||||
|
- * check for and process any queued requests
|
||||||
|
- */
|
||||||
|
void
|
||||||
|
-netsnmp_check_outstanding_agent_requests(void)
|
||||||
|
+netsnmp_check_delegated_requests(void)
|
||||||
|
{
|
||||||
|
netsnmp_agent_session *asp, *prev_asp = NULL, *next_asp = NULL;
|
||||||
|
|
||||||
|
- /*
|
||||||
|
- * deal with delegated requests
|
||||||
|
- */
|
||||||
|
for (asp = agent_delegated_list; asp; asp = next_asp) {
|
||||||
|
next_asp = asp->next; /* save in case we clean up asp */
|
||||||
|
if (!netsnmp_check_for_delegated(asp)) {
|
||||||
|
@@ -2790,6 +2797,22 @@ netsnmp_check_outstanding_agent_requests
|
||||||
|
prev_asp = asp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+/*
|
||||||
|
+ * loop through our sessions known delegated sessions and check to see
|
||||||
|
+ * if they've completed yet. If there are no more delegated sessions,
|
||||||
|
+ * check for and process any queued requests
|
||||||
|
+ */
|
||||||
|
+void
|
||||||
|
+netsnmp_check_outstanding_agent_requests(void)
|
||||||
|
+{
|
||||||
|
+ netsnmp_agent_session *asp;
|
||||||
|
+
|
||||||
|
+ /*
|
||||||
|
+ * deal with delegated requests
|
||||||
|
+ */
|
||||||
|
+ netsnmp_check_delegated_requests();
|
||||||
|
|
||||||
|
/*
|
||||||
|
* if we are processing a set and there are more delegated
|
||||||
|
@@ -2819,7 +2842,8 @@ netsnmp_check_outstanding_agent_requests
|
||||||
|
|
||||||
|
netsnmp_processing_set = netsnmp_agent_queued_list;
|
||||||
|
DEBUGMSGTL(("snmp_agent", "SET request remains queued while "
|
||||||
|
- "delegated requests finish, asp = %8p\n", asp));
|
||||||
|
+ "delegated requests finish, asp = %8p\n",
|
||||||
|
+ agent_delegated_list));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#endif /* NETSNMP_NO_WRITE_SUPPORT */
|
||||||
|
@@ -2880,6 +2904,11 @@ check_delayed_request(netsnmp_agent_sess
|
||||||
|
case SNMP_MSG_GETBULK:
|
||||||
|
case SNMP_MSG_GETNEXT:
|
||||||
|
netsnmp_check_all_requests_status(asp, 0);
|
||||||
|
+ if (agent_snmp_session_is_cancelled(asp)) {
|
||||||
|
+ printf("request %p is cancelled\n", asp);
|
||||||
|
+ DEBUGMSGTL(("snmp_agent","canceling next walk for asp %p\n", asp));
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
handle_getnext_loop(asp);
|
||||||
|
if (netsnmp_check_for_delegated(asp) &&
|
||||||
|
netsnmp_check_transaction_id(asp->pdu->transid) !=
|
||||||
|
@@ -3838,4 +3867,73 @@ netsnmp_set_all_requests_error(netsnmp_a
|
||||||
|
return error_value;
|
||||||
|
}
|
||||||
|
#endif /* NETSNMP_FEATURE_REMOVE_SET_ALL_REQUESTS_ERROR */
|
||||||
|
+
|
||||||
|
+/*
|
||||||
|
+ * Ugly hack to fix bug #950602 and preserve ABI
|
||||||
|
+ * (the official patch adds netsnmp_agent_session->flags).
|
||||||
|
+ * We must create parallel database of netsnmp_agent_sessions
|
||||||
|
+ * and put cancelled requests there instead of marking
|
||||||
|
+ * netsnmp_agent_session->flags.
|
||||||
|
+ */
|
||||||
|
+static netsnmp_agent_session **cancelled_agent_snmp_sessions;
|
||||||
|
+static int cancelled_agent_snmp_sessions_count;
|
||||||
|
+static int cancelled_agent_snmp_sessions_max;
|
||||||
|
+
|
||||||
|
+int
|
||||||
|
+agent_snmp_session_mark_cancelled(netsnmp_agent_session *session)
|
||||||
|
+{
|
||||||
|
+ DEBUGMSGTL(("agent:cancelled", "Cancelling session %p\n", session));
|
||||||
|
+ if (!session)
|
||||||
|
+ return 0;
|
||||||
|
+ if (cancelled_agent_snmp_sessions_count + 1 > cancelled_agent_snmp_sessions_max) {
|
||||||
|
+ netsnmp_agent_session **aux;
|
||||||
|
+ int max = cancelled_agent_snmp_sessions_max + 10;
|
||||||
|
+ aux = realloc(cancelled_agent_snmp_sessions, sizeof(netsnmp_agent_session*) * max);
|
||||||
|
+ if (!aux)
|
||||||
|
+ return SNMP_ERR_GENERR;
|
||||||
|
+ cancelled_agent_snmp_sessions = aux;
|
||||||
|
+ cancelled_agent_snmp_sessions_max = max;
|
||||||
|
+ }
|
||||||
|
+ cancelled_agent_snmp_sessions[cancelled_agent_snmp_sessions_count] = session;
|
||||||
|
+ cancelled_agent_snmp_sessions_count++;
|
||||||
|
+ return 0;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+int
|
||||||
|
+agent_snmp_session_is_cancelled(netsnmp_agent_session *session)
|
||||||
|
+{
|
||||||
|
+ int i;
|
||||||
|
+ for (i=0; i<cancelled_agent_snmp_sessions_count; i++)
|
||||||
|
+ if (cancelled_agent_snmp_sessions[i] == session) {
|
||||||
|
+ DEBUGMSGTL(("agent:cancelled", "session %p is cancelled\n", session));
|
||||||
|
+ return TRUE;
|
||||||
|
+ }
|
||||||
|
+ return FALSE;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+int
|
||||||
|
+agent_snmp_session_release_cancelled(netsnmp_agent_session *session)
|
||||||
|
+{
|
||||||
|
+ int i, j;
|
||||||
|
+
|
||||||
|
+ if (!session)
|
||||||
|
+ return 0;
|
||||||
|
+
|
||||||
|
+ DEBUGMSGTL(("agent:cancelled", "Removing session %p\n", session));
|
||||||
|
+
|
||||||
|
+ /* delete the session from cancelled_agent_snmp_sessions */
|
||||||
|
+ for (i=0, j=0; j<cancelled_agent_snmp_sessions_count; i++, j++)
|
||||||
|
+ if (cancelled_agent_snmp_sessions[j] == session)
|
||||||
|
+ i--; /* don't increase i in this loop iteration */
|
||||||
|
+ else
|
||||||
|
+ cancelled_agent_snmp_sessions[i] = cancelled_agent_snmp_sessions[j];
|
||||||
|
+
|
||||||
|
+ cancelled_agent_snmp_sessions_count = i;
|
||||||
|
+
|
||||||
|
+ for (; i< cancelled_agent_snmp_sessions_max; i++)
|
||||||
|
+ cancelled_agent_snmp_sessions[i] = NULL;
|
||||||
|
+ return 0;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
/** @} */
|
||||||
|
+
|
||||||
|
diff -up net-snmp-5.7.2/include/net-snmp/agent/snmp_agent.h.disconnect-crash net-snmp-5.7.2/include/net-snmp/agent/snmp_agent.h
|
||||||
|
--- net-snmp-5.7.2/include/net-snmp/agent/snmp_agent.h.disconnect-crash 2012-10-10 00:28:58.000000000 +0200
|
||||||
|
+++ net-snmp-5.7.2/include/net-snmp/agent/snmp_agent.h 2013-07-03 15:26:35.909813132 +0200
|
||||||
|
@@ -240,6 +240,7 @@ extern "C" {
|
||||||
|
int init_master_agent(void);
|
||||||
|
void shutdown_master_agent(void);
|
||||||
|
int agent_check_and_process(int block);
|
||||||
|
+ void netsnmp_check_delegated_requests(void);
|
||||||
|
void netsnmp_check_outstanding_agent_requests(void);
|
||||||
|
|
||||||
|
int netsnmp_request_set_error(netsnmp_request_info *request,
|
354
net-snmp-5.5-apsl-copying.patch
Normal file
354
net-snmp-5.5-apsl-copying.patch
Normal file
@ -0,0 +1,354 @@
|
|||||||
|
Add APSL 2.0 license to the COPYING file.
|
||||||
|
|
||||||
|
There is only one file covered by this license:
|
||||||
|
net-snmp-5.5/agent/mibgroup/host/data_access/swrun_darwin.c
|
||||||
|
|
||||||
|
This file is not used on Linux at all, it's only present in source
|
||||||
|
tarball and net-snmp.src.rpm.
|
||||||
|
|
||||||
|
In addition, it's licensed under APSL 1.1, but it allows to relicense
|
||||||
|
the code to 'any subsequent version of this License published by Apple'.
|
||||||
|
According to http://fedoraproject.org/wiki/Licensing, APSL ver. 2.0 is
|
||||||
|
better for us.
|
||||||
|
|
||||||
|
diff -up net-snmp-5.7.3/COPYING.skiFvk net-snmp-5.7.3/COPYING
|
||||||
|
--- net-snmp-5.7.3/COPYING.skiFvk 2015-02-17 13:33:15.963257594 +0100
|
||||||
|
+++ net-snmp-5.7.3/COPYING 2015-02-17 13:33:37.931241818 +0100
|
||||||
|
@@ -325,3 +325,337 @@ PROFITS; OR BUSINESS INTERRUPTION) HOWEV
|
||||||
|
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||||
|
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
+
|
||||||
|
+---- Part 11: APPLE PUBLIC SOURCE LICENSE (APSL 2.0) ----
|
||||||
|
+
|
||||||
|
+Version 2.0 - August 6, 2003
|
||||||
|
+
|
||||||
|
+Please read this License carefully before downloading this software. By
|
||||||
|
+downloading or using this software, you are agreeing to be bound by the terms
|
||||||
|
+of this License. If you do not or cannot agree to the terms of this License,
|
||||||
|
+please do not download or use the software.
|
||||||
|
+
|
||||||
|
+Apple Note: In January 2007, Apple changed its corporate name from "Apple
|
||||||
|
+Computer, Inc." to "Apple Inc." This change has been reflected below and
|
||||||
|
+copyright years updated, but no other changes have been made to the APSL 2.0.
|
||||||
|
+
|
||||||
|
+1. General; Definitions. This License applies to any program or other
|
||||||
|
+work which Apple Inc. ("Apple") makes publicly available and which contains a
|
||||||
|
+notice placed by Apple identifying such program or work as "Original Code" and
|
||||||
|
+stating that it is subject to the terms of this Apple Public Source License
|
||||||
|
+version 2.0 ("License"). As used in this License:
|
||||||
|
+
|
||||||
|
+1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the
|
||||||
|
+grantor of rights, (i) claims of patents that are now or hereafter acquired,
|
||||||
|
+owned by or assigned to Apple and (ii) that cover subject matter contained in
|
||||||
|
+the Original Code, but only to the extent necessary to use, reproduce and/or
|
||||||
|
+distribute the Original Code without infringement; and (b) in the case where
|
||||||
|
+You are the grantor of rights, (i) claims of patents that are now or hereafter
|
||||||
|
+acquired, owned by or assigned to You and (ii) that cover subject matter in
|
||||||
|
+Your Modifications, taken alone or in combination with Original Code.
|
||||||
|
+
|
||||||
|
+1.2 "Contributor" means any person or entity that creates or contributes to
|
||||||
|
+the creation of Modifications.
|
||||||
|
+
|
||||||
|
+1.3 "Covered Code" means the Original Code, Modifications, the combination
|
||||||
|
+of Original Code and any Modifications, and/or any respective portions thereof.
|
||||||
|
+
|
||||||
|
+1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise
|
||||||
|
+make Covered Code available, directly or indirectly, to anyone other than You;
|
||||||
|
+and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way
|
||||||
|
+to provide a service, including but not limited to delivery of content, through
|
||||||
|
+electronic communication with a client other than You.
|
||||||
|
+
|
||||||
|
+1.5 "Larger Work" means a work which combines Covered Code or portions
|
||||||
|
+thereof with code not governed by the terms of this License.
|
||||||
|
+
|
||||||
|
+1.6 "Modifications" mean any addition to, deletion from, and/or change to,
|
||||||
|
+the substance and/or structure of the Original Code, any previous
|
||||||
|
+Modifications, the combination of Original Code and any previous Modifications,
|
||||||
|
+and/or any respective portions thereof. When code is released as a series of
|
||||||
|
+files, a Modification is: (a) any addition to or deletion from the contents of
|
||||||
|
+a file containing Covered Code; and/or (b) any new file or other representation
|
||||||
|
+of computer program statements that contains any part of Covered Code.
|
||||||
|
+
|
||||||
|
+1.7 "Original Code" means (a) the Source Code of a program or other work as
|
||||||
|
+originally made available by Apple under this License, including the Source
|
||||||
|
+Code of any updates or upgrades to such programs or works made available by
|
||||||
|
+Apple under this License, and that has been expressly identified by Apple as
|
||||||
|
+such in the header file(s) of such work; and (b) the object code compiled from
|
||||||
|
+such Source Code and originally made available by Apple under this License
|
||||||
|
+
|
||||||
|
+1.8 "Source Code" means the human readable form of a program or other work
|
||||||
|
+that is suitable for making modifications to it, including all modules it
|
||||||
|
+contains, plus any associated interface definition files, scripts used to
|
||||||
|
+control compilation and installation of an executable (object code).
|
||||||
|
+
|
||||||
|
+1.9 "You" or "Your" means an individual or a legal entity exercising rights
|
||||||
|
+under this License. For legal entities, "You" or "Your" includes any entity
|
||||||
|
+which controls, is controlled by, or is under common control with, You, where
|
||||||
|
+"control" means (a) the power, direct or indirect, to cause the direction or
|
||||||
|
+management of such entity, whether by contract or otherwise, or (b) ownership
|
||||||
|
+of fifty percent (50%) or more of the outstanding shares or beneficial
|
||||||
|
+ownership of such entity.
|
||||||
|
+
|
||||||
|
+2. Permitted Uses; Conditions & Restrictions. Subject to the terms and
|
||||||
|
+conditions of this License, Apple hereby grants You, effective on the date You
|
||||||
|
+accept this License and download the Original Code, a world-wide, royalty-free,
|
||||||
|
+non-exclusive license, to the extent of Apple's Applicable Patent Rights and
|
||||||
|
+copyrights covering the Original Code, to do the following:
|
||||||
|
+
|
||||||
|
+2.1 Unmodified Code. You may use, reproduce, display, perform, internally
|
||||||
|
+distribute within Your organization, and Externally Deploy verbatim, unmodified
|
||||||
|
+copies of the Original Code, for commercial or non-commercial purposes,
|
||||||
|
+provided that in each instance:
|
||||||
|
+
|
||||||
|
+(a) You must retain and reproduce in all copies of Original Code the
|
||||||
|
+copyright and other proprietary notices and disclaimers of Apple as they appear
|
||||||
|
+in the Original Code, and keep intact all notices in the Original Code that
|
||||||
|
+refer to this License; and
|
||||||
|
+
|
||||||
|
+(b) You must include a copy of this License with every copy of Source Code
|
||||||
|
+of Covered Code and documentation You distribute or Externally Deploy, and You
|
||||||
|
+may not offer or impose any terms on such Source Code that alter or restrict
|
||||||
|
+this License or the recipients' rights hereunder, except as permitted under
|
||||||
|
+Section 6.
|
||||||
|
+
|
||||||
|
+2.2 Modified Code. You may modify Covered Code and use, reproduce,
|
||||||
|
+display, perform, internally distribute within Your organization, and
|
||||||
|
+Externally Deploy Your Modifications and Covered Code, for commercial or
|
||||||
|
+non-commercial purposes, provided that in each instance You also meet all of
|
||||||
|
+these conditions:
|
||||||
|
+
|
||||||
|
+(a) You must satisfy all the conditions of Section 2.1 with respect to the
|
||||||
|
+Source Code of the Covered Code;
|
||||||
|
+
|
||||||
|
+(b) You must duplicate, to the extent it does not already exist, the notice
|
||||||
|
+in Exhibit A in each file of the Source Code of all Your Modifications, and
|
||||||
|
+cause the modified files to carry prominent notices stating that You changed
|
||||||
|
+the files and the date of any change; and
|
||||||
|
+
|
||||||
|
+(c) If You Externally Deploy Your Modifications, You must make Source Code
|
||||||
|
+of all Your Externally Deployed Modifications either available to those to whom
|
||||||
|
+You have Externally Deployed Your Modifications, or publicly available. Source
|
||||||
|
+Code of Your Externally Deployed Modifications must be released under the terms
|
||||||
|
+set forth in this License, including the license grants set forth in Section 3
|
||||||
|
+below, for as long as you Externally Deploy the Covered Code or twelve (12)
|
||||||
|
+months from the date of initial External Deployment, whichever is longer. You
|
||||||
|
+should preferably distribute the Source Code of Your Externally Deployed
|
||||||
|
+Modifications electronically (e.g. download from a web site).
|
||||||
|
+
|
||||||
|
+2.3 Distribution of Executable Versions. In addition, if You Externally
|
||||||
|
+Deploy Covered Code (Original Code and/or Modifications) in object code,
|
||||||
|
+executable form only, You must include a prominent notice, in the code itself
|
||||||
|
+as well as in related documentation, stating that Source Code of the Covered
|
||||||
|
+Code is available under the terms of this License with information on how and
|
||||||
|
+where to obtain such Source Code.
|
||||||
|
+
|
||||||
|
+2.4 Third Party Rights. You expressly acknowledge and agree that although
|
||||||
|
+Apple and each Contributor grants the licenses to their respective portions of
|
||||||
|
+the Covered Code set forth herein, no assurances are provided by Apple or any
|
||||||
|
+Contributor that the Covered Code does not infringe the patent or other
|
||||||
|
+intellectual property rights of any other entity. Apple and each Contributor
|
||||||
|
+disclaim any liability to You for claims brought by any other entity based on
|
||||||
|
+infringement of intellectual property rights or otherwise. As a condition to
|
||||||
|
+exercising the rights and licenses granted hereunder, You hereby assume sole
|
||||||
|
+responsibility to secure any other intellectual property rights needed, if any.
|
||||||
|
+For example, if a third party patent license is required to allow You to
|
||||||
|
+distribute the Covered Code, it is Your responsibility to acquire that license
|
||||||
|
+before distributing the Covered Code.
|
||||||
|
+
|
||||||
|
+3. Your Grants. In consideration of, and as a condition to, the licenses
|
||||||
|
+granted to You under this License, You hereby grant to any person or entity
|
||||||
|
+receiving or distributing Covered Code under this License a non-exclusive,
|
||||||
|
+royalty-free, perpetual, irrevocable license, under Your Applicable Patent
|
||||||
|
+Rights and other intellectual property rights (other than patent) owned or
|
||||||
|
+controlled by You, to use, reproduce, display, perform, modify, sublicense,
|
||||||
|
+distribute and Externally Deploy Your Modifications of the same scope and
|
||||||
|
+extent as Apple's licenses under Sections 2.1 and 2.2 above.
|
||||||
|
+
|
||||||
|
+4. Larger Works. You may create a Larger Work by combining Covered Code
|
||||||
|
+with other code not governed by the terms of this License and distribute the
|
||||||
|
+Larger Work as a single product. In each such instance, You must make sure the
|
||||||
|
+requirements of this License are fulfilled for the Covered Code or any portion
|
||||||
|
+thereof.
|
||||||
|
+
|
||||||
|
+5. Limitations on Patent License. Except as expressly stated in Section
|
||||||
|
+2, no other patent rights, express or implied, are granted by Apple herein.
|
||||||
|
+Modifications and/or Larger Works may require additional patent licenses from
|
||||||
|
+Apple which Apple may grant in its sole discretion.
|
||||||
|
+
|
||||||
|
+6. Additional Terms. You may choose to offer, and to charge a fee for,
|
||||||
|
+warranty, support, indemnity or liability obligations and/or other rights
|
||||||
|
+consistent with the scope of the license granted herein ("Additional Terms") to
|
||||||
|
+one or more recipients of Covered Code. However, You may do so only on Your own
|
||||||
|
+behalf and as Your sole responsibility, and not on behalf of Apple or any
|
||||||
|
+Contributor. You must obtain the recipient's agreement that any such Additional
|
||||||
|
+Terms are offered by You alone, and You hereby agree to indemnify, defend and
|
||||||
|
+hold Apple and every Contributor harmless for any liability incurred by or
|
||||||
|
+claims asserted against Apple or such Contributor by reason of any such
|
||||||
|
+Additional Terms.
|
||||||
|
+
|
||||||
|
+7. Versions of the License. Apple may publish revised and/or new versions
|
||||||
|
+of this License from time to time. Each version will be given a distinguishing
|
||||||
|
+version number. Once Original Code has been published under a particular
|
||||||
|
+version of this License, You may continue to use it under the terms of that
|
||||||
|
+version. You may also choose to use such Original Code under the terms of any
|
||||||
|
+subsequent version of this License published by Apple. No one other than Apple
|
||||||
|
+has the right to modify the terms applicable to Covered Code created under this
|
||||||
|
+License.
|
||||||
|
+
|
||||||
|
+8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in
|
||||||
|
+part pre-release, untested, or not fully tested works. The Covered Code may
|
||||||
|
+contain errors that could cause failures or loss of data, and may be incomplete
|
||||||
|
+or contain inaccuracies. You expressly acknowledge and agree that use of the
|
||||||
|
+Covered Code, or any portion thereof, is at Your sole and entire risk. THE
|
||||||
|
+COVERED CODE IS PROVIDED "AS IS" AND WITHOUT WARRANTY, UPGRADES OR SUPPORT OF
|
||||||
|
+ANY KIND AND APPLE AND APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE"
|
||||||
|
+FOR THE PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM
|
||||||
|
+ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT NOT
|
||||||
|
+LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF MERCHANTABILITY, OF
|
||||||
|
+SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR PURPOSE, OF ACCURACY, OF
|
||||||
|
+QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. APPLE AND EACH
|
||||||
|
+CONTRIBUTOR DOES NOT WARRANT AGAINST INTERFERENCE WITH YOUR ENJOYMENT OF THE
|
||||||
|
+COVERED CODE, THAT THE FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR
|
||||||
|
+REQUIREMENTS, THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR
|
||||||
|
+ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO ORAL OR
|
||||||
|
+WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE AUTHORIZED
|
||||||
|
+REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY. You acknowledge
|
||||||
|
+that the Covered Code is not intended for use in the operation of nuclear
|
||||||
|
+facilities, aircraft navigation, communication systems, or air traffic control
|
||||||
|
+machines in which case the failure of the Covered Code could lead to death,
|
||||||
|
+personal injury, or severe physical or environmental damage.
|
||||||
|
+
|
||||||
|
+9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO
|
||||||
|
+EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL, SPECIAL,
|
||||||
|
+INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO THIS LICENSE OR
|
||||||
|
+YOUR USE OR INABILITY TO USE THE COVERED CODE, OR ANY PORTION THEREOF, WHETHER
|
||||||
|
+UNDER A THEORY OF CONTRACT, WARRANTY, TORT (INCLUDING NEGLIGENCE), PRODUCTS
|
||||||
|
+LIABILITY OR OTHERWISE, EVEN IF APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF
|
||||||
|
+THE POSSIBILITY OF SUCH DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL
|
||||||
|
+PURPOSE OF ANY REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF
|
||||||
|
+LIABILITY OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT
|
||||||
|
+APPLY TO YOU. In no event shall Apple's total liability to You for all damages
|
||||||
|
+(other than as may be required by applicable law) under this License exceed the
|
||||||
|
+amount of fifty dollars ($50.00).
|
||||||
|
+
|
||||||
|
+10. Trademarks. This License does not grant any rights to use the
|
||||||
|
+trademarks or trade names "Apple", "Mac", "Mac OS", "QuickTime", "QuickTime
|
||||||
|
+Streaming Server" or any other trademarks, service marks, logos or trade names
|
||||||
|
+belonging to Apple (collectively "Apple Marks") or to any trademark, service
|
||||||
|
+mark, logo or trade name belonging to any Contributor. You agree not to use
|
||||||
|
+any Apple Marks in or as part of the name of products derived from the Original
|
||||||
|
+Code or to endorse or promote products derived from the Original Code other
|
||||||
|
+than as expressly permitted by and in strict compliance at all times with
|
||||||
|
+Apple's third party trademark usage guidelines which are posted at
|
||||||
|
+http://www.apple.com/legal/guidelinesfor3rdparties.html.
|
||||||
|
+
|
||||||
|
+11. Ownership. Subject to the licenses granted under this License, each
|
||||||
|
+Contributor retains all rights, title and interest in and to any Modifications
|
||||||
|
+made by such Contributor. Apple retains all rights, title and interest in and
|
||||||
|
+to the Original Code and any Modifications made by or on behalf of Apple
|
||||||
|
+("Apple Modifications"), and such Apple Modifications will not be automatically
|
||||||
|
+subject to this License. Apple may, at its sole discretion, choose to license
|
||||||
|
+such Apple Modifications under this License, or on different terms from those
|
||||||
|
+contained in this License or may choose not to license them at all.
|
||||||
|
+
|
||||||
|
+12. Termination.
|
||||||
|
+
|
||||||
|
+12.1 Termination. This License and the rights granted hereunder will
|
||||||
|
+terminate:
|
||||||
|
+
|
||||||
|
+(a) automatically without notice from Apple if You fail to comply with any
|
||||||
|
+term(s) of this License and fail to cure such breach within 30 days of becoming
|
||||||
|
+aware of such breach; (b) immediately in the event of the circumstances
|
||||||
|
+described in Section 13.5(b); or (c) automatically without notice from Apple
|
||||||
|
+if You, at any time during the term of this License, commence an action for
|
||||||
|
+patent infringement against Apple; provided that Apple did not first commence
|
||||||
|
+an action for patent infringement against You in that instance.
|
||||||
|
+
|
||||||
|
+12.2 Effect of Termination. Upon termination, You agree to immediately stop
|
||||||
|
+any further use, reproduction, modification, sublicensing and distribution of
|
||||||
|
+the Covered Code. All sublicenses to the Covered Code which have been properly
|
||||||
|
+granted prior to termination shall survive any termination of this License.
|
||||||
|
+Provisions which, by their nature, should remain in effect beyond the
|
||||||
|
+termination of this License shall survive, including but not limited to
|
||||||
|
+Sections 3, 5, 8, 9, 10, 11, 12.2 and 13. No party will be liable to any other
|
||||||
|
+for compensation, indemnity or damages of any sort solely as a result of
|
||||||
|
+terminating this License in accordance with its terms, and termination of this
|
||||||
|
+License will be without prejudice to any other right or remedy of any party.
|
||||||
|
+
|
||||||
|
+13. Miscellaneous.
|
||||||
|
+
|
||||||
|
+13.1 Government End Users. The Covered Code is a "commercial item" as
|
||||||
|
+defined in FAR 2.101. Government software and technical data rights in the
|
||||||
|
+Covered Code include only those rights customarily provided to the public as
|
||||||
|
+defined in this License. This customary commercial license in technical data
|
||||||
|
+and software is provided in accordance with FAR 12.211 (Technical Data) and
|
||||||
|
+12.212 (Computer Software) and, for Department of Defense purchases, DFAR
|
||||||
|
+252.227-7015 (Technical Data -- Commercial Items) and 227.7202-3 (Rights in
|
||||||
|
+Commercial Computer Software or Computer Software Documentation). Accordingly,
|
||||||
|
+all U.S. Government End Users acquire Covered Code with only those rights set
|
||||||
|
+forth herein.
|
||||||
|
+
|
||||||
|
+13.2 Relationship of Parties. This License will not be construed as
|
||||||
|
+creating an agency, partnership, joint venture or any other form of legal
|
||||||
|
+association between or among You, Apple or any Contributor, and You will not
|
||||||
|
+represent to the contrary, whether expressly, by implication, appearance or
|
||||||
|
+otherwise.
|
||||||
|
+
|
||||||
|
+13.3 Independent Development. Nothing in this License will impair Apple's
|
||||||
|
+right to acquire, license, develop, have others develop for it, market and/or
|
||||||
|
+distribute technology or products that perform the same or similar functions
|
||||||
|
+as, or otherwise compete with, Modifications, Larger Works, technology or
|
||||||
|
+products that You may develop, produce, market or distribute.
|
||||||
|
+
|
||||||
|
+13.4 Waiver; Construction. Failure by Apple or any Contributor to enforce
|
||||||
|
+any provision of this License will not be deemed a waiver of future enforcement
|
||||||
|
+of that or any other provision. Any law or regulation which provides that the
|
||||||
|
+language of a contract shall be construed against the drafter will not apply to
|
||||||
|
+this License.
|
||||||
|
+
|
||||||
|
+13.5 Severability. (a) If for any reason a court of competent jurisdiction
|
||||||
|
+finds any provision of this License, or portion thereof, to be unenforceable,
|
||||||
|
+that provision of the License will be enforced to the maximum extent
|
||||||
|
+permissible so as to effect the economic benefits and intent of the parties,
|
||||||
|
+and the remainder of this License will continue in full force and effect. (b)
|
||||||
|
+Notwithstanding the foregoing, if applicable law prohibits or restricts You
|
||||||
|
+from fully and/or specifically complying with Sections 2 and/or 3 or prevents
|
||||||
|
+the enforceability of either of those Sections, this License will immediately
|
||||||
|
+terminate and You must immediately discontinue any use of the Covered Code and
|
||||||
|
+destroy all copies of it that are in your possession or control.
|
||||||
|
+
|
||||||
|
+13.6 Dispute Resolution. Any litigation or other dispute resolution between
|
||||||
|
+You and Apple relating to this License shall take place in the Northern
|
||||||
|
+District of California, and You and Apple hereby consent to the personal
|
||||||
|
+jurisdiction of, and venue in, the state and federal courts within that
|
||||||
|
+District with respect to this License. The application of the United Nations
|
||||||
|
+Convention on Contracts for the International Sale of Goods is expressly
|
||||||
|
+excluded.
|
||||||
|
+
|
||||||
|
+13.7 Entire Agreement; Governing Law. This License constitutes the entire
|
||||||
|
+agreement between the parties with respect to the subject matter hereof. This
|
||||||
|
+License shall be governed by the laws of the United States and the State of
|
||||||
|
+California, except that body of California law concerning conflicts of law.
|
||||||
|
+
|
||||||
|
+Where You are located in the province of Quebec, Canada, the following clause
|
||||||
|
+applies: The parties hereby confirm that they have requested that this License
|
||||||
|
+and all related documents be drafted in English. Les parties ont exige que le
|
||||||
|
+present contrat et tous les documents connexes soient rediges en anglais.
|
||||||
|
+
|
||||||
|
+EXHIBIT A.
|
||||||
|
+
|
||||||
|
+"Portions Copyright (c) 1999-2007 Apple Inc. All Rights Reserved.
|
||||||
|
+
|
||||||
|
+This file contains Original Code and/or Modifications of Original Code as
|
||||||
|
+defined in and that are subject to the Apple Public Source License Version 2.0
|
||||||
|
+(the 'License'). You may not use this file except in compliance with the
|
||||||
|
+License. Please obtain a copy of the License at
|
||||||
|
+http://www.opensource.apple.com/apsl/ and read it before using this file.
|
||||||
|
+
|
||||||
|
+The Original Code and all software distributed under the License are
|
||||||
|
+distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS
|
||||||
|
+OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
|
||||||
|
+LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||||
|
+PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. Please see the License for the
|
||||||
|
+specific language governing rights and limitations under the License."
|
14
net-snmp-5.5-dir-fix.patch
Normal file
14
net-snmp-5.5-dir-fix.patch
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
Let net-snmp-create-v3-user save settings into /etc/ instead of /usr/
|
||||||
|
|
||||||
|
diff -up net-snmp-5.5/net-snmp-create-v3-user.in.orig net-snmp-5.5/net-snmp-create-v3-user.in
|
||||||
|
--- net-snmp-5.5/net-snmp-create-v3-user.in.orig 2008-07-22 16:33:25.000000000 +0200
|
||||||
|
+++ net-snmp-5.5/net-snmp-create-v3-user.in 2009-09-29 16:30:36.000000000 +0200
|
||||||
|
@@ -158,7 +158,7 @@ if test ! -d $outfile ; then
|
||||||
|
touch $outfile
|
||||||
|
fi
|
||||||
|
echo $line >> $outfile
|
||||||
|
-outfile="@datadir@/snmp/snmpd.conf"
|
||||||
|
+outfile="/etc/snmp/snmpd.conf"
|
||||||
|
line="$token $user"
|
||||||
|
echo "adding the following line to $outfile:"
|
||||||
|
echo " " $line
|
16
net-snmp-5.5-perl-linking.patch
Normal file
16
net-snmp-5.5-perl-linking.patch
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
554747 - net-snmp-config should not contain perl options
|
||||||
|
|
||||||
|
Remove rpath from net-snmp-config --agent-libs output.
|
||||||
|
|
||||||
|
diff -up net-snmp-5.7/net-snmp-config.in.perl-linking net-snmp-5.7/net-snmp-config.in
|
||||||
|
--- net-snmp-5.7/net-snmp-config.in.perl-linking 2011-07-02 00:35:46.000000000 +0200
|
||||||
|
+++ net-snmp-5.7/net-snmp-config.in 2011-07-07 13:30:01.635798817 +0200
|
||||||
|
@@ -50,7 +50,7 @@ NSC_LDFLAGS="@LDFLAGS@"
|
||||||
|
|
||||||
|
NSC_LIBS="@LIBS@"
|
||||||
|
NSC_LNETSNMPLIBS="@LNETSNMPLIBS@"
|
||||||
|
-NSC_LAGENTLIBS="@LAGENTLIBS@ @PERLLDOPTS_FOR_APPS@"
|
||||||
|
+NSC_LAGENTLIBS="@LAGENTLIBS@"
|
||||||
|
NSC_LMIBLIBS="@LMIBLIBS@"
|
||||||
|
|
||||||
|
NSC_INCLUDEDIR=${includedir}
|
45
net-snmp-5.6-multilib.patch
Normal file
45
net-snmp-5.6-multilib.patch
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
diff -up net-snmp-5.7.3/man/netsnmp_config_api.3.def.oSBcEB net-snmp-5.7.3/man/netsnmp_config_api.3.def
|
||||||
|
--- net-snmp-5.7.3/man/netsnmp_config_api.3.def.oSBcEB 2014-12-08 21:23:22.000000000 +0100
|
||||||
|
+++ net-snmp-5.7.3/man/netsnmp_config_api.3.def 2015-02-17 13:32:38.903284207 +0100
|
||||||
|
@@ -295,7 +295,7 @@ for one particular machine.
|
||||||
|
.PP
|
||||||
|
The default list of directories to search is \fC SYSCONFDIR/snmp\fP,
|
||||||
|
followed by \fC DATADIR/snmp\fP,
|
||||||
|
-followed by \fC LIBDIR/snmp\fP,
|
||||||
|
+followed by \fC /usr/lib(64)/snmp\fP,
|
||||||
|
followed by \fC $HOME/.snmp\fP.
|
||||||
|
This list can be changed by setting the environmental variable
|
||||||
|
.I SNMPCONFPATH
|
||||||
|
@@ -365,7 +365,7 @@ function that it should abort the operat
|
||||||
|
SNMPCONFPATH
|
||||||
|
A colon separated list of directories to search for configuration
|
||||||
|
files in.
|
||||||
|
-Default: SYSCONFDIR/snmp:DATADIR/snmp:LIBDIR/snmp:$HOME/.snmp
|
||||||
|
+Default: SYSCONFDIR/snmp:DATADIR/snmp:/usr/lib(64)/snmp:$HOME/.snmp
|
||||||
|
.SH "SEE ALSO"
|
||||||
|
netsnmp_mib_api(3), snmp_api(3)
|
||||||
|
.\" Local Variables:
|
||||||
|
diff -up net-snmp-5.7.3/man/snmp_config.5.def.oSBcEB net-snmp-5.7.3/man/snmp_config.5.def
|
||||||
|
--- net-snmp-5.7.3/man/snmp_config.5.def.oSBcEB 2015-02-17 13:32:04.251309092 +0100
|
||||||
|
+++ net-snmp-5.7.3/man/snmp_config.5.def 2015-02-17 13:33:09.217262438 +0100
|
||||||
|
@@ -10,7 +10,7 @@ First off, there are numerous places tha
|
||||||
|
found and read from. By default, the applications look for
|
||||||
|
configuration files in the following 4 directories, in order:
|
||||||
|
SYSCONFDIR/snmp,
|
||||||
|
-DATADIR/snmp, LIBDIR/snmp, and $HOME/.snmp. In each of these
|
||||||
|
+DATADIR/snmp, /usr/lib(64)/snmp, and $HOME/.snmp. In each of these
|
||||||
|
directories, it looks for files snmp.conf, snmpd.conf and/or
|
||||||
|
snmptrapd.conf, as well as snmp.local.conf, snmpd.local.conf
|
||||||
|
and/or snmptrapd.local.conf. *.local.conf are always
|
||||||
|
diff -up net-snmp-5.7.3/man/snmpd.conf.5.def.oSBcEB net-snmp-5.7.3/man/snmpd.conf.5.def
|
||||||
|
--- net-snmp-5.7.3/man/snmpd.conf.5.def.oSBcEB 2014-12-08 21:23:22.000000000 +0100
|
||||||
|
+++ net-snmp-5.7.3/man/snmpd.conf.5.def 2015-02-17 13:32:04.251309092 +0100
|
||||||
|
@@ -1502,7 +1502,7 @@ filename), and call the initialisation r
|
||||||
|
.RS
|
||||||
|
.IP "Note:"
|
||||||
|
If the specified PATH is not a fully qualified filename, it will
|
||||||
|
-be interpreted relative to LIBDIR/snmp/dlmod, and \fC.so\fR
|
||||||
|
+be interpreted relative to /usr/lib(64)/snmp/dlmod, and \fC.so\fR
|
||||||
|
will be appended to the filename.
|
||||||
|
.RE
|
||||||
|
.PP
|
29
net-snmp-5.6-test-debug.patch
Normal file
29
net-snmp-5.6-test-debug.patch
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
Don't check tests which depend on DNS - it's disabled in Koji
|
||||||
|
|
||||||
|
diff -up net-snmp-5.7.2/testing/fulltests/default/T070com2sec_simple.debug net-snmp-5.7.2/testing/fulltests/default/T070com2sec_simple
|
||||||
|
--- net-snmp-5.7.2/testing/fulltests/default/T070com2sec_simple.debug 2012-10-10 00:28:58.000000000 +0200
|
||||||
|
+++ net-snmp-5.7.2/testing/fulltests/default/T070com2sec_simple 2012-10-18 10:16:39.276416510 +0200
|
||||||
|
@@ -134,6 +134,10 @@ SAVECHECKAGENT '<"c406a", 255.255.255.25
|
||||||
|
SAVECHECKAGENT 'line 30: Error:' # msg from h_strerror so it varies
|
||||||
|
SAVECHECKAGENT 'line 31: Error:' # msg from h_strerror so it varies
|
||||||
|
|
||||||
|
+FINISHED
|
||||||
|
+
|
||||||
|
+# don't test the later, it depends on DNS, which is not available in Koji
|
||||||
|
+
|
||||||
|
CHECKAGENT '<"c408a"'
|
||||||
|
if [ "$snmp_last_test_result" -eq 0 ] ; then
|
||||||
|
CHECKAGENT 'line 32: Error:'
|
||||||
|
diff -up net-snmp-5.7.2/testing/fulltests/default/T071com2sec6_simple.debug net-snmp-5.7.2/testing/fulltests/default/T071com2sec6_simple
|
||||||
|
--- net-snmp-5.7.2/testing/fulltests/default/T071com2sec6_simple.debug 2012-10-10 00:28:58.000000000 +0200
|
||||||
|
+++ net-snmp-5.7.2/testing/fulltests/default/T071com2sec6_simple 2012-10-18 10:16:39.276416510 +0200
|
||||||
|
@@ -132,6 +132,9 @@ SAVECHECKAGENT '<"c606a", ffff:ffff:ffff
|
||||||
|
SAVECHECKAGENT 'line 27: Error:'
|
||||||
|
SAVECHECKAGENT 'line 28: Error:'
|
||||||
|
|
||||||
|
+FINISHED
|
||||||
|
+
|
||||||
|
+# don't test the later, it depends on DNS, which is not available in Koji
|
||||||
|
# 608
|
||||||
|
CHECKAGENT '<"c608a"'
|
||||||
|
if [ "$snmp_last_test_result" -eq 0 ] ; then
|
57
net-snmp-5.7-agentx-crash.patch
Normal file
57
net-snmp-5.7-agentx-crash.patch
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
729738 - net-snmp dumps core in netsnmp_oid_find_prefix
|
||||||
|
1038011 - net-snmp: snmpd crashes/hangs when AgentX subagent times-out
|
||||||
|
|
||||||
|
commit f9304c83f76202db0e684269ca1af32e43cd9db4
|
||||||
|
Author: Jan Safranek <jsafranek@users.sourceforge.net>
|
||||||
|
Date: Tue Feb 7 14:53:44 2012 +0100
|
||||||
|
|
||||||
|
CHANGES: PATCH 1633670: fixed snmpd crashing when an AgentX subagent disconnect in the middle of processing of a request.
|
||||||
|
|
||||||
|
I fixed also the memory leak reported in the tracker comments.
|
||||||
|
|
||||||
|
diff --git a/agent/mibgroup/agentx/master.c b/agent/mibgroup/agentx/master.c
|
||||||
|
index c42a42a..baeebaf 100644
|
||||||
|
--- a/agent/mibgroup/agentx/master.c
|
||||||
|
+++ b/agent/mibgroup/agentx/master.c
|
||||||
|
@@ -219,6 +219,9 @@ agentx_got_response(int operation,
|
||||||
|
if (!cache) {
|
||||||
|
DEBUGMSGTL(("agentx/master", "response too late on session %8p\n",
|
||||||
|
session));
|
||||||
|
+ /* response is too late, free the cache */
|
||||||
|
+ if (magic)
|
||||||
|
+ netsnmp_free_delegated_cache((netsnmp_delegated_cache*) magic);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
requests = cache->requests;
|
||||||
|
@@ -606,6 +609,8 @@ agentx_master_handler(netsnmp_mib_handler *handler,
|
||||||
|
result = snmp_async_send(ax_session, pdu, agentx_got_response, cb_data);
|
||||||
|
if (result == 0) {
|
||||||
|
snmp_free_pdu(pdu);
|
||||||
|
+ if (cb_data)
|
||||||
|
+ netsnmp_free_delegated_cache((netsnmp_delegated_cache*) cb_data);
|
||||||
|
}
|
||||||
|
|
||||||
|
return SNMP_ERR_NOERROR;
|
||||||
|
diff --git a/agent/mibgroup/agentx/master_admin.c b/agent/mibgroup/agentx/master_admin.c
|
||||||
|
index f16f392..b84b85e 100644
|
||||||
|
--- a/agent/mibgroup/agentx/master_admin.c
|
||||||
|
+++ b/agent/mibgroup/agentx/master_admin.c
|
||||||
|
@@ -133,11 +133,16 @@ close_agentx_session(netsnmp_session * session, int sessid)
|
||||||
|
* requests, so that the delegated request will be completed and
|
||||||
|
* further requests can be processed
|
||||||
|
*/
|
||||||
|
- netsnmp_remove_delegated_requests_for_session(session);
|
||||||
|
+ while (netsnmp_remove_delegated_requests_for_session(session)) {
|
||||||
|
+ DEBUGMSGTL(("agentx/master", "Continue removing delegated reqests\n"));
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
if (session->subsession != NULL) {
|
||||||
|
netsnmp_session *subsession = session->subsession;
|
||||||
|
for(; subsession; subsession = subsession->next) {
|
||||||
|
- netsnmp_remove_delegated_requests_for_session(subsession);
|
||||||
|
+ while (netsnmp_remove_delegated_requests_for_session(subsession)) {
|
||||||
|
+ DEBUGMSGTL(("agentx/master", "Continue removing delegated subsession reqests\n"));
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
10
net-snmp-5.7.2-autoreconf.patch
Normal file
10
net-snmp-5.7.2-autoreconf.patch
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
926223 - net-snmp: Does not support aarch64 in f19 and rawhide
|
||||||
|
|
||||||
|
Update autoconf version to make the test suite happy.
|
||||||
|
|
||||||
|
diff -up net-snmp-5.7.2/dist/autoconf-version.autoreconf net-snmp-5.7.2/dist/autoconf-version
|
||||||
|
--- net-snmp-5.7.2/dist/autoconf-version.autoreconf 2013-03-25 13:00:15.002745347 +0100
|
||||||
|
+++ net-snmp-5.7.2/dist/autoconf-version 2013-03-25 13:00:17.207736442 +0100
|
||||||
|
@@ -1 +1 @@
|
||||||
|
-2.68
|
||||||
|
+2.69
|
40
net-snmp-5.7.2-create-user-multilib.patch
Normal file
40
net-snmp-5.7.2-create-user-multilib.patch
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
Make net-snmp-create-v3-user multilib-clean
|
||||||
|
|
||||||
|
The file had different NSC_AGENTLIBS on different architectures.
|
||||||
|
|
||||||
|
Source: upstream
|
||||||
|
|
||||||
|
commit 68300a9fb43568c5d833c48a2fef3ff16c2923c3
|
||||||
|
Author: Jan Safranek <jsafranek@users.sourceforge.net>
|
||||||
|
Date: Thu Feb 7 10:14:33 2013 +0100
|
||||||
|
|
||||||
|
Remove unused variables.
|
||||||
|
|
||||||
|
diff --git a/net-snmp-create-v3-user.in b/net-snmp-create-v3-user.in
|
||||||
|
index 5288f3b..efa19c3 100644
|
||||||
|
--- a/net-snmp-create-v3-user.in
|
||||||
|
+++ b/net-snmp-create-v3-user.in
|
||||||
|
@@ -10,23 +10,6 @@ exec_prefix=@exec_prefix@
|
||||||
|
includedir=@includedir@
|
||||||
|
libdir=@libdir@
|
||||||
|
datarootdir=@datarootdir@
|
||||||
|
-NSC_LDFLAGS="@LDFLAGS@"
|
||||||
|
-NSC_INCLUDEDIR=${includedir}
|
||||||
|
-NSC_LIBDIR=-L${libdir}
|
||||||
|
-NSC_LIBS="@LIBS@"
|
||||||
|
-NSC_AGENTLIBS="@AGENTLIBS@ @PERLLDOPTS_FOR_APPS@"
|
||||||
|
-NSC_PREFIX=$prefix
|
||||||
|
-NSC_EXEC_PREFIX=$exec_prefix
|
||||||
|
-NSC_SRCDIR=@srcdir@
|
||||||
|
-NSC_INCDIR=${NSC_PREFIX}/include
|
||||||
|
-NSC_BASE_SUBAGENT_LIBS="-lnetsnmpagent -lnetsnmp"
|
||||||
|
-NSC_BASE_AGENT_LIBS="-lnetsnmpagent -lnetsnmpmibs -lnetsnmp"
|
||||||
|
-NSC_SRC_LIBDIRS="agent/.libs snmplib/.libs"
|
||||||
|
-NSC_SRC_LIBDEPS="agent/.libs/libnetsnmpmibs.a agent/.libs/libnetsnmpagent.a snmplib/.libs/libnetsnmp.a"
|
||||||
|
-
|
||||||
|
-if test "x$NSC_SRCDIR" = "x." ; then
|
||||||
|
- NSC_SRCDIR="NET-SNMP-SOURCE-DIR"
|
||||||
|
-fi
|
||||||
|
|
||||||
|
if @PSCMD@ | egrep ' snmpd *$' > /dev/null 2>&1 ; then
|
||||||
|
echo "Apparently at least one snmpd demon is already running."
|
@ -1,8 +1,7 @@
|
|||||||
diff --git a/agent/Makefile.in b/agent/Makefile.in
|
diff -up net-snmp-5.7.2/agent/Makefile.in.pie net-snmp-5.7.2/agent/Makefile.in
|
||||||
index 047d880..38d40aa 100644
|
--- net-snmp-5.7.2/agent/Makefile.in.pie 2012-10-10 00:28:58.000000000 +0200
|
||||||
--- a/agent/Makefile.in
|
+++ net-snmp-5.7.2/agent/Makefile.in 2012-10-18 09:45:13.298613099 +0200
|
||||||
+++ b/agent/Makefile.in
|
@@ -294,7 +294,7 @@ getmibstat.o: mibgroup/kernel_sunos5.c
|
||||||
@@ -300,7 +300,7 @@ getmibstat.o: mibgroup/kernel_sunos5.c
|
|
||||||
$(CC) $(CFLAGS) -o $@ -D_GETMIBSTAT_TEST -DDODEBUG -c $?
|
$(CC) $(CFLAGS) -o $@ -D_GETMIBSTAT_TEST -DDODEBUG -c $?
|
||||||
|
|
||||||
snmpd$(EXEEXT): ${LAGENTOBJS} $(USELIBS) $(AGENTLIB) $(HELPERLIB) $(MIBLIB) $(LIBTARG)
|
snmpd$(EXEEXT): ${LAGENTOBJS} $(USELIBS) $(AGENTLIB) $(HELPERLIB) $(MIBLIB) $(LIBTARG)
|
||||||
@ -10,12 +9,11 @@ index 047d880..38d40aa 100644
|
|||||||
+ $(LINK) $(CFLAGS) -o $@ -pie ${LAGENTOBJS} ${LDFLAGS} ${OUR_AGENT_LIBS}
|
+ $(LINK) $(CFLAGS) -o $@ -pie ${LAGENTOBJS} ${LDFLAGS} ${OUR_AGENT_LIBS}
|
||||||
|
|
||||||
libnetsnmpagent.$(LIB_EXTENSION)$(LIB_VERSION): ${LLIBAGENTOBJS} $(USELIBS)
|
libnetsnmpagent.$(LIB_EXTENSION)$(LIB_VERSION): ${LLIBAGENTOBJS} $(USELIBS)
|
||||||
$(LIB_LD_CMD) $(AGENTLIB) ${LLIBAGENTOBJS} $(USELIBS) ${LAGENTLIBS} $(LDFLAGS) $(PERLLDOPTS_FOR_LIBS) @AGENTLIBS@
|
$(LIB_LD_CMD) $(AGENTLIB) ${LLIBAGENTOBJS} $(USELIBS) ${LAGENTLIBS} @LD_NO_UNDEFINED@ $(LDFLAGS) $(PERLLDOPTS_FOR_LIBS) $(LIB_LD_LIBS) @AGENTLIBS@
|
||||||
diff --git a/apps/Makefile.in b/apps/Makefile.in
|
diff -up net-snmp-5.7.2/apps/Makefile.in.pie net-snmp-5.7.2/apps/Makefile.in
|
||||||
index 3dbb1d1..48ed23a 100644
|
--- net-snmp-5.7.2/apps/Makefile.in.pie 2012-10-10 00:28:58.000000000 +0200
|
||||||
--- a/apps/Makefile.in
|
+++ net-snmp-5.7.2/apps/Makefile.in 2012-10-18 09:44:27.827774580 +0200
|
||||||
+++ b/apps/Makefile.in
|
@@ -170,7 +170,7 @@ snmptest$(EXEEXT): snmptest.$(OSUFFIX
|
||||||
@@ -190,7 +190,7 @@ snmptest$(EXEEXT): snmptest.$(OSUFFIX) $(USELIBS)
|
|
||||||
$(LINK) ${CFLAGS} -o $@ snmptest.$(OSUFFIX) ${LDFLAGS} ${LIBS}
|
$(LINK) ${CFLAGS} -o $@ snmptest.$(OSUFFIX) ${LDFLAGS} ${LIBS}
|
||||||
|
|
||||||
snmptrapd$(EXEEXT): $(TRAPD_OBJECTS) $(USETRAPLIBS) $(INSTALLLIBS)
|
snmptrapd$(EXEEXT): $(TRAPD_OBJECTS) $(USETRAPLIBS) $(INSTALLLIBS)
|
1650
net-snmp-5.7.2-systemd.patch
Normal file
1650
net-snmp-5.7.2-systemd.patch
Normal file
File diff suppressed because it is too large
Load Diff
22
net-snmp-5.7.3-Fix-Makefile-PL.patch
Normal file
22
net-snmp-5.7.3-Fix-Makefile-PL.patch
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
diff -up net-snmp-5.7.3/perl/ASN/Makefile.PL.orig net-snmp-5.7.3/perl/ASN/Makefile.PL
|
||||||
|
--- net-snmp-5.7.3/perl/ASN/Makefile.PL.orig 2016-05-06 10:35:30.005905040 +0200
|
||||||
|
+++ net-snmp-5.7.3/perl/ASN/Makefile.PL 2016-05-06 10:35:57.518776400 +0200
|
||||||
|
@@ -3,6 +3,7 @@ require 5;
|
||||||
|
use Config;
|
||||||
|
use Getopt::Long;
|
||||||
|
my $lib_version;
|
||||||
|
+my %MakeParams = ();
|
||||||
|
|
||||||
|
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
|
||||||
|
# the contents of the Makefile that is written.
|
||||||
|
diff -up net-snmp-5.7.3/perl/Makefile.PL.orig net-snmp-5.7.3/perl/Makefile.PL
|
||||||
|
--- net-snmp-5.7.3/perl/Makefile.PL.orig 2016-05-06 10:34:38.975143641 +0200
|
||||||
|
+++ net-snmp-5.7.3/perl/Makefile.PL 2016-05-06 10:35:13.326983024 +0200
|
||||||
|
@@ -2,6 +2,7 @@ use ExtUtils::MakeMaker;
|
||||||
|
use Config;
|
||||||
|
use Getopt::Long;
|
||||||
|
require 5;
|
||||||
|
+my %MakeParams = ();
|
||||||
|
|
||||||
|
%MakeParams = InitMakeParams();
|
||||||
|
|
2519
net-snmp-5.7.3-Remove-U64-typedef.patch
Normal file
2519
net-snmp-5.7.3-Remove-U64-typedef.patch
Normal file
File diff suppressed because it is too large
Load Diff
134
net-snmp-5.7.3-cflags.patch
Normal file
134
net-snmp-5.7.3-cflags.patch
Normal file
@ -0,0 +1,134 @@
|
|||||||
|
1309080 - net-snmp-config specifies redhat-hardened-cc1 in cflags and causes gcc failure without redhat-rpm-config
|
||||||
|
|
||||||
|
Don't remove -Wall in perl Makefiles - it would remove -Wformat and gcc would fail with
|
||||||
|
error: -Wformat-security ignored without -Wformat
|
||||||
|
|
||||||
|
+ there is one upstream patch below (to be removed on rebase)
|
||||||
|
|
||||||
|
diff -up net-snmp-5.7.3/perl/agent/default_store/Makefile.PL.cflags net-snmp-5.7.3/perl/agent/default_store/Makefile.PL
|
||||||
|
--- net-snmp-5.7.3/perl/agent/default_store/Makefile.PL.cflags 2014-12-08 21:23:22.000000000 +0100
|
||||||
|
+++ net-snmp-5.7.3/perl/agent/default_store/Makefile.PL 2016-02-24 12:17:05.154209526 +0100
|
||||||
|
@@ -79,7 +79,7 @@ sub InitMakeParams {
|
||||||
|
$Params{'LIBS'} = "-L../../../snmplib/.libs -L../../../snmplib/ " . $Params{'LIBS'};
|
||||||
|
$Params{'CCFLAGS'} = "-I../../../include " . $Params{'CCFLAGS'};
|
||||||
|
}
|
||||||
|
- $Params{'CCFLAGS'} =~ s/ -W(all|inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings
|
||||||
|
+ $Params{'CCFLAGS'} =~ s/ -W(inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings
|
||||||
|
if ($Params{'LIBS'} eq "" || $Params{'CCFLAGS'} eq "") {
|
||||||
|
die "You need to install net-snmp first (I can't find net-snmp-config)";
|
||||||
|
}
|
||||||
|
diff -up net-snmp-5.7.3/perl/agent/Makefile.PL.cflags net-snmp-5.7.3/perl/agent/Makefile.PL
|
||||||
|
--- net-snmp-5.7.3/perl/agent/Makefile.PL.cflags 2014-12-08 21:23:22.000000000 +0100
|
||||||
|
+++ net-snmp-5.7.3/perl/agent/Makefile.PL 2016-02-24 12:17:05.154209526 +0100
|
||||||
|
@@ -92,7 +92,7 @@ sub InitMakeParams {
|
||||||
|
$Params{'LIBS'} = `$opts->{'nsconfig'} --libdir` . $Params{'LIBS'};
|
||||||
|
# $Params{'PREREQ_PM'} = {'NetSNMP::OID' => '0.1'};
|
||||||
|
}
|
||||||
|
- $Params{'CCFLAGS'} =~ s/ -W(all|inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings
|
||||||
|
+ $Params{'CCFLAGS'} =~ s/ -W(inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings
|
||||||
|
if ($Params{'LIBS'} eq "" || $Params{'CCFLAGS'} eq "") {
|
||||||
|
die "You need to install net-snmp first (I can't find net-snmp-config)";
|
||||||
|
}
|
||||||
|
diff -up net-snmp-5.7.3/perl/agent/Support/Makefile.PL.cflags net-snmp-5.7.3/perl/agent/Support/Makefile.PL
|
||||||
|
--- net-snmp-5.7.3/perl/agent/Support/Makefile.PL.cflags 2016-02-24 12:17:16.291271579 +0100
|
||||||
|
+++ net-snmp-5.7.3/perl/agent/Support/Makefile.PL 2016-02-24 12:17:22.413305687 +0100
|
||||||
|
@@ -86,7 +86,7 @@ sub InitMakeParams {
|
||||||
|
$Params{'LIBS'} = "-L../../snmplib/.libs -L../../snmplib/ " . $Params{'LIBS'};
|
||||||
|
$Params{'CCFLAGS'} = "-I../../include " . $Params{'CCFLAGS'};
|
||||||
|
}
|
||||||
|
- $Params{'CCFLAGS'} =~ s/ -W(all|inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings
|
||||||
|
+ $Params{'CCFLAGS'} =~ s/ -W(inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings
|
||||||
|
if ($Params{'LIBS'} eq "" || $Params{'CCFLAGS'} eq "") {
|
||||||
|
die "You need to install net-snmp first (I can't find net-snmp-config)";
|
||||||
|
}
|
||||||
|
diff -up net-snmp-5.7.3/perl/ASN/Makefile.PL.cflags net-snmp-5.7.3/perl/ASN/Makefile.PL
|
||||||
|
--- net-snmp-5.7.3/perl/ASN/Makefile.PL.cflags 2014-12-08 21:23:22.000000000 +0100
|
||||||
|
+++ net-snmp-5.7.3/perl/ASN/Makefile.PL 2016-02-24 12:17:05.155209532 +0100
|
||||||
|
@@ -86,7 +86,7 @@ sub InitMakeParams {
|
||||||
|
$Params{'LIBS'} = "-L../../snmplib/.libs -L../../snmplib/ " . $Params{'LIBS'};
|
||||||
|
$Params{'CCFLAGS'} = "-I../../include " . $Params{'CCFLAGS'};
|
||||||
|
}
|
||||||
|
- $Params{'CCFLAGS'} =~ s/ -W(all|inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings
|
||||||
|
+ $Params{'CCFLAGS'} =~ s/ -W(inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings
|
||||||
|
if ($Params{'LIBS'} eq "" || $Params{'CCFLAGS'} eq "") {
|
||||||
|
die "You need to install net-snmp first (I can't find net-snmp-config)";
|
||||||
|
}
|
||||||
|
diff -up net-snmp-5.7.3/perl/default_store/Makefile.PL.cflags net-snmp-5.7.3/perl/default_store/Makefile.PL
|
||||||
|
--- net-snmp-5.7.3/perl/default_store/Makefile.PL.cflags 2014-12-08 21:23:22.000000000 +0100
|
||||||
|
+++ net-snmp-5.7.3/perl/default_store/Makefile.PL 2016-02-24 12:17:05.155209532 +0100
|
||||||
|
@@ -79,7 +79,7 @@ sub InitMakeParams {
|
||||||
|
$Params{'LIBS'} = "-L../../snmplib/.libs -L../../snmplib/ " . $Params{'LIBS'};
|
||||||
|
$Params{'CCFLAGS'} = "-I../../include " . $Params{'CCFLAGS'};
|
||||||
|
}
|
||||||
|
- $Params{'CCFLAGS'} =~ s/ -W(all|inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings
|
||||||
|
+ $Params{'CCFLAGS'} =~ s/ -W(inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings
|
||||||
|
if ($Params{'LIBS'} eq "" || $Params{'CCFLAGS'} eq "") {
|
||||||
|
die "You need to install net-snmp first (I can't find net-snmp-config)";
|
||||||
|
}
|
||||||
|
diff -up net-snmp-5.7.3/perl/OID/Makefile.PL.cflags net-snmp-5.7.3/perl/OID/Makefile.PL
|
||||||
|
--- net-snmp-5.7.3/perl/OID/Makefile.PL.cflags 2014-12-08 21:23:22.000000000 +0100
|
||||||
|
+++ net-snmp-5.7.3/perl/OID/Makefile.PL 2016-02-24 12:17:05.155209532 +0100
|
||||||
|
@@ -86,7 +86,7 @@ sub InitMakeParams {
|
||||||
|
# } else {
|
||||||
|
# $Params{'PREREQ_PM'} = {'SNMP' => '5.0'};
|
||||||
|
}
|
||||||
|
- $Params{'CCFLAGS'} =~ s/ -W(all|inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings
|
||||||
|
+ $Params{'CCFLAGS'} =~ s/ -W(inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings
|
||||||
|
if ($Params{'LIBS'} eq "" || $Params{'CCFLAGS'} eq "") {
|
||||||
|
die "You need to install net-snmp first (I can't find net-snmp-config)";
|
||||||
|
}
|
||||||
|
diff -up net-snmp-5.7.3/perl/SNMP/Makefile.PL.cflags net-snmp-5.7.3/perl/SNMP/Makefile.PL
|
||||||
|
--- net-snmp-5.7.3/perl/SNMP/Makefile.PL.cflags 2014-12-08 21:23:22.000000000 +0100
|
||||||
|
+++ net-snmp-5.7.3/perl/SNMP/Makefile.PL 2016-02-24 12:17:05.155209532 +0100
|
||||||
|
@@ -98,7 +98,7 @@ sub InitMakeParams {
|
||||||
|
# } else {
|
||||||
|
# $Params{'PREREQ_PM'} = { 'NetSNMP::default_store' => 0.01 };
|
||||||
|
}
|
||||||
|
- $Params{'CCFLAGS'} =~ s/ -W(all|inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings
|
||||||
|
+ $Params{'CCFLAGS'} =~ s/ -W(inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings
|
||||||
|
if (!$ENV{'NETSNMP_PREFIX'}) {
|
||||||
|
$prefix = `$opts->{'nsconfig'} --prefix`;
|
||||||
|
chomp($prefix);
|
||||||
|
diff -up net-snmp-5.7.3/perl/TrapReceiver/Makefile.PL.cflags net-snmp-5.7.3/perl/TrapReceiver/Makefile.PL
|
||||||
|
--- net-snmp-5.7.3/perl/TrapReceiver/Makefile.PL.cflags 2014-12-08 21:23:22.000000000 +0100
|
||||||
|
+++ net-snmp-5.7.3/perl/TrapReceiver/Makefile.PL 2016-02-24 12:17:05.155209532 +0100
|
||||||
|
@@ -124,7 +124,7 @@ sub InitMakeParams {
|
||||||
|
$Params{'LIBS'} = `$opts->{'nsconfig'} --libdir` . " $Params{'LIBS'}";
|
||||||
|
}
|
||||||
|
|
||||||
|
- $Params{'CCFLAGS'} =~ s/ -W(all|inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings
|
||||||
|
+ $Params{'CCFLAGS'} =~ s/ -W(inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings
|
||||||
|
if ($Params{'CCFLAGS'} eq "") {
|
||||||
|
die "You need to install net-snmp first (I can't find net-snmp-config)";
|
||||||
|
}
|
||||||
|
|
||||||
|
commit 127274f8f27fba264a4c0f91190fd6f8037cdf21
|
||||||
|
Author: Jan Safranek <jsafranek@users.sourceforge.net>
|
||||||
|
Date: Wed Feb 24 10:14:21 2016 +0100
|
||||||
|
|
||||||
|
Trim output of net-snmp-config --cflags.
|
||||||
|
|
||||||
|
We should report CFLAGS needed to import and use Net-SNMP headers, not
|
||||||
|
CFLAGS used to compile actual Net-SNMP.
|
||||||
|
|
||||||
|
E.g. we should not report various distro fortify-source options.
|
||||||
|
|
||||||
|
diff --git a/net-snmp-config.in b/net-snmp-config.in
|
||||||
|
index 7e34944..f3bffe9 100644
|
||||||
|
--- a/net-snmp-config.in
|
||||||
|
+++ b/net-snmp-config.in
|
||||||
|
@@ -138,10 +138,10 @@ else
|
||||||
|
;;
|
||||||
|
#################################################### compile
|
||||||
|
--base-cflags)
|
||||||
|
- echo @CFLAGS@ @CPPFLAGS@ -I${NSC_INCLUDEDIR}
|
||||||
|
+ echo -I${NSC_INCLUDEDIR}
|
||||||
|
;;
|
||||||
|
--cflags|--cf*)
|
||||||
|
- echo @CFLAGS@ @DEVFLAGS@ @CPPFLAGS@ -I. -I${NSC_INCLUDEDIR}
|
||||||
|
+ echo @DEVFLAGS@ -I. -I${NSC_INCLUDEDIR}
|
||||||
|
;;
|
||||||
|
--srcdir)
|
||||||
|
echo $NSC_SRCDIR
|
||||||
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
|||||||
diff -urNp old/agent/mibgroup/host/data_access/swrun.c new/agent/mibgroup/host/data_access/swrun.c
|
|
||||||
--- old/agent/mibgroup/host/data_access/swrun.c 2017-07-18 09:44:00.626109526 +0200
|
|
||||||
+++ new/agent/mibgroup/host/data_access/swrun.c 2017-07-19 15:27:50.452255836 +0200
|
|
||||||
@@ -102,6 +102,10 @@ swrun_count_processes_by_name( char *nam
|
|
||||||
return 0; /* or -1 */
|
|
||||||
|
|
||||||
it = CONTAINER_ITERATOR( swrun_container );
|
|
||||||
+ if((entry = (netsnmp_swrun_entry*)ITERATOR_FIRST( it )) != NULL) {
|
|
||||||
+ if (0 == strcmp( entry->hrSWRunName, name ))
|
|
||||||
+ i++;
|
|
||||||
+ }
|
|
||||||
while ((entry = (netsnmp_swrun_entry*)ITERATOR_NEXT( it )) != NULL) {
|
|
||||||
if (0 == strcmp( entry->hrSWRunName, name ))
|
|
||||||
i++;
|
|
28
net-snmp-5.7.3-mysqllib.patch
Normal file
28
net-snmp-5.7.3-mysqllib.patch
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
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.
|
||||||
|
---
|
||||||
|
apps/Makefile.in | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/apps/Makefile.in b/apps/Makefile.in
|
||||||
|
index 77404dd89..7da434522 100644
|
||||||
|
--- a/apps/Makefile.in
|
||||||
|
+++ b/apps/Makefile.in
|
||||||
|
@@ -204,7 +204,7 @@ snmpdf$(EXEEXT): snmpdf.$(OSUFFIX) $(USELIBS)
|
||||||
|
$(LINK) ${CFLAGS} -o $@ snmpdf.$(OSUFFIX) ${LDFLAGS} ${LIBS}
|
||||||
|
|
||||||
|
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) $(LIB_LD_LIBS) $(MYSQL_LIBS)
|
||||||
|
$(RANLIB) $@
|
||||||
|
|
||||||
|
snmpinforminstall:
|
||||||
|
--
|
||||||
|
2.13.0
|
||||||
|
|
69
net-snmp-5.7.3-snmpstatus-null.patch
Normal file
69
net-snmp-5.7.3-snmpstatus-null.patch
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
commit bec6243394ed78897c14e3fa46f934e0ea3d453e
|
||||||
|
Author: Jan Safranek <jsafranek@users.sourceforge.net>
|
||||||
|
Date: Fri Jun 26 13:30:07 2015 +0200
|
||||||
|
|
||||||
|
snmpstatus: CHANGES: Fixed crash when receiving non-standard compliant responses.
|
||||||
|
|
||||||
|
Some HW sends ifOperStatus as NULL instead of INTEGER type. We should not try to dereference this NULL.
|
||||||
|
|
||||||
|
diff --git a/apps/snmpstatus.c b/apps/snmpstatus.c
|
||||||
|
index ae08369..6f31c42 100644
|
||||||
|
--- a/apps/snmpstatus.c
|
||||||
|
+++ b/apps/snmpstatus.c
|
||||||
|
@@ -310,30 +310,38 @@ main(int argc, char *argv[])
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (vars->name_length >= length_ifOperStatus
|
||||||
|
- && !memcmp(objid_ifOperStatus, vars->name,
|
||||||
|
- sizeof(objid_ifOperStatus))) {
|
||||||
|
+ && !memcmp(objid_ifOperStatus, vars->name,
|
||||||
|
+ sizeof(objid_ifOperStatus))
|
||||||
|
+ && vars->type == ASN_INTEGER
|
||||||
|
+ && vars->val.integer) {
|
||||||
|
if (*vars->val.integer != MIB_IFSTATUS_UP)
|
||||||
|
down_interfaces++;
|
||||||
|
snmp_add_null_var(pdu, vars->name,
|
||||||
|
vars->name_length);
|
||||||
|
good_var++;
|
||||||
|
- } else if (vars->name_length >= length_ifInUCastPkts &&
|
||||||
|
- !memcmp(objid_ifInUCastPkts, vars->name,
|
||||||
|
- sizeof(objid_ifInUCastPkts))) {
|
||||||
|
+ } else if (vars->name_length >= length_ifInUCastPkts
|
||||||
|
+ &&!memcmp(objid_ifInUCastPkts, vars->name,
|
||||||
|
+ sizeof(objid_ifInUCastPkts))
|
||||||
|
+ && vars->type == ASN_COUNTER
|
||||||
|
+ && vars->val.integer) {
|
||||||
|
ipackets += *vars->val.integer;
|
||||||
|
snmp_add_null_var(pdu, vars->name,
|
||||||
|
vars->name_length);
|
||||||
|
good_var++;
|
||||||
|
} else if (vars->name_length >= length_ifInNUCastPkts
|
||||||
|
&& !memcmp(objid_ifInNUCastPkts, vars->name,
|
||||||
|
- sizeof(objid_ifInNUCastPkts))) {
|
||||||
|
+ sizeof(objid_ifInNUCastPkts))
|
||||||
|
+ && vars->type == ASN_COUNTER
|
||||||
|
+ && vars->val.integer) {
|
||||||
|
ipackets += *vars->val.integer;
|
||||||
|
snmp_add_null_var(pdu, vars->name,
|
||||||
|
vars->name_length);
|
||||||
|
good_var++;
|
||||||
|
} else if (vars->name_length >= length_ifOutUCastPkts
|
||||||
|
&& !memcmp(objid_ifOutUCastPkts, vars->name,
|
||||||
|
- sizeof(objid_ifOutUCastPkts))) {
|
||||||
|
+ sizeof(objid_ifOutUCastPkts))
|
||||||
|
+ && vars->type == ASN_COUNTER
|
||||||
|
+ && vars->val.integer) {
|
||||||
|
opackets += *vars->val.integer;
|
||||||
|
snmp_add_null_var(pdu, vars->name,
|
||||||
|
vars->name_length);
|
||||||
|
@@ -341,7 +349,9 @@ main(int argc, char *argv[])
|
||||||
|
} else if (vars->name_length >= length_ifOutNUCastPkts
|
||||||
|
&& !memcmp(objid_ifOutNUCastPkts,
|
||||||
|
vars->name,
|
||||||
|
- sizeof(objid_ifOutNUCastPkts))) {
|
||||||
|
+ sizeof(objid_ifOutNUCastPkts))
|
||||||
|
+ && vars->type == ASN_COUNTER
|
||||||
|
+ && vars->val.integer) {
|
||||||
|
opackets += *vars->val.integer;
|
||||||
|
snmp_add_null_var(pdu, vars->name,
|
||||||
|
vars->name_length);
|
19
net-snmp-5.7.3-strtok-r.patch
Normal file
19
net-snmp-5.7.3-strtok-r.patch
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
diff -urNp net-snmp-5.7.3/snmplib/snmp_transport.c net-snmp-5.7.3.new/snmplib/snmp_transport.c
|
||||||
|
--- net-snmp-5.7.3/snmplib/snmp_transport.c 2014-12-08 21:23:22.000000000 +0100
|
||||||
|
+++ net-snmp-5.7.3.new/snmplib/snmp_transport.c 2016-08-12 13:04:35.438583586 +0200
|
||||||
|
@@ -594,12 +594,13 @@ netsnmp_tdomain_transport_full(const cha
|
||||||
|
int commas = 0;
|
||||||
|
const char *cp = default_domain;
|
||||||
|
char *dup = strdup(default_domain);
|
||||||
|
+ char *ptr = NULL;
|
||||||
|
|
||||||
|
while (*++cp) if (*cp == ',') commas++;
|
||||||
|
lspec = calloc(commas+2, sizeof(char *));
|
||||||
|
commas = 1;
|
||||||
|
- lspec[0] = strtok(dup, ",");
|
||||||
|
- while ((lspec[commas++] = strtok(NULL, ",")))
|
||||||
|
+ lspec[0] = strtok_r(dup, ",", &ptr);
|
||||||
|
+ while ((lspec[commas++] = strtok_r(NULL, ",", &ptr)))
|
||||||
|
;
|
||||||
|
spec = (const char * const *)lspec;
|
||||||
|
}
|
@ -1,12 +0,0 @@
|
|||||||
diff -urNp a/include/net-snmp/library/int64.h b/include/net-snmp/library/int64.h
|
|
||||||
--- a/include/net-snmp/library/int64.h 2018-07-18 14:37:16.543348832 +0200
|
|
||||||
+++ b/include/net-snmp/library/int64.h 2018-07-18 15:31:31.516999288 +0200
|
|
||||||
@@ -10,7 +10,7 @@ extern "C" {
|
|
||||||
* Note: using the U64 typedef is deprecated because this typedef conflicts
|
|
||||||
* with a typedef with the same name defined in the Perl header files.
|
|
||||||
*/
|
|
||||||
- typedef struct counter64 U64;
|
|
||||||
+// typedef struct counter64 U64;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define I64CHARSZ 21
|
|
@ -1,35 +0,0 @@
|
|||||||
diff -urNp a/snmplib/snmp_api.c b/snmplib/snmp_api.c
|
|
||||||
--- a/snmplib/snmp_api.c 2020-11-26 11:05:51.084788775 +0100
|
|
||||||
+++ b/snmplib/snmp_api.c 2020-11-26 11:08:27.850751397 +0100
|
|
||||||
@@ -235,7 +235,7 @@ static const char *api_errors[-SNMPERR_M
|
|
||||||
"No error", /* SNMPERR_SUCCESS */
|
|
||||||
"Generic error", /* SNMPERR_GENERR */
|
|
||||||
"Invalid local port", /* SNMPERR_BAD_LOCPORT */
|
|
||||||
- "Unknown host", /* SNMPERR_BAD_ADDRESS */
|
|
||||||
+ "Invalid address", /* SNMPERR_BAD_ADDRESS */
|
|
||||||
"Unknown session", /* SNMPERR_BAD_SESSION */
|
|
||||||
"Too long", /* SNMPERR_TOO_LONG */
|
|
||||||
"No socket", /* SNMPERR_NO_SOCKET */
|
|
||||||
@@ -1662,7 +1662,9 @@ _sess_open(netsnmp_session * in_session)
|
|
||||||
DEBUGMSGTL(("_sess_open", "couldn't interpret peername\n"));
|
|
||||||
in_session->s_snmp_errno = SNMPERR_BAD_ADDRESS;
|
|
||||||
in_session->s_errno = errno;
|
|
||||||
- snmp_set_detail(in_session->peername);
|
|
||||||
+ if (!netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
|
|
||||||
+ NETSNMP_DS_LIB_CLIENT_ADDR))
|
|
||||||
+ snmp_set_detail(in_session->peername);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
diff -ruNp a/snmplib/transports/snmpUDPIPv4BaseDomain.c b/snmplib/transports/snmpUDPIPv4BaseDomain.c
|
|
||||||
--- a/snmplib/transports/snmpUDPIPv4BaseDomain.c 2021-01-06 12:51:51.948106797 +0100
|
|
||||||
+++ b/snmplib/transports/snmpUDPIPv4BaseDomain.c 2021-01-06 14:17:31.029745744 +0100
|
|
||||||
@@ -209,6 +209,8 @@ netsnmp_udpipv4base_transport_bind(netsn
|
|
||||||
DEBUGMSGTL(("netsnmp_udpbase",
|
|
||||||
"failed to bind for clientaddr: %d %s\n",
|
|
||||||
errno, strerror(errno)));
|
|
||||||
+ NETSNMP_LOGONCE((LOG_ERR, "Cannot bind for clientaddr: %s\n",
|
|
||||||
+ strerror(errno)));
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
|||||||
diff -urNp a/agent/mibgroup/ip-mib/data_access/ipaddress_common.c b/agent/mibgroup/ip-mib/data_access/ipaddress_common.c
|
|
||||||
--- a/agent/mibgroup/ip-mib/data_access/ipaddress_common.c 2020-06-10 13:27:03.213904398 +0200
|
|
||||||
+++ b/agent/mibgroup/ip-mib/data_access/ipaddress_common.c 2020-06-10 13:28:41.025863050 +0200
|
|
||||||
@@ -121,6 +121,7 @@ _remove_duplicates(netsnmp_container *co
|
|
||||||
for (entry = ITERATOR_FIRST(it); entry; entry = ITERATOR_NEXT(it)) {
|
|
||||||
if (prev_entry && _access_ipaddress_entry_compare_addr(prev_entry, entry) == 0) {
|
|
||||||
/* 'entry' is duplicate of the previous one -> delete it */
|
|
||||||
+ NETSNMP_LOGONCE((LOG_ERR, "Duplicate IPv4 address detected, some interfaces may not be visible in IP-MIB\n"));
|
|
||||||
netsnmp_access_ipaddress_entry_free(entry);
|
|
||||||
} else {
|
|
||||||
CONTAINER_INSERT(ret, entry);
|
|
@ -1,12 +0,0 @@
|
|||||||
diff -ruNp a/snmplib/read_config.c b/snmplib/read_config.c
|
|
||||||
--- a/snmplib/read_config.c 2020-06-10 09:51:57.184786510 +0200
|
|
||||||
+++ b/snmplib/read_config.c 2020-06-10 09:53:13.257507112 +0200
|
|
||||||
@@ -1642,7 +1642,7 @@ snmp_save_persistent(const char *type)
|
|
||||||
* save a warning header to the top of the new file
|
|
||||||
*/
|
|
||||||
snprintf(fileold, sizeof(fileold),
|
|
||||||
- "%s%s# Please save normal configuration tokens for %s in SNMPCONFPATH/%s.conf.\n# Only \"createUser\" tokens should be placed here by %s administrators.\n%s",
|
|
||||||
+ "%s%s# Please save normal configuration tokens for %s in /etc/snmp/%s.conf.\n# Only \"createUser\" tokens should be placed here by %s administrators.\n%s",
|
|
||||||
"#\n# net-snmp (or ucd-snmp) persistent data file.\n#\n############################################################################\n# STOP STOP STOP STOP STOP STOP STOP STOP STOP \n",
|
|
||||||
"#\n# **** DO NOT EDIT THIS FILE ****\n#\n# STOP STOP STOP STOP STOP STOP STOP STOP STOP \n############################################################################\n#\n# DO NOT STORE CONFIGURATION ENTRIES HERE.\n",
|
|
||||||
type, type, type,
|
|
@ -1,82 +0,0 @@
|
|||||||
diff -urNp a/agent/mibgroup/mibII/ipAddr.c b/agent/mibgroup/mibII/ipAddr.c
|
|
||||||
--- a/agent/mibgroup/mibII/ipAddr.c 2020-06-10 14:14:30.113696471 +0200
|
|
||||||
+++ b/agent/mibgroup/mibII/ipAddr.c 2020-06-10 14:27:15.345354018 +0200
|
|
||||||
@@ -495,14 +495,16 @@ Address_Scan_Next(Index, Retin_ifaddr)
|
|
||||||
}
|
|
||||||
|
|
||||||
#elif defined(linux)
|
|
||||||
+#include <errno.h>
|
|
||||||
static struct ifreq *ifr;
|
|
||||||
static int ifr_counter;
|
|
||||||
|
|
||||||
static void
|
|
||||||
Address_Scan_Init(void)
|
|
||||||
{
|
|
||||||
- int num_interfaces = 0;
|
|
||||||
+ int i;
|
|
||||||
int fd;
|
|
||||||
+ int lastlen = 0;
|
|
||||||
|
|
||||||
/* get info about all interfaces */
|
|
||||||
|
|
||||||
@@ -510,28 +512,45 @@ Address_Scan_Init(void)
|
|
||||||
SNMP_FREE(ifc.ifc_buf);
|
|
||||||
ifr_counter = 0;
|
|
||||||
|
|
||||||
- do
|
|
||||||
- {
|
|
||||||
if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
|
|
||||||
{
|
|
||||||
DEBUGMSGTL(("snmpd", "socket open failure in Address_Scan_Init\n"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
- num_interfaces += 16;
|
|
||||||
|
|
||||||
- ifc.ifc_len = sizeof(struct ifreq) * num_interfaces;
|
|
||||||
- ifc.ifc_buf = (char*) realloc(ifc.ifc_buf, ifc.ifc_len);
|
|
||||||
-
|
|
||||||
- if (ioctl(fd, SIOCGIFCONF, &ifc) < 0)
|
|
||||||
- {
|
|
||||||
- ifr=NULL;
|
|
||||||
- close(fd);
|
|
||||||
- return;
|
|
||||||
- }
|
|
||||||
- close(fd);
|
|
||||||
+ /*
|
|
||||||
+ * Cope with lots of interfaces and brokenness of ioctl SIOCGIFCONF
|
|
||||||
+ * on some platforms; see W. R. Stevens, ``Unix Network Programming
|
|
||||||
+ * Volume I'', p.435...
|
|
||||||
+ */
|
|
||||||
+
|
|
||||||
+ for (i = 8;; i *= 2) {
|
|
||||||
+ ifc.ifc_len = sizeof(struct ifreq) * i;
|
|
||||||
+ ifc.ifc_req = calloc(i, sizeof(struct ifreq));
|
|
||||||
+
|
|
||||||
+ if (ioctl(fd, SIOCGIFCONF, &ifc) < 0) {
|
|
||||||
+ if (errno != EINVAL || lastlen != 0) {
|
|
||||||
+ /*
|
|
||||||
+ * Something has gone genuinely wrong...
|
|
||||||
+ */
|
|
||||||
+ snmp_log(LOG_ERR, "bad rc from ioctl, errno %d", errno);
|
|
||||||
+ SNMP_FREE(ifc.ifc_buf);
|
|
||||||
+ close(fd);
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+ } else {
|
|
||||||
+ if (ifc.ifc_len == lastlen) {
|
|
||||||
+ /*
|
|
||||||
+ * The length is the same as the last time; we're done...
|
|
||||||
+ */
|
|
||||||
+ break;
|
|
||||||
+ }
|
|
||||||
+ lastlen = ifc.ifc_len;
|
|
||||||
+ }
|
|
||||||
+ free(ifc.ifc_buf); /* no SNMP_FREE, getting ready to reassign */
|
|
||||||
}
|
|
||||||
- while (ifc.ifc_len >= (sizeof(struct ifreq) * num_interfaces));
|
|
||||||
-
|
|
||||||
+
|
|
||||||
+ close(fd);
|
|
||||||
ifr = ifc.ifc_req;
|
|
||||||
}
|
|
||||||
|
|
@ -1,36 +0,0 @@
|
|||||||
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 2020-06-10 13:43:18.443070961 +0200
|
|
||||||
+++ b/man/net-snmp-create-v3-user.1.def 2020-06-10 13:49:25.975363441 +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] [-x privpass] [-X DES|AES]
|
|
||||||
+.B net-snmp-create-v3-user [-ro] [-A authpass] [-a MD5|SHA] [-X privpass] [-x DES|AES]
|
|
||||||
.B [username]
|
|
||||||
.SH DESCRIPTION
|
|
||||||
.PP
|
|
||||||
@@ -16,13 +16,16 @@ new user in net-snmp configuration file
|
|
||||||
displays the net-snmp version number
|
|
||||||
.TP
|
|
||||||
\fB\-ro\fR
|
|
||||||
-create an user with read-only permissions
|
|
||||||
+creates a user with read-only permissions
|
|
||||||
.TP
|
|
||||||
-\fB\-a authpass\fR
|
|
||||||
-specify authentication password
|
|
||||||
+\fB\-A authpass\fR
|
|
||||||
+specifies the authentication password
|
|
||||||
.TP
|
|
||||||
-\fB\-x privpass\fR
|
|
||||||
-specify encryption password
|
|
||||||
+\fB\-a MD5|SHA\fR
|
|
||||||
+specifies the authentication password hashing algorithm
|
|
||||||
.TP
|
|
||||||
-\fB\-X DES|AES\fR
|
|
||||||
-specify encryption algorithm
|
|
||||||
+\fB\-X privpass\fR
|
|
||||||
+specifies the encryption password
|
|
||||||
+.TP
|
|
||||||
+\fB\-x DES|AES\fR
|
|
||||||
+specifies the encryption algorithm
|
|
@ -1,83 +0,0 @@
|
|||||||
diff -urNp a/agent/mibgroup/host/data_access/swinst_rpm.c b/agent/mibgroup/host/data_access/swinst_rpm.c
|
|
||||||
--- a/agent/mibgroup/host/data_access/swinst_rpm.c 2018-07-18 16:12:19.583503903 +0200
|
|
||||||
+++ b/agent/mibgroup/host/data_access/swinst_rpm.c 2018-07-18 16:50:38.599703588 +0200
|
|
||||||
@@ -102,7 +102,6 @@ netsnmp_swinst_arch_load( netsnmp_contai
|
|
||||||
rpmtd td_name, td_version, td_release, td_group, td_time;
|
|
||||||
#else
|
|
||||||
char *n, *v, *r, *g;
|
|
||||||
- int32_t *t;
|
|
||||||
#endif
|
|
||||||
time_t install_time;
|
|
||||||
size_t date_len;
|
|
||||||
@@ -146,14 +145,13 @@ netsnmp_swinst_arch_load( netsnmp_contai
|
|
||||||
install_time = rpmtdGetNumber(td_time);
|
|
||||||
g = rpmtdGetString(td_group);
|
|
||||||
#else
|
|
||||||
- headerGetEntry( h, RPMTAG_NAME, NULL, (void**)&n, NULL);
|
|
||||||
- headerGetEntry( h, RPMTAG_VERSION, NULL, (void**)&v, NULL);
|
|
||||||
- headerGetEntry( h, RPMTAG_RELEASE, NULL, (void**)&r, NULL);
|
|
||||||
- headerGetEntry( h, RPMTAG_GROUP, NULL, (void**)&g, NULL);
|
|
||||||
- headerGetEntry( h, RPMTAG_INSTALLTIME, NULL, (void**)&t, NULL);
|
|
||||||
+ n = headerGetString( h, RPMTAG_NAME);
|
|
||||||
+ v = headerGetString( h, RPMTAG_VERSION);
|
|
||||||
+ r = headerGetString( h, RPMTAG_RELEASE);
|
|
||||||
+ g = headerGetString( h, RPMTAG_GROUP);
|
|
||||||
+ install_time = headerGetNumber( h, RPMTAG_INSTALLTIME);
|
|
||||||
entry->swName_len = snprintf( entry->swName, sizeof(entry->swName),
|
|
||||||
"%s-%s-%s", n, v, r);
|
|
||||||
- install_time = *t;
|
|
||||||
#endif
|
|
||||||
entry->swType = (g && NULL != strstr( g, "System Environment"))
|
|
||||||
? 2 /* operatingSystem */
|
|
||||||
diff -urNp a/agent/mibgroup/host/hr_swinst.c b/agent/mibgroup/host/hr_swinst.c
|
|
||||||
--- a/agent/mibgroup/host/hr_swinst.c 2018-07-18 16:12:19.582503907 +0200
|
|
||||||
+++ b/agent/mibgroup/host/hr_swinst.c 2018-07-18 17:09:29.716564197 +0200
|
|
||||||
@@ -479,9 +479,9 @@ var_hrswinst(struct variable * vp,
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
# ifdef HAVE_LIBRPM
|
|
||||||
- char *rpm_groups;
|
|
||||||
- if ( headerGetEntry(swi->swi_h, RPMTAG_GROUP, NULL, (void **) &rpm_groups, NULL) ) {
|
|
||||||
- if ( strstr(rpm_groups, "System Environment") != NULL )
|
|
||||||
+ const char *rpm_group = headerGetString(swi->swi_h, RPMTAG_GROUP);
|
|
||||||
+ if ( NULL != rpm_group ) {
|
|
||||||
+ if ( strstr(rpm_group, "System Environment") != NULL )
|
|
||||||
long_return = 2; /* operatingSystem */
|
|
||||||
else
|
|
||||||
long_return = 4; /* applcation */
|
|
||||||
@@ -498,9 +498,8 @@ var_hrswinst(struct variable * vp,
|
|
||||||
case HRSWINST_DATE:
|
|
||||||
{
|
|
||||||
#ifdef HAVE_LIBRPM
|
|
||||||
- int32_t *rpm_data;
|
|
||||||
- if ( headerGetEntry(swi->swi_h, RPMTAG_INSTALLTIME, NULL, (void **) &rpm_data, NULL) ) {
|
|
||||||
- time_t installTime = *rpm_data;
|
|
||||||
+ time_t installTime = headerGetNumber(swi->swi_h, RPMTAG_INSTALLTIME);
|
|
||||||
+ if ( 0 != installTime ) {
|
|
||||||
ret = date_n_time(&installTime, var_len);
|
|
||||||
} else {
|
|
||||||
ret = date_n_time(NULL, var_len);
|
|
||||||
@@ -660,7 +659,7 @@ Save_HR_SW_info(int ix)
|
|
||||||
if (1 <= ix && ix <= swi->swi_nrec && ix != swi->swi_prevx) {
|
|
||||||
int offset;
|
|
||||||
Header h;
|
|
||||||
- char *n, *v, *r;
|
|
||||||
+ const char *n, *v, *r;
|
|
||||||
|
|
||||||
offset = swi->swi_recs[ix - 1];
|
|
||||||
|
|
||||||
@@ -685,11 +684,9 @@ Save_HR_SW_info(int ix)
|
|
||||||
swi->swi_h = h;
|
|
||||||
swi->swi_prevx = ix;
|
|
||||||
|
|
||||||
- headerGetEntry(swi->swi_h, RPMTAG_NAME, NULL, (void **) &n, NULL);
|
|
||||||
- headerGetEntry(swi->swi_h, RPMTAG_VERSION, NULL, (void **) &v,
|
|
||||||
- NULL);
|
|
||||||
- headerGetEntry(swi->swi_h, RPMTAG_RELEASE, NULL, (void **) &r,
|
|
||||||
- NULL);
|
|
||||||
+ n = headerGetString(swi->swi_h, RPMTAG_NAME);
|
|
||||||
+ v = headerGetString(swi->swi_h, RPMTAG_VERSION);
|
|
||||||
+ r = headerGetString(swi->swi_h, RPMTAG_RELEASE);
|
|
||||||
snprintf(swi->swi_name, sizeof(swi->swi_name), "%s-%s-%s", n, v, r);
|
|
||||||
swi->swi_name[ sizeof(swi->swi_name)-1 ] = 0;
|
|
||||||
}
|
|
@ -1,28 +0,0 @@
|
|||||||
diff --git a/agent/mibgroup/host/data_access/swinst_rpm.c b/agent/mibgroup/host/data_access/swinst_rpm.c
|
|
||||||
index 695c469..dd0e487 100644
|
|
||||||
--- a/agent/mibgroup/host/data_access/swinst_rpm.c
|
|
||||||
+++ b/agent/mibgroup/host/data_access/swinst_rpm.c
|
|
||||||
@@ -75,6 +75,9 @@ netsnmp_swinst_arch_init(void)
|
|
||||||
snprintf( pkg_directory, SNMP_MAXPATH, "%s/Packages", dbpath );
|
|
||||||
SNMP_FREE(rpmdbpath);
|
|
||||||
dbpath = NULL;
|
|
||||||
+#ifdef HAVE_RPMGETPATH
|
|
||||||
+ rpmFreeRpmrc();
|
|
||||||
+#endif
|
|
||||||
if (-1 == stat( pkg_directory, &stat_buf )) {
|
|
||||||
snmp_log(LOG_ERR, "Can't find directory of RPM packages\n");
|
|
||||||
pkg_directory[0] = '\0';
|
|
||||||
diff --git a/agent/mibgroup/host/hr_swinst.c b/agent/mibgroup/host/hr_swinst.c
|
|
||||||
index 1f52733..ccf1cab 100644
|
|
||||||
--- a/agent/mibgroup/host/hr_swinst.c
|
|
||||||
+++ b/agent/mibgroup/host/hr_swinst.c
|
|
||||||
@@ -231,6 +231,9 @@ init_hr_swinst(void)
|
|
||||||
snprintf(path, sizeof(path), "%s/packages.rpm", swi->swi_dbpath);
|
|
||||||
path[ sizeof(path)-1 ] = 0;
|
|
||||||
swi->swi_directory = strdup(path);
|
|
||||||
+#ifdef HAVE_RPMGETPATH
|
|
||||||
+ rpmFreeRpmrc();
|
|
||||||
+#endif
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
# ifdef _PATH_HRSW_directory
|
|
@ -1,18 +0,0 @@
|
|||||||
diff --git a/net-snmp-create-v3-user.in b/net-snmp-create-v3-user.in
|
|
||||||
index afd6fa4..07c26fe 100644
|
|
||||||
--- a/net-snmp-create-v3-user.in
|
|
||||||
+++ b/net-snmp-create-v3-user.in
|
|
||||||
@@ -58,11 +58,11 @@ case $1 in
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
case $1 in
|
|
||||||
- DES|AES|AES128)
|
|
||||||
+ DES|AES|AES128|AES192|AES256)
|
|
||||||
Xalgorithm=$1
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
- des|aes|aes128)
|
|
||||||
+ des|aes|aes128|aes192|aes256)
|
|
||||||
Xalgorithm=$(echo "$1" | tr a-z A-Z)
|
|
||||||
shift
|
|
||||||
;;
|
|
@ -1,12 +0,0 @@
|
|||||||
diff --git a/agent/mibgroup/host/hr_filesys.c b/agent/mibgroup/host/hr_filesys.c
|
|
||||||
index e7ca92f..80b3e0d 100644
|
|
||||||
--- a/agent/mibgroup/host/hr_filesys.c
|
|
||||||
+++ b/agent/mibgroup/host/hr_filesys.c
|
|
||||||
@@ -704,6 +704,7 @@ static const char *HRFS_ignores[] = {
|
|
||||||
"shm",
|
|
||||||
"sockfs",
|
|
||||||
"sysfs",
|
|
||||||
+ "tmpfs",
|
|
||||||
"usbdevfs",
|
|
||||||
"usbfs",
|
|
||||||
#endif
|
|
@ -1,20 +0,0 @@
|
|||||||
diff -urNp a/perl/Makefile.PL b/perl/Makefile.PL
|
|
||||||
--- a/perl/Makefile.PL 2020-08-26 08:32:52.498909823 +0200
|
|
||||||
+++ b/perl/Makefile.PL 2020-08-26 09:30:45.584951552 +0200
|
|
||||||
@@ -1,3 +1,4 @@
|
|
||||||
+use lib '.';
|
|
||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
use ExtUtils::MakeMaker;
|
|
||||||
diff -urNp a/perl/MakefileSubs.pm b/perl/MakefileSubs.pm
|
|
||||||
--- a/perl/MakefileSubs.pm 2020-08-26 08:32:52.498909823 +0200
|
|
||||||
+++ b/perl/MakefileSubs.pm 2020-08-26 08:36:44.097218448 +0200
|
|
||||||
@@ -116,7 +116,7 @@ sub AddCommonParams {
|
|
||||||
append($Params->{'CCFLAGS'}, $cflags);
|
|
||||||
append($Params->{'CCFLAGS'}, $Config{'ccflags'});
|
|
||||||
# Suppress known Perl header shortcomings.
|
|
||||||
- $Params->{'CCFLAGS'} =~ s/ -W(cast-qual|write-strings)//g;
|
|
||||||
+ $Params->{'CCFLAGS'} =~ s/ -W(inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g;
|
|
||||||
append($Params->{'CCFLAGS'}, '-Wformat');
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,22 +0,0 @@
|
|||||||
diff --git a/agent/mibgroup/disman/event/mteTrigger.c b/agent/mibgroup/disman/event/mteTrigger.c
|
|
||||||
index e9a8831..5a1d8e7 100644
|
|
||||||
--- a/agent/mibgroup/disman/event/mteTrigger.c
|
|
||||||
+++ b/agent/mibgroup/disman/event/mteTrigger.c
|
|
||||||
@@ -1012,7 +1012,7 @@ mteTrigger_run( unsigned int reg, void *clientarg)
|
|
||||||
* Similarly, if no fallEvent is configured,
|
|
||||||
* there's no point in trying to fire it either.
|
|
||||||
*/
|
|
||||||
- if (entry->mteTThRiseEvent[0] != '\0' ) {
|
|
||||||
+ if (entry->mteTThFallEvent[0] != '\0' ) {
|
|
||||||
entry->mteTriggerXOwner = entry->mteTThObjOwner;
|
|
||||||
entry->mteTriggerXObjects = entry->mteTThObjects;
|
|
||||||
entry->mteTriggerFired = vp1;
|
|
||||||
@@ -1105,7 +1105,7 @@ mteTrigger_run( unsigned int reg, void *clientarg)
|
|
||||||
* Similarly, if no fallEvent is configured,
|
|
||||||
* there's no point in trying to fire it either.
|
|
||||||
*/
|
|
||||||
- if (entry->mteTThDRiseEvent[0] != '\0' ) {
|
|
||||||
+ if (entry->mteTThDFallEvent[0] != '\0' ) {
|
|
||||||
entry->mteTriggerXOwner = entry->mteTThObjOwner;
|
|
||||||
entry->mteTriggerXObjects = entry->mteTThObjects;
|
|
||||||
entry->mteTriggerFired = vp1;
|
|
@ -1,30 +0,0 @@
|
|||||||
diff --git a/net-snmp-create-v3-user.in b/net-snmp-create-v3-user.in
|
|
||||||
index 19895a1..ac3c60f 100644
|
|
||||||
--- a/net-snmp-create-v3-user.in
|
|
||||||
+++ b/net-snmp-create-v3-user.in
|
|
||||||
@@ -14,6 +14,10 @@ Xalgorithm="DES"
|
|
||||||
token=rwuser
|
|
||||||
|
|
||||||
while test "x$done" = "x" -a "x$1" != "x" -a "x$usage" != "xyes"; do
|
|
||||||
+case "$1" in
|
|
||||||
+ -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
|
|
||||||
+ *) optarg= ;;
|
|
||||||
+esac
|
|
||||||
|
|
||||||
unset shifted
|
|
||||||
case $1 in
|
|
||||||
@@ -134,11 +138,9 @@ if test ! -d "$outfile"; then
|
|
||||||
touch "$outfile"
|
|
||||||
fi
|
|
||||||
echo "$line" >> "$outfile"
|
|
||||||
-prefix=@prefix@
|
|
||||||
-datarootdir=@datarootdir@
|
|
||||||
-# To suppress shellcheck complaints about $prefix and $datarootdir.
|
|
||||||
-: "$prefix" "$datarootdir"
|
|
||||||
-outfile="@datadir@/snmp/snmpd.conf"
|
|
||||||
+# Avoid that configure complains that this script ignores @datarootdir@
|
|
||||||
+echo "@datarootdir@" >/dev/null
|
|
||||||
+outfile="/etc/snmp/snmpd.conf"
|
|
||||||
line="$token $user"
|
|
||||||
echo "adding the following line to $outfile:"
|
|
||||||
echo " $line"
|
|
@ -1,855 +0,0 @@
|
|||||||
diff --git a/include/net-snmp/library/cert_util.h b/include/net-snmp/library/cert_util.h
|
|
||||||
index 80e2a19..143adbb 100644
|
|
||||||
--- a/include/net-snmp/library/cert_util.h
|
|
||||||
+++ b/include/net-snmp/library/cert_util.h
|
|
||||||
@@ -55,7 +55,8 @@ extern "C" {
|
|
||||||
char *common_name;
|
|
||||||
|
|
||||||
u_char hash_type;
|
|
||||||
- u_char _pad[3]; /* for future use */
|
|
||||||
+ u_char _pad[1]; /* for future use */
|
|
||||||
+ u_short offset;
|
|
||||||
} netsnmp_cert;
|
|
||||||
|
|
||||||
/** types */
|
|
||||||
@@ -100,6 +101,7 @@ extern "C" {
|
|
||||||
|
|
||||||
NETSNMP_IMPORT
|
|
||||||
netsnmp_cert *netsnmp_cert_find(int what, int where, void *hint);
|
|
||||||
+ netsnmp_void_array *netsnmp_certs_find(int what, int where, void *hint);
|
|
||||||
|
|
||||||
int netsnmp_cert_check_vb_fingerprint(const netsnmp_variable_list *var);
|
|
||||||
|
|
||||||
diff --git a/include/net-snmp/library/dir_utils.h b/include/net-snmp/library/dir_utils.h
|
|
||||||
index 471bb0b..ac7f69a 100644
|
|
||||||
--- a/include/net-snmp/library/dir_utils.h
|
|
||||||
+++ b/include/net-snmp/library/dir_utils.h
|
|
||||||
@@ -53,7 +53,8 @@ extern "C" {
|
|
||||||
#define NETSNMP_DIR_NSFILE 0x0010
|
|
||||||
/** load stats in netsnmp_file */
|
|
||||||
#define NETSNMP_DIR_NSFILE_STATS 0x0020
|
|
||||||
-
|
|
||||||
+/** allow files to be indexed more than once */
|
|
||||||
+#define NETSNMP_DIR_ALLOW_DUPLICATES 0x0040
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
diff --git a/snmplib/cert_util.c b/snmplib/cert_util.c
|
|
||||||
index 210ad8b..b1f8144 100644
|
|
||||||
--- a/snmplib/cert_util.c
|
|
||||||
+++ b/snmplib/cert_util.c
|
|
||||||
@@ -100,7 +100,7 @@ netsnmp_feature_child_of(tls_fingerprint_build, cert_util_all);
|
|
||||||
* bump this value whenever cert index format changes, so indexes
|
|
||||||
* will be regenerated with new format.
|
|
||||||
*/
|
|
||||||
-#define CERT_INDEX_FORMAT 1
|
|
||||||
+#define CERT_INDEX_FORMAT 2
|
|
||||||
|
|
||||||
static netsnmp_container *_certs = NULL;
|
|
||||||
static netsnmp_container *_keys = NULL;
|
|
||||||
@@ -126,6 +126,8 @@ static int _cert_fn_ncompare(netsnmp_cert_common *lhs,
|
|
||||||
netsnmp_cert_common *rhs);
|
|
||||||
static void _find_partner(netsnmp_cert *cert, netsnmp_key *key);
|
|
||||||
static netsnmp_cert *_find_issuer(netsnmp_cert *cert);
|
|
||||||
+static netsnmp_void_array *_cert_reduce_subset_first(netsnmp_void_array *matching);
|
|
||||||
+static netsnmp_void_array *_cert_reduce_subset_what(netsnmp_void_array *matching, int what);
|
|
||||||
static netsnmp_void_array *_cert_find_subset_fn(const char *filename,
|
|
||||||
const char *directory);
|
|
||||||
static netsnmp_void_array *_cert_find_subset_sn(const char *subject);
|
|
||||||
@@ -345,6 +347,8 @@ _get_cert_container(const char *use)
|
|
||||||
{
|
|
||||||
netsnmp_container *c;
|
|
||||||
|
|
||||||
+ int rc;
|
|
||||||
+
|
|
||||||
c = netsnmp_container_find("certs:binary_array");
|
|
||||||
if (NULL == c) {
|
|
||||||
snmp_log(LOG_ERR, "could not create container for %s\n", use);
|
|
||||||
@@ -354,6 +358,8 @@ _get_cert_container(const char *use)
|
|
||||||
c->free_item = (netsnmp_container_obj_func*)_cert_free;
|
|
||||||
c->compare = (netsnmp_container_compare*)_cert_compare;
|
|
||||||
|
|
||||||
+ CONTAINER_SET_OPTIONS(c, CONTAINER_KEY_ALLOW_DUPLICATES, rc);
|
|
||||||
+
|
|
||||||
return c;
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -362,6 +368,8 @@ _setup_containers(void)
|
|
||||||
{
|
|
||||||
netsnmp_container *additional_keys;
|
|
||||||
|
|
||||||
+ int rc;
|
|
||||||
+
|
|
||||||
_certs = _get_cert_container("netsnmp certificates");
|
|
||||||
if (NULL == _certs)
|
|
||||||
return;
|
|
||||||
@@ -376,6 +384,7 @@ _setup_containers(void)
|
|
||||||
additional_keys->container_name = strdup("certs_cn");
|
|
||||||
additional_keys->free_item = NULL;
|
|
||||||
additional_keys->compare = (netsnmp_container_compare*)_cert_cn_compare;
|
|
||||||
+ CONTAINER_SET_OPTIONS(additional_keys, CONTAINER_KEY_ALLOW_DUPLICATES, rc);
|
|
||||||
netsnmp_container_add_index(_certs, additional_keys);
|
|
||||||
|
|
||||||
/** additional keys: subject name */
|
|
||||||
@@ -389,6 +398,7 @@ _setup_containers(void)
|
|
||||||
additional_keys->free_item = NULL;
|
|
||||||
additional_keys->compare = (netsnmp_container_compare*)_cert_sn_compare;
|
|
||||||
additional_keys->ncompare = (netsnmp_container_compare*)_cert_sn_ncompare;
|
|
||||||
+ CONTAINER_SET_OPTIONS(additional_keys, CONTAINER_KEY_ALLOW_DUPLICATES, rc);
|
|
||||||
netsnmp_container_add_index(_certs, additional_keys);
|
|
||||||
|
|
||||||
/** additional keys: file name */
|
|
||||||
@@ -402,6 +412,7 @@ _setup_containers(void)
|
|
||||||
additional_keys->free_item = NULL;
|
|
||||||
additional_keys->compare = (netsnmp_container_compare*)_cert_fn_compare;
|
|
||||||
additional_keys->ncompare = (netsnmp_container_compare*)_cert_fn_ncompare;
|
|
||||||
+ CONTAINER_SET_OPTIONS(additional_keys, CONTAINER_KEY_ALLOW_DUPLICATES, rc);
|
|
||||||
netsnmp_container_add_index(_certs, additional_keys);
|
|
||||||
|
|
||||||
_keys = netsnmp_container_find("cert_keys:binary_array");
|
|
||||||
@@ -424,7 +435,7 @@ netsnmp_cert_map_container(void)
|
|
||||||
}
|
|
||||||
|
|
||||||
static netsnmp_cert *
|
|
||||||
-_new_cert(const char *dirname, const char *filename, int certType,
|
|
||||||
+_new_cert(const char *dirname, const char *filename, int certType, int offset,
|
|
||||||
int hashType, const char *fingerprint, const char *common_name,
|
|
||||||
const char *subject)
|
|
||||||
{
|
|
||||||
@@ -446,8 +457,10 @@ _new_cert(const char *dirname, const char *filename, int certType,
|
|
||||||
|
|
||||||
cert->info.dir = strdup(dirname);
|
|
||||||
cert->info.filename = strdup(filename);
|
|
||||||
- cert->info.allowed_uses = NS_CERT_REMOTE_PEER;
|
|
||||||
+ /* only the first certificate is allowed to be a remote peer */
|
|
||||||
+ cert->info.allowed_uses = offset ? 0 : NS_CERT_REMOTE_PEER;
|
|
||||||
cert->info.type = certType;
|
|
||||||
+ cert->offset = offset;
|
|
||||||
if (fingerprint) {
|
|
||||||
cert->hash_type = hashType;
|
|
||||||
cert->fingerprint = strdup(fingerprint);
|
|
||||||
@@ -884,14 +897,86 @@ _certindex_new( const char *dirname )
|
|
||||||
* certificate utility functions
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
+static BIO *
|
|
||||||
+netsnmp_open_bio(const char *dir, const char *filename)
|
|
||||||
+{
|
|
||||||
+ BIO *certbio;
|
|
||||||
+ char file[SNMP_MAXPATH];
|
|
||||||
+
|
|
||||||
+ DEBUGMSGT(("9:cert:read", "Checking file %s\n", filename));
|
|
||||||
+
|
|
||||||
+ certbio = BIO_new(BIO_s_file());
|
|
||||||
+ if (NULL == certbio) {
|
|
||||||
+ snmp_log(LOG_ERR, "error creating BIO\n");
|
|
||||||
+ return NULL;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ snprintf(file, sizeof(file),"%s/%s", dir, filename);
|
|
||||||
+ if (BIO_read_filename(certbio, file) <=0) {
|
|
||||||
+ snmp_log(LOG_ERR, "error reading certificate/key %s into BIO\n", file);
|
|
||||||
+ BIO_vfree(certbio);
|
|
||||||
+ return NULL;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ return certbio;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static void
|
|
||||||
+netsnmp_ocert_parse(netsnmp_cert *cert, X509 *ocert)
|
|
||||||
+{
|
|
||||||
+ int is_ca;
|
|
||||||
+
|
|
||||||
+ cert->ocert = ocert;
|
|
||||||
+
|
|
||||||
+ /*
|
|
||||||
+ * X509_check_ca return codes:
|
|
||||||
+ * 0 not a CA
|
|
||||||
+ * 1 is a CA
|
|
||||||
+ * 2 basicConstraints absent so "maybe" a CA
|
|
||||||
+ * 3 basicConstraints absent but self signed V1.
|
|
||||||
+ * 4 basicConstraints absent but keyUsage present and keyCertSign asserted.
|
|
||||||
+ * 5 outdated Netscape Certificate Type CA extension.
|
|
||||||
+ */
|
|
||||||
+ is_ca = X509_check_ca(ocert);
|
|
||||||
+ if (1 == is_ca)
|
|
||||||
+ cert->info.allowed_uses |= NS_CERT_CA;
|
|
||||||
+
|
|
||||||
+ if (NULL == cert->subject) {
|
|
||||||
+ cert->subject = X509_NAME_oneline(X509_get_subject_name(ocert), NULL,
|
|
||||||
+ 0);
|
|
||||||
+ DEBUGMSGT(("9:cert:add:subject", "subject name: %s\n", cert->subject));
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (NULL == cert->issuer) {
|
|
||||||
+ cert->issuer = X509_NAME_oneline(X509_get_issuer_name(ocert), NULL, 0);
|
|
||||||
+ if (strcmp(cert->subject, cert->issuer) == 0) {
|
|
||||||
+ free(cert->issuer);
|
|
||||||
+ cert->issuer = strdup("self-signed");
|
|
||||||
+ }
|
|
||||||
+ DEBUGMSGT(("9:cert:add:issuer", "CA issuer: %s\n", cert->issuer));
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (NULL == cert->fingerprint) {
|
|
||||||
+ cert->hash_type = netsnmp_openssl_cert_get_hash_type(ocert);
|
|
||||||
+ cert->fingerprint =
|
|
||||||
+ netsnmp_openssl_cert_get_fingerprint(ocert, cert->hash_type);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (NULL == cert->common_name) {
|
|
||||||
+ cert->common_name =netsnmp_openssl_cert_get_commonName(ocert, NULL,
|
|
||||||
+ NULL);
|
|
||||||
+ DEBUGMSGT(("9:cert:add:name","%s\n", cert->common_name));
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
static X509 *
|
|
||||||
netsnmp_ocert_get(netsnmp_cert *cert)
|
|
||||||
{
|
|
||||||
BIO *certbio;
|
|
||||||
X509 *ocert = NULL;
|
|
||||||
+ X509 *ncert = NULL;
|
|
||||||
EVP_PKEY *okey = NULL;
|
|
||||||
- char file[SNMP_MAXPATH];
|
|
||||||
- int is_ca;
|
|
||||||
|
|
||||||
if (NULL == cert)
|
|
||||||
return NULL;
|
|
||||||
@@ -908,51 +993,33 @@ netsnmp_ocert_get(netsnmp_cert *cert)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- DEBUGMSGT(("9:cert:read", "Checking file %s\n", cert->info.filename));
|
|
||||||
-
|
|
||||||
- certbio = BIO_new(BIO_s_file());
|
|
||||||
- if (NULL == certbio) {
|
|
||||||
- snmp_log(LOG_ERR, "error creating BIO\n");
|
|
||||||
- return NULL;
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- snprintf(file, sizeof(file),"%s/%s", cert->info.dir, cert->info.filename);
|
|
||||||
- if (BIO_read_filename(certbio, file) <=0) {
|
|
||||||
- snmp_log(LOG_ERR, "error reading certificate %s into BIO\n", file);
|
|
||||||
- BIO_vfree(certbio);
|
|
||||||
+ certbio = netsnmp_open_bio(cert->info.dir, cert->info.filename);
|
|
||||||
+ if (!certbio) {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
- if (NS_CERT_TYPE_UNKNOWN == cert->info.type) {
|
|
||||||
- char *pos = strrchr(cert->info.filename, '.');
|
|
||||||
- if (NULL == pos)
|
|
||||||
- return NULL;
|
|
||||||
- cert->info.type = _cert_ext_type(++pos);
|
|
||||||
- netsnmp_assert(cert->info.type != NS_CERT_TYPE_UNKNOWN);
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
switch (cert->info.type) {
|
|
||||||
|
|
||||||
case NS_CERT_TYPE_DER:
|
|
||||||
+ (void)BIO_seek(certbio, cert->offset);
|
|
||||||
ocert = d2i_X509_bio(certbio,NULL); /* DER/ASN1 */
|
|
||||||
if (NULL != ocert)
|
|
||||||
break;
|
|
||||||
- (void)BIO_reset(certbio);
|
|
||||||
/* Check for PEM if DER didn't work */
|
|
||||||
/* FALLTHROUGH */
|
|
||||||
|
|
||||||
case NS_CERT_TYPE_PEM:
|
|
||||||
- ocert = PEM_read_bio_X509_AUX(certbio, NULL, NULL, NULL);
|
|
||||||
+ (void)BIO_seek(certbio, cert->offset);
|
|
||||||
+ ocert = ncert = PEM_read_bio_X509_AUX(certbio, NULL, NULL, NULL);
|
|
||||||
if (NULL == ocert)
|
|
||||||
break;
|
|
||||||
if (NS_CERT_TYPE_DER == cert->info.type) {
|
|
||||||
DEBUGMSGT(("9:cert:read", "Changing type from DER to PEM\n"));
|
|
||||||
cert->info.type = NS_CERT_TYPE_PEM;
|
|
||||||
}
|
|
||||||
- /** check for private key too */
|
|
||||||
- if (NULL == cert->key) {
|
|
||||||
- (void)BIO_reset(certbio);
|
|
||||||
- okey = PEM_read_bio_PrivateKey(certbio, NULL, NULL, NULL);
|
|
||||||
+ /** check for private key too, but only if we're the first certificate */
|
|
||||||
+ if (0 == cert->offset && NULL == cert->key) {
|
|
||||||
+ okey = PEM_read_bio_PrivateKey(certbio, NULL, NULL, NULL);
|
|
||||||
if (NULL != okey) {
|
|
||||||
netsnmp_key *key;
|
|
||||||
DEBUGMSGT(("cert:read:key", "found key with cert in %s\n",
|
|
||||||
@@ -979,7 +1046,7 @@ netsnmp_ocert_get(netsnmp_cert *cert)
|
|
||||||
break;
|
|
||||||
#ifdef CERT_PKCS12_SUPPORT_MAYBE_LATER
|
|
||||||
case NS_CERT_TYPE_PKCS12:
|
|
||||||
- (void)BIO_reset(certbio);
|
|
||||||
+ (void)BIO_seek(certbio, cert->offset);
|
|
||||||
PKCS12 *p12 = d2i_PKCS12_bio(certbio, NULL);
|
|
||||||
if ( (NULL != p12) && (PKCS12_verify_mac(p12, "", 0) ||
|
|
||||||
PKCS12_verify_mac(p12, NULL, 0)))
|
|
||||||
@@ -999,46 +1066,7 @@ netsnmp_ocert_get(netsnmp_cert *cert)
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
- cert->ocert = ocert;
|
|
||||||
- /*
|
|
||||||
- * X509_check_ca return codes:
|
|
||||||
- * 0 not a CA
|
|
||||||
- * 1 is a CA
|
|
||||||
- * 2 basicConstraints absent so "maybe" a CA
|
|
||||||
- * 3 basicConstraints absent but self signed V1.
|
|
||||||
- * 4 basicConstraints absent but keyUsage present and keyCertSign asserted.
|
|
||||||
- * 5 outdated Netscape Certificate Type CA extension.
|
|
||||||
- */
|
|
||||||
- is_ca = X509_check_ca(ocert);
|
|
||||||
- if (1 == is_ca)
|
|
||||||
- cert->info.allowed_uses |= NS_CERT_CA;
|
|
||||||
-
|
|
||||||
- if (NULL == cert->subject) {
|
|
||||||
- cert->subject = X509_NAME_oneline(X509_get_subject_name(ocert), NULL,
|
|
||||||
- 0);
|
|
||||||
- DEBUGMSGT(("9:cert:add:subject", "subject name: %s\n", cert->subject));
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- if (NULL == cert->issuer) {
|
|
||||||
- cert->issuer = X509_NAME_oneline(X509_get_issuer_name(ocert), NULL, 0);
|
|
||||||
- if (strcmp(cert->subject, cert->issuer) == 0) {
|
|
||||||
- free(cert->issuer);
|
|
||||||
- cert->issuer = strdup("self-signed");
|
|
||||||
- }
|
|
||||||
- DEBUGMSGT(("9:cert:add:issuer", "CA issuer: %s\n", cert->issuer));
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- if (NULL == cert->fingerprint) {
|
|
||||||
- cert->hash_type = netsnmp_openssl_cert_get_hash_type(ocert);
|
|
||||||
- cert->fingerprint =
|
|
||||||
- netsnmp_openssl_cert_get_fingerprint(ocert, cert->hash_type);
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- if (NULL == cert->common_name) {
|
|
||||||
- cert->common_name =netsnmp_openssl_cert_get_commonName(ocert, NULL,
|
|
||||||
- NULL);
|
|
||||||
- DEBUGMSGT(("9:cert:add:name","%s\n", cert->common_name));
|
|
||||||
- }
|
|
||||||
+ netsnmp_ocert_parse(cert, ocert);
|
|
||||||
|
|
||||||
return ocert;
|
|
||||||
}
|
|
||||||
@@ -1048,7 +1076,6 @@ netsnmp_okey_get(netsnmp_key *key)
|
|
||||||
{
|
|
||||||
BIO *keybio;
|
|
||||||
EVP_PKEY *okey;
|
|
||||||
- char file[SNMP_MAXPATH];
|
|
||||||
|
|
||||||
if (NULL == key)
|
|
||||||
return NULL;
|
|
||||||
@@ -1056,19 +1083,8 @@ netsnmp_okey_get(netsnmp_key *key)
|
|
||||||
if (key->okey)
|
|
||||||
return key->okey;
|
|
||||||
|
|
||||||
- snprintf(file, sizeof(file),"%s/%s", key->info.dir, key->info.filename);
|
|
||||||
- DEBUGMSGT(("cert:key:read", "Checking file %s\n", key->info.filename));
|
|
||||||
-
|
|
||||||
- keybio = BIO_new(BIO_s_file());
|
|
||||||
- if (NULL == keybio) {
|
|
||||||
- snmp_log(LOG_ERR, "error creating BIO\n");
|
|
||||||
- return NULL;
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- if (BIO_read_filename(keybio, file) <=0) {
|
|
||||||
- snmp_log(LOG_ERR, "error reading certificate %s into BIO\n",
|
|
||||||
- key->info.filename);
|
|
||||||
- BIO_vfree(keybio);
|
|
||||||
+ keybio = netsnmp_open_bio(key->info.dir, key->info.filename);
|
|
||||||
+ if (!keybio) {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1154,7 +1170,7 @@ netsnmp_cert_load_x509(netsnmp_cert *cert)
|
|
||||||
cert->issuer_cert = _find_issuer(cert);
|
|
||||||
if (NULL == cert->issuer_cert) {
|
|
||||||
DEBUGMSGT(("cert:load:warn",
|
|
||||||
- "couldn't load CA chain for cert %s\n",
|
|
||||||
+ "couldn't load full CA chain for cert %s\n",
|
|
||||||
cert->info.filename));
|
|
||||||
rc = CERT_LOAD_PARTIAL;
|
|
||||||
break;
|
|
||||||
@@ -1163,7 +1179,7 @@ netsnmp_cert_load_x509(netsnmp_cert *cert)
|
|
||||||
/** get issuer ocert */
|
|
||||||
if ((NULL == cert->issuer_cert->ocert) &&
|
|
||||||
(netsnmp_ocert_get(cert->issuer_cert) == NULL)) {
|
|
||||||
- DEBUGMSGT(("cert:load:warn", "couldn't load cert chain for %s\n",
|
|
||||||
+ DEBUGMSGT(("cert:load:warn", "couldn't load full cert chain for %s\n",
|
|
||||||
cert->info.filename));
|
|
||||||
rc = CERT_LOAD_PARTIAL;
|
|
||||||
break;
|
|
||||||
@@ -1184,7 +1200,7 @@ _find_partner(netsnmp_cert *cert, netsnmp_key *key)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
- if(key) {
|
|
||||||
+ if (key) {
|
|
||||||
if (key->cert) {
|
|
||||||
DEBUGMSGT(("cert:partner", "key already has partner\n"));
|
|
||||||
return;
|
|
||||||
@@ -1197,7 +1213,8 @@ _find_partner(netsnmp_cert *cert, netsnmp_key *key)
|
|
||||||
return;
|
|
||||||
*pos = 0;
|
|
||||||
|
|
||||||
- matching = _cert_find_subset_fn( filename, key->info.dir );
|
|
||||||
+ matching = _cert_reduce_subset_first(_cert_find_subset_fn( filename,
|
|
||||||
+ key->info.dir ));
|
|
||||||
if (!matching)
|
|
||||||
return;
|
|
||||||
if (1 == matching->size) {
|
|
||||||
@@ -1217,7 +1234,7 @@ _find_partner(netsnmp_cert *cert, netsnmp_key *key)
|
|
||||||
DEBUGMSGT(("cert:partner", "%s matches multiple certs\n",
|
|
||||||
key->info.filename));
|
|
||||||
}
|
|
||||||
- else if(cert) {
|
|
||||||
+ else if (cert) {
|
|
||||||
if (cert->key) {
|
|
||||||
DEBUGMSGT(("cert:partner", "cert already has partner\n"));
|
|
||||||
return;
|
|
||||||
@@ -1255,76 +1272,182 @@ _find_partner(netsnmp_cert *cert, netsnmp_key *key)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+static netsnmp_key *
|
|
||||||
+_add_key(EVP_PKEY *okey, const char* dirname, const char* filename, FILE *index)
|
|
||||||
+{
|
|
||||||
+ netsnmp_key *key;
|
|
||||||
+
|
|
||||||
+ key = _new_key(dirname, filename);
|
|
||||||
+ if (NULL == key) {
|
|
||||||
+ return NULL;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ key->okey = okey;
|
|
||||||
+
|
|
||||||
+ if (-1 == CONTAINER_INSERT(_keys, key)) {
|
|
||||||
+ DEBUGMSGT(("cert:key:file:add:err",
|
|
||||||
+ "error inserting key into container\n"));
|
|
||||||
+ netsnmp_key_free(key);
|
|
||||||
+ key = NULL;
|
|
||||||
+ }
|
|
||||||
+ if (index) {
|
|
||||||
+ fprintf(index, "k:%s\n", filename);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ return key;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static netsnmp_cert *
|
|
||||||
+_add_cert(X509 *ocert, const char* dirname, const char* filename, int type, int offset, FILE *index)
|
|
||||||
+{
|
|
||||||
+ netsnmp_cert *cert;
|
|
||||||
+
|
|
||||||
+ cert = _new_cert(dirname, filename, type, offset, -1, NULL, NULL, NULL);
|
|
||||||
+ if (NULL == cert)
|
|
||||||
+ return NULL;
|
|
||||||
+
|
|
||||||
+ netsnmp_ocert_parse(cert, ocert);
|
|
||||||
+
|
|
||||||
+ if (-1 == CONTAINER_INSERT(_certs, cert)) {
|
|
||||||
+ DEBUGMSGT(("cert:file:add:err",
|
|
||||||
+ "error inserting cert into container\n"));
|
|
||||||
+ netsnmp_cert_free(cert);
|
|
||||||
+ return NULL;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (index) {
|
|
||||||
+ /** filename = NAME_MAX = 255 */
|
|
||||||
+ /** fingerprint max = 64*3=192 for sha512 */
|
|
||||||
+ /** common name / CN = 64 */
|
|
||||||
+ if (cert)
|
|
||||||
+ fprintf(index, "c:%s %d %d %d %s '%s' '%s'\n", filename,
|
|
||||||
+ cert->info.type, cert->offset, cert->hash_type, cert->fingerprint,
|
|
||||||
+ cert->common_name, cert->subject);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ return cert;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
static int
|
|
||||||
_add_certfile(const char* dirname, const char* filename, FILE *index)
|
|
||||||
{
|
|
||||||
- X509 *ocert;
|
|
||||||
- EVP_PKEY *okey;
|
|
||||||
+ BIO *certbio;
|
|
||||||
+ X509 *ocert = NULL;
|
|
||||||
+ X509 *ncert;
|
|
||||||
+ EVP_PKEY *okey = NULL;
|
|
||||||
netsnmp_cert *cert = NULL;
|
|
||||||
netsnmp_key *key = NULL;
|
|
||||||
char certfile[SNMP_MAXPATH];
|
|
||||||
int type;
|
|
||||||
+ int offset = 0;
|
|
||||||
|
|
||||||
if (((const void*)NULL == dirname) || (NULL == filename))
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
type = _type_from_filename(filename);
|
|
||||||
- netsnmp_assert(type != NS_CERT_TYPE_UNKNOWN);
|
|
||||||
+ if (type == NS_CERT_TYPE_UNKNOWN) {
|
|
||||||
+ snmp_log(LOG_ERR, "certificate file '%s' type not recognised, ignoring\n", filename);
|
|
||||||
+ return -1;
|
|
||||||
+ }
|
|
||||||
|
|
||||||
- snprintf(certfile, sizeof(certfile),"%s/%s", dirname, filename);
|
|
||||||
+ certbio = netsnmp_open_bio(dirname, filename);
|
|
||||||
+ if (!certbio) {
|
|
||||||
+ return -1;
|
|
||||||
+ }
|
|
||||||
|
|
||||||
- DEBUGMSGT(("9:cert:file:add", "Checking file: %s (type %d)\n", filename,
|
|
||||||
- type));
|
|
||||||
+ switch (type) {
|
|
||||||
|
|
||||||
- if (NS_CERT_TYPE_KEY == type) {
|
|
||||||
- key = _new_key(dirname, filename);
|
|
||||||
- if (NULL == key)
|
|
||||||
- return -1;
|
|
||||||
- okey = netsnmp_okey_get(key);
|
|
||||||
- if (NULL == okey) {
|
|
||||||
- netsnmp_key_free(key);
|
|
||||||
- return -1;
|
|
||||||
- }
|
|
||||||
- key->okey = okey;
|
|
||||||
- if (-1 == CONTAINER_INSERT(_keys, key)) {
|
|
||||||
- DEBUGMSGT(("cert:key:file:add:err",
|
|
||||||
- "error inserting key into container\n"));
|
|
||||||
- netsnmp_key_free(key);
|
|
||||||
- key = NULL;
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
- else {
|
|
||||||
- cert = _new_cert(dirname, filename, type, -1, NULL, NULL, NULL);
|
|
||||||
- if (NULL == cert)
|
|
||||||
- return -1;
|
|
||||||
- ocert = netsnmp_ocert_get(cert);
|
|
||||||
- if (NULL == ocert) {
|
|
||||||
- netsnmp_cert_free(cert);
|
|
||||||
- return -1;
|
|
||||||
- }
|
|
||||||
- cert->ocert = ocert;
|
|
||||||
- if (-1 == CONTAINER_INSERT(_certs, cert)) {
|
|
||||||
- DEBUGMSGT(("cert:file:add:err",
|
|
||||||
- "error inserting cert into container\n"));
|
|
||||||
- netsnmp_cert_free(cert);
|
|
||||||
- cert = NULL;
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
- if ((NULL == cert) && (NULL == key)) {
|
|
||||||
- DEBUGMSGT(("cert:file:add:failure", "for %s\n", certfile));
|
|
||||||
- return -1;
|
|
||||||
+ case NS_CERT_TYPE_KEY:
|
|
||||||
+
|
|
||||||
+ okey = PEM_read_bio_PrivateKey(certbio, NULL, NULL, NULL);
|
|
||||||
+ if (NULL == okey)
|
|
||||||
+ snmp_log(LOG_ERR, "error parsing key file %s\n",
|
|
||||||
+ key->info.filename);
|
|
||||||
+ else {
|
|
||||||
+ key = _add_key(okey, dirname, filename, index);
|
|
||||||
+ if (NULL == key) {
|
|
||||||
+ EVP_PKEY_free(okey);
|
|
||||||
+ okey = NULL;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ break;
|
|
||||||
+
|
|
||||||
+ case NS_CERT_TYPE_DER:
|
|
||||||
+
|
|
||||||
+ ocert = d2i_X509_bio(certbio, NULL); /* DER/ASN1 */
|
|
||||||
+ if (NULL != ocert) {
|
|
||||||
+ if (!_add_cert(ocert, dirname, filename, type, 0, index)) {
|
|
||||||
+ X509_free(ocert);
|
|
||||||
+ ocert = NULL;
|
|
||||||
+ }
|
|
||||||
+ break;
|
|
||||||
+ }
|
|
||||||
+ (void)BIO_reset(certbio);
|
|
||||||
+ /* Check for PEM if DER didn't work */
|
|
||||||
+ /* FALLTHROUGH */
|
|
||||||
+
|
|
||||||
+ case NS_CERT_TYPE_PEM:
|
|
||||||
+
|
|
||||||
+ if (NS_CERT_TYPE_DER == type) {
|
|
||||||
+ DEBUGMSGT(("9:cert:read", "Changing type from DER to PEM\n"));
|
|
||||||
+ type = NS_CERT_TYPE_PEM;
|
|
||||||
+ }
|
|
||||||
+ ocert = ncert = PEM_read_bio_X509_AUX(certbio, NULL, NULL, NULL);
|
|
||||||
+ if (NULL != ocert) {
|
|
||||||
+ cert = _add_cert(ncert, dirname, filename, type, offset, index);
|
|
||||||
+ if (NULL == cert) {
|
|
||||||
+ X509_free(ocert);
|
|
||||||
+ ocert = ncert = NULL;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ while (NULL != ncert) {
|
|
||||||
+ offset = BIO_tell(certbio);
|
|
||||||
+ ncert = PEM_read_bio_X509_AUX(certbio, NULL, NULL, NULL);
|
|
||||||
+ if (ncert) {
|
|
||||||
+ if (NULL == _add_cert(ncert, dirname, filename, type, offset, index)) {
|
|
||||||
+ X509_free(ncert);
|
|
||||||
+ ncert = NULL;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ BIO_seek(certbio, offset);
|
|
||||||
+
|
|
||||||
+ /** check for private key too */
|
|
||||||
+ okey = PEM_read_bio_PrivateKey(certbio, NULL, NULL, NULL);
|
|
||||||
+
|
|
||||||
+ if (NULL != okey) {
|
|
||||||
+ DEBUGMSGT(("cert:read:key", "found key with cert in %s\n",
|
|
||||||
+ cert->info.filename));
|
|
||||||
+ key = _add_key(okey, dirname, filename, NULL);
|
|
||||||
+ if (NULL != key) {
|
|
||||||
+ DEBUGMSGT(("cert:read:partner", "%s match found!\n",
|
|
||||||
+ cert->info.filename));
|
|
||||||
+ key->cert = cert;
|
|
||||||
+ cert->key = key;
|
|
||||||
+ cert->info.allowed_uses |= NS_CERT_IDENTITY;
|
|
||||||
+ }
|
|
||||||
+ else {
|
|
||||||
+ EVP_PKEY_free(okey);
|
|
||||||
+ okey = NULL;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ break;
|
|
||||||
+
|
|
||||||
+#ifdef CERT_PKCS12_SUPPORT_MAYBE_LATER
|
|
||||||
+ case NS_CERT_TYPE_PKCS12:
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
+ default:
|
|
||||||
+ break;
|
|
||||||
}
|
|
||||||
|
|
||||||
- if (index) {
|
|
||||||
- /** filename = NAME_MAX = 255 */
|
|
||||||
- /** fingerprint max = 64*3=192 for sha512 */
|
|
||||||
- /** common name / CN = 64 */
|
|
||||||
- if (cert)
|
|
||||||
- fprintf(index, "c:%s %d %d %s '%s' '%s'\n", filename,
|
|
||||||
- cert->info.type, cert->hash_type, cert->fingerprint,
|
|
||||||
- cert->common_name, cert->subject);
|
|
||||||
- else if (key)
|
|
||||||
- fprintf(index, "k:%s\n", filename);
|
|
||||||
+ BIO_vfree(certbio);
|
|
||||||
+
|
|
||||||
+ if ((NULL == ocert) && (NULL == okey)) {
|
|
||||||
+ snmp_log(LOG_ERR, "certificate file '%s' contained neither certificate nor key, ignoring\n", certfile);
|
|
||||||
+ return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
@@ -1338,7 +1461,8 @@ _cert_read_index(const char *dirname, struct stat *dirstat)
|
|
||||||
struct stat idx_stat;
|
|
||||||
char tmpstr[SNMP_MAXPATH + 5], filename[NAME_MAX];
|
|
||||||
char fingerprint[EVP_MAX_MD_SIZE*3], common_name[64+1], type_str[15];
|
|
||||||
- char subject[SNMP_MAXBUF_SMALL], hash_str[15];
|
|
||||||
+ char subject[SNMP_MAXBUF_SMALL], hash_str[15], offset_str[15];
|
|
||||||
+ ssize_t offset;
|
|
||||||
int count = 0, type, hash, version;
|
|
||||||
netsnmp_cert *cert;
|
|
||||||
netsnmp_key *key;
|
|
||||||
@@ -1381,7 +1505,8 @@ _cert_read_index(const char *dirname, struct stat *dirstat)
|
|
||||||
netsnmp_directory_container_read_some(NULL, dirname,
|
|
||||||
_time_filter, &idx_stat,
|
|
||||||
NETSNMP_DIR_NSFILE |
|
|
||||||
- NETSNMP_DIR_NSFILE_STATS);
|
|
||||||
+ NETSNMP_DIR_NSFILE_STATS |
|
|
||||||
+ NETSNMP_DIR_ALLOW_DUPLICATES);
|
|
||||||
if (newer) {
|
|
||||||
DEBUGMSGT(("cert:index:parse", "Index outdated; files modified\n"));
|
|
||||||
CONTAINER_FREE_ALL(newer, NULL);
|
|
||||||
@@ -1426,6 +1551,7 @@ _cert_read_index(const char *dirname, struct stat *dirstat)
|
|
||||||
pos = &tmpstr[2];
|
|
||||||
if ((NULL == (pos=copy_nword(pos, filename, sizeof(filename)))) ||
|
|
||||||
(NULL == (pos=copy_nword(pos, type_str, sizeof(type_str)))) ||
|
|
||||||
+ (NULL == (pos=copy_nword(pos, offset_str, sizeof(offset_str)))) ||
|
|
||||||
(NULL == (pos=copy_nword(pos, hash_str, sizeof(hash_str)))) ||
|
|
||||||
(NULL == (pos=copy_nword(pos, fingerprint,
|
|
||||||
sizeof(fingerprint)))) ||
|
|
||||||
@@ -1438,8 +1564,9 @@ _cert_read_index(const char *dirname, struct stat *dirstat)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
type = atoi(type_str);
|
|
||||||
+ offset = atoi(offset_str);
|
|
||||||
hash = atoi(hash_str);
|
|
||||||
- cert = _new_cert(dirname, filename, type, hash, fingerprint,
|
|
||||||
+ cert = _new_cert(dirname, filename, type, offset, hash, fingerprint,
|
|
||||||
common_name, subject);
|
|
||||||
if (cert && 0 == CONTAINER_INSERT(found, cert))
|
|
||||||
++count;
|
|
||||||
@@ -1546,7 +1673,8 @@ _add_certdir(const char *dirname)
|
|
||||||
netsnmp_directory_container_read_some(NULL, dirname,
|
|
||||||
_cert_cert_filter, NULL,
|
|
||||||
NETSNMP_DIR_RELATIVE_PATH |
|
|
||||||
- NETSNMP_DIR_EMPTY_OK );
|
|
||||||
+ NETSNMP_DIR_EMPTY_OK |
|
|
||||||
+ NETSNMP_DIR_ALLOW_DUPLICATES);
|
|
||||||
if (NULL == cert_container) {
|
|
||||||
DEBUGMSGT(("cert:index:dir",
|
|
||||||
"error creating container for cert files\n"));
|
|
||||||
@@ -1634,7 +1762,7 @@ _cert_print(netsnmp_cert *c, void *context)
|
|
||||||
if (NULL == c)
|
|
||||||
return;
|
|
||||||
|
|
||||||
- DEBUGMSGT(("cert:dump", "cert %s in %s\n", c->info.filename, c->info.dir));
|
|
||||||
+ DEBUGMSGT(("cert:dump", "cert %s in %s at offset %d\n", c->info.filename, c->info.dir, c->offset));
|
|
||||||
DEBUGMSGT(("cert:dump", " type %d flags 0x%x (%s)\n",
|
|
||||||
c->info.type, c->info.allowed_uses,
|
|
||||||
_mode_str(c->info.allowed_uses)));
|
|
||||||
@@ -1838,7 +1966,8 @@ netsnmp_cert_find(int what, int where, void *hint)
|
|
||||||
netsnmp_void_array *matching;
|
|
||||||
|
|
||||||
DEBUGMSGT(("cert:find:params", " hint = %s\n", (char *)hint));
|
|
||||||
- matching = _cert_find_subset_fn( filename, NULL );
|
|
||||||
+ matching = _cert_reduce_subset_what(_cert_find_subset_fn(
|
|
||||||
+ filename, NULL ), what);
|
|
||||||
if (!matching)
|
|
||||||
return NULL;
|
|
||||||
if (1 == matching->size)
|
|
||||||
@@ -2281,6 +2410,124 @@ _reduce_subset_dir(netsnmp_void_array *matching, const char *directory)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+/*
|
|
||||||
+ * reduce subset by eliminating any certificates that are not the
|
|
||||||
+ * first certficate in a file. This allows us to ignore certificate
|
|
||||||
+ * chains when testing for specific certificates, and to match keys
|
|
||||||
+ * to the first certificate only.
|
|
||||||
+ */
|
|
||||||
+static netsnmp_void_array *
|
|
||||||
+_cert_reduce_subset_first(netsnmp_void_array *matching)
|
|
||||||
+{
|
|
||||||
+ netsnmp_cert *cc;
|
|
||||||
+ int i = 0, j, newsize;
|
|
||||||
+
|
|
||||||
+ if ((NULL == matching))
|
|
||||||
+ return matching;
|
|
||||||
+
|
|
||||||
+ newsize = matching->size;
|
|
||||||
+
|
|
||||||
+ for( ; i < matching->size; ) {
|
|
||||||
+ /*
|
|
||||||
+ * if we've shifted matches down we'll hit a NULL entry before
|
|
||||||
+ * we hit the end of the array.
|
|
||||||
+ */
|
|
||||||
+ if (NULL == matching->array[i])
|
|
||||||
+ break;
|
|
||||||
+ /*
|
|
||||||
+ * skip over valid matches. The first entry has an offset of zero.
|
|
||||||
+ */
|
|
||||||
+ cc = (netsnmp_cert*)matching->array[i];
|
|
||||||
+ if (0 == cc->offset) {
|
|
||||||
+ ++i;
|
|
||||||
+ continue;
|
|
||||||
+ }
|
|
||||||
+ /*
|
|
||||||
+ * shrink array by shifting everything down a spot. Might not be
|
|
||||||
+ * the most efficient soloution, but this is just happening at
|
|
||||||
+ * startup and hopefully most certs won't have common prefixes.
|
|
||||||
+ */
|
|
||||||
+ --newsize;
|
|
||||||
+ for ( j=i; j < newsize; ++j )
|
|
||||||
+ matching->array[j] = matching->array[j+1];
|
|
||||||
+ matching->array[j] = NULL;
|
|
||||||
+ /** no ++i; just shifted down, need to look at same position again */
|
|
||||||
+ }
|
|
||||||
+ /*
|
|
||||||
+ * if we shifted, set the new size
|
|
||||||
+ */
|
|
||||||
+ if (newsize != matching->size) {
|
|
||||||
+ DEBUGMSGT(("9:cert:subset:first", "shrank from %" NETSNMP_PRIz "d to %d\n",
|
|
||||||
+ matching->size, newsize));
|
|
||||||
+ matching->size = newsize;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (0 == matching->size) {
|
|
||||||
+ free(matching->array);
|
|
||||||
+ SNMP_FREE(matching);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ return matching;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+/*
|
|
||||||
+ * reduce subset by eliminating any certificates that do not match
|
|
||||||
+ * purpose specified.
|
|
||||||
+ */
|
|
||||||
+static netsnmp_void_array *
|
|
||||||
+_cert_reduce_subset_what(netsnmp_void_array *matching, int what)
|
|
||||||
+{
|
|
||||||
+ netsnmp_cert_common *cc;
|
|
||||||
+ int i = 0, j, newsize;
|
|
||||||
+
|
|
||||||
+ if ((NULL == matching))
|
|
||||||
+ return matching;
|
|
||||||
+
|
|
||||||
+ newsize = matching->size;
|
|
||||||
+
|
|
||||||
+ for( ; i < matching->size; ) {
|
|
||||||
+ /*
|
|
||||||
+ * if we've shifted matches down we'll hit a NULL entry before
|
|
||||||
+ * we hit the end of the array.
|
|
||||||
+ */
|
|
||||||
+ if (NULL == matching->array[i])
|
|
||||||
+ break;
|
|
||||||
+ /*
|
|
||||||
+ * skip over valid matches. The first entry has an offset of zero.
|
|
||||||
+ */
|
|
||||||
+ cc = (netsnmp_cert_common *)matching->array[i];
|
|
||||||
+ if ((cc->allowed_uses & what)) {
|
|
||||||
+ ++i;
|
|
||||||
+ continue;
|
|
||||||
+ }
|
|
||||||
+ /*
|
|
||||||
+ * shrink array by shifting everything down a spot. Might not be
|
|
||||||
+ * the most efficient soloution, but this is just happening at
|
|
||||||
+ * startup and hopefully most certs won't have common prefixes.
|
|
||||||
+ */
|
|
||||||
+ --newsize;
|
|
||||||
+ for ( j=i; j < newsize; ++j )
|
|
||||||
+ matching->array[j] = matching->array[j+1];
|
|
||||||
+ matching->array[j] = NULL;
|
|
||||||
+ /** no ++i; just shifted down, need to look at same position again */
|
|
||||||
+ }
|
|
||||||
+ /*
|
|
||||||
+ * if we shifted, set the new size
|
|
||||||
+ */
|
|
||||||
+ if (newsize != matching->size) {
|
|
||||||
+ DEBUGMSGT(("9:cert:subset:what", "shrank from %" NETSNMP_PRIz "d to %d\n",
|
|
||||||
+ matching->size, newsize));
|
|
||||||
+ matching->size = newsize;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (0 == matching->size) {
|
|
||||||
+ free(matching->array);
|
|
||||||
+ SNMP_FREE(matching);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ return matching;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
static netsnmp_void_array *
|
|
||||||
_cert_find_subset_common(const char *filename, netsnmp_container *container)
|
|
||||||
{
|
|
||||||
diff --git a/snmplib/dir_utils.c b/snmplib/dir_utils.c
|
|
||||||
index c2dd989..e7145e4 100644
|
|
||||||
--- a/snmplib/dir_utils.c
|
|
||||||
+++ b/snmplib/dir_utils.c
|
|
||||||
@@ -107,6 +107,9 @@ netsnmp_directory_container_read_some(netsnmp_container *user_container,
|
|
||||||
/** default to unsorted */
|
|
||||||
if (! (flags & NETSNMP_DIR_SORTED))
|
|
||||||
CONTAINER_SET_OPTIONS(container, CONTAINER_KEY_UNSORTED, rc);
|
|
||||||
+ /** default to duplicates not allowed */
|
|
||||||
+ if (! (flags & NETSNMP_DIR_ALLOW_DUPLICATES))
|
|
||||||
+ CONTAINER_SET_OPTIONS(container, CONTAINER_KEY_ALLOW_DUPLICATES, rc);
|
|
||||||
}
|
|
||||||
|
|
||||||
dir = opendir(dirname);
|
|
@ -1,12 +0,0 @@
|
|||||||
diff -urNp a/snmplib/snmp_logging.c b/snmplib/snmp_logging.c
|
|
||||||
--- a/snmplib/snmp_logging.c 2023-02-15 10:19:15.691827254 +0100
|
|
||||||
+++ b/snmplib/snmp_logging.c 2023-02-15 10:24:41.006642974 +0100
|
|
||||||
@@ -490,7 +490,7 @@ snmp_log_options(char *optarg, int argc,
|
|
||||||
char *
|
|
||||||
snmp_log_syslogname(const char *pstr)
|
|
||||||
{
|
|
||||||
- if (pstr)
|
|
||||||
+ if (pstr && (pstr != syslogname))
|
|
||||||
strlcpy (syslogname, pstr, sizeof(syslogname));
|
|
||||||
|
|
||||||
return syslogname;
|
|
@ -1,28 +0,0 @@
|
|||||||
diff --git a/agent/mibgroup/hardware/memory/memory_linux.c b/agent/mibgroup/hardware/memory/memory_linux.c
|
|
||||||
index 6d5e86c..68b55d2 100644
|
|
||||||
--- a/agent/mibgroup/hardware/memory/memory_linux.c
|
|
||||||
+++ b/agent/mibgroup/hardware/memory/memory_linux.c
|
|
||||||
@@ -123,6 +123,13 @@ int netsnmp_mem_arch_load( netsnmp_cache *cache, void *magic ) {
|
|
||||||
if (first)
|
|
||||||
snmp_log(LOG_ERR, "No SwapTotal line in /proc/meminfo\n");
|
|
||||||
}
|
|
||||||
+ b = strstr(buff, "SReclaimable: ");
|
|
||||||
+ if (b)
|
|
||||||
+ sscanf(b, "SReclaimable: %lu", &sreclaimable);
|
|
||||||
+ else {
|
|
||||||
+ if (first)
|
|
||||||
+ snmp_log(LOG_ERR, "No SReclaimable line in /proc/meminfo\n");
|
|
||||||
+ }
|
|
||||||
b = strstr(buff, "SwapFree: ");
|
|
||||||
if (b)
|
|
||||||
sscanf(b, "SwapFree: %lu", &swapfree);
|
|
||||||
@@ -130,9 +137,6 @@ int netsnmp_mem_arch_load( netsnmp_cache *cache, void *magic ) {
|
|
||||||
if (first)
|
|
||||||
snmp_log(LOG_ERR, "No SwapFree line in /proc/meminfo\n");
|
|
||||||
}
|
|
||||||
- b = strstr(buff, "SReclaimable: ");
|
|
||||||
- if (b)
|
|
||||||
- sscanf(b, "SReclaimable: %lu", &sreclaimable);
|
|
||||||
first = 0;
|
|
||||||
|
|
||||||
|
|
@ -1,48 +0,0 @@
|
|||||||
diff --git a/man/netsnmp_config_api.3.def b/man/netsnmp_config_api.3.def
|
|
||||||
index 90b20d9..bd5abe1 100644
|
|
||||||
--- a/man/netsnmp_config_api.3.def
|
|
||||||
+++ b/man/netsnmp_config_api.3.def
|
|
||||||
@@ -295,7 +295,7 @@ for one particular machine.
|
|
||||||
.PP
|
|
||||||
The default list of directories to search is \fC SYSCONFDIR/snmp\fP,
|
|
||||||
followed by \fC DATADIR/snmp\fP,
|
|
||||||
-followed by \fC LIBDIR/snmp\fP,
|
|
||||||
+followed by \fC /usr/lib(64)/snmp\fP,
|
|
||||||
followed by \fC $HOME/.snmp\fP.
|
|
||||||
This list can be changed by setting the environmental variable
|
|
||||||
.I SNMPCONFPATH
|
|
||||||
@@ -367,7 +367,7 @@ A colon separated list of directories to search for configuration
|
|
||||||
files in.
|
|
||||||
Default:
|
|
||||||
.br
|
|
||||||
-SYSCONFDIR/snmp:\:DATADIR/snmp:\:LIBDIR/snmp:\:$HOME/.snmp
|
|
||||||
+SYSCONFDIR/snmp:\:DATADIR/snmp:\:/usr/lib(64)/snmp:\:$HOME/.snmp
|
|
||||||
.SH "SEE ALSO"
|
|
||||||
netsnmp_mib_api(3), snmp_api(3)
|
|
||||||
.\" Local Variables:
|
|
||||||
diff --git a/man/snmp_config.5.def b/man/snmp_config.5.def
|
|
||||||
index fd30873..c3437d6 100644
|
|
||||||
--- a/man/snmp_config.5.def
|
|
||||||
+++ b/man/snmp_config.5.def
|
|
||||||
@@ -10,7 +10,7 @@ First off, there are numerous places that configuration files can be
|
|
||||||
found and read from. By default, the applications look for
|
|
||||||
configuration files in the following 4 directories, in order:
|
|
||||||
SYSCONFDIR/snmp,
|
|
||||||
-DATADIR/snmp, LIBDIR/snmp, and $HOME/.snmp. In each of these
|
|
||||||
+DATADIR/snmp, /usr/lib(64)/snmp, and $HOME/.snmp. In each of these
|
|
||||||
directories, it looks for files snmp.conf, snmpd.conf and/or
|
|
||||||
snmptrapd.conf, as well as snmp.local.conf, snmpd.local.conf
|
|
||||||
and/or snmptrapd.local.conf. *.local.conf are always
|
|
||||||
diff --git a/man/snmpd.conf.5.def b/man/snmpd.conf.5.def
|
|
||||||
index 7ce8a46..a4000f9 100644
|
|
||||||
--- a/man/snmpd.conf.5.def
|
|
||||||
+++ b/man/snmpd.conf.5.def
|
|
||||||
@@ -1593,7 +1593,7 @@ filename), and call the initialisation routine \fIinit_NAME\fR.
|
|
||||||
.RS
|
|
||||||
.IP "Note:"
|
|
||||||
If the specified PATH is not a fully qualified filename, it will
|
|
||||||
-be interpreted relative to LIBDIR/snmp/dlmod, and \fC.so\fR
|
|
||||||
+be interpreted relative to /usr/lib(64)/snmp/dlmod, and \fC.so\fR
|
|
||||||
will be appended to the filename.
|
|
||||||
.RE
|
|
||||||
.PP
|
|
@ -1,38 +0,0 @@
|
|||||||
diff --git a/Makefile.in b/Makefile.in
|
|
||||||
index 912f6b2..862fb5f 100644
|
|
||||||
--- a/Makefile.in
|
|
||||||
+++ b/Makefile.in
|
|
||||||
@@ -227,7 +227,7 @@ perlcleanfeatures:
|
|
||||||
|
|
||||||
# python specific build rules
|
|
||||||
#
|
|
||||||
-PYMAKE=$(PYTHON) setup.py $(PYTHONARGS)
|
|
||||||
+PYMAKE=/usr/bin/python3 setup.py $(PYTHONARGS)
|
|
||||||
pythonmodules: subdirs
|
|
||||||
@(dir=`pwd`; cd python; $(PYMAKE) build --basedir=$$dir) ; \
|
|
||||||
if test $$? != 0 ; then \
|
|
||||||
diff --git a/python/netsnmp/client.py b/python/netsnmp/client.py
|
|
||||||
index daf11a4..3a30a64 100644
|
|
||||||
--- a/python/netsnmp/client.py
|
|
||||||
+++ b/python/netsnmp/client.py
|
|
||||||
@@ -56,7 +56,7 @@ class Varbind(object):
|
|
||||||
def __init__(self, tag=None, iid=None, val=None, type_arg=None):
|
|
||||||
self.tag = STR(tag)
|
|
||||||
self.iid = STR(iid)
|
|
||||||
- self.val = STR(val)
|
|
||||||
+ self.val = val
|
|
||||||
self.type = STR(type_arg)
|
|
||||||
# parse iid out of tag if needed
|
|
||||||
if iid is None and tag is not None:
|
|
||||||
@@ -66,7 +66,10 @@ class Varbind(object):
|
|
||||||
(self.tag, self.iid) = match.group(1, 2)
|
|
||||||
|
|
||||||
def __setattr__(self, name, val):
|
|
||||||
- self.__dict__[name] = STR(val)
|
|
||||||
+ if name == 'val':
|
|
||||||
+ self.__dict__[name] = val
|
|
||||||
+ else:
|
|
||||||
+ self.__dict__[name] = STR(val)
|
|
||||||
|
|
||||||
def __str__(self):
|
|
||||||
return obj_to_str(self)
|
|
@ -1,65 +0,0 @@
|
|||||||
From ed4ee14af5b83fa4a86dfaa783f841d3e8545ce4 Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Josef=20=C5=98=C3=ADdk=C3=BD?= <jridky@redhat.com>
|
|
||||||
Date: Wed, 9 Aug 2023 16:51:28 +0200
|
|
||||||
Subject: [PATCH] Add support for RPM SQLite DB background.
|
|
||||||
|
|
||||||
From RPM 4.16 the SQLite support is available for RPM DB.
|
|
||||||
After https://fedoraproject.org/wiki/Changes/Sqlite_Rpmdb, rpm changed
|
|
||||||
it's background DB from Berkeley to SQLite in Fedora.
|
|
||||||
Net-SNMP is using hard coded paths to determine where RPM DB files are.
|
|
||||||
|
|
||||||
This update is adding check for rpmdb.sqlite file in order to be able
|
|
||||||
invalidate internal cache after system package change.
|
|
||||||
|
|
||||||
Closes #596
|
|
||||||
---
|
|
||||||
agent/mibgroup/host/data_access/swinst_rpm.c | 18 +++++++++++++-----
|
|
||||||
agent/mibgroup/host/hr_swinst.c | 3 +++
|
|
||||||
2 files changed, 16 insertions(+), 5 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/agent/mibgroup/host/data_access/swinst_rpm.c b/agent/mibgroup/host/data_access/swinst_rpm.c
|
|
||||||
index 050edff307..7ad91a3194 100644
|
|
||||||
--- a/agent/mibgroup/host/data_access/swinst_rpm.c
|
|
||||||
+++ b/agent/mibgroup/host/data_access/swinst_rpm.c
|
|
||||||
@@ -73,15 +73,23 @@ netsnmp_swinst_arch_init(void)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
snprintf( pkg_directory, SNMP_MAXPATH, "%s/Packages", dbpath );
|
|
||||||
+
|
|
||||||
+ if (-1 == stat( pkg_directory, &stat_buf )) {
|
|
||||||
+
|
|
||||||
+ /* check for SQLite DB backend */
|
|
||||||
+ snprintf( pkg_directory, SNMP_MAXPATH, "%s/rpmdb.sqlite", dbpath );
|
|
||||||
+
|
|
||||||
+ if (-1 == stat( pkg_directory, &stat_buf )) {
|
|
||||||
+ snmp_log(LOG_ERR, "Can't find directory of RPM packages\n");
|
|
||||||
+ pkg_directory[0] = '\0';
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
SNMP_FREE(rpmdbpath);
|
|
||||||
dbpath = NULL;
|
|
||||||
#ifdef HAVE_RPMGETPATH
|
|
||||||
rpmFreeRpmrc();
|
|
||||||
-#endif
|
|
||||||
- if (-1 == stat( pkg_directory, &stat_buf )) {
|
|
||||||
- snmp_log(LOG_ERR, "Can't find directory of RPM packages\n");
|
|
||||||
- pkg_directory[0] = '\0';
|
|
||||||
- }
|
|
||||||
+#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
diff -urNp a/agent/mibgroup/host/hr_swinst.c b/agent/mibgroup/host/hr_swinst.c
|
|
||||||
--- a/agent/mibgroup/host/hr_swinst.c 2023-07-31 11:37:44.855071535 +0200
|
|
||||||
+++ b/agent/mibgroup/host/hr_swinst.c 2023-08-14 12:45:14.846357019 +0200
|
|
||||||
@@ -229,6 +229,9 @@ init_hr_swinst(void)
|
|
||||||
snprintf(path, sizeof(path), "%s/Packages", swi->swi_dbpath);
|
|
||||||
if (stat(path, &stat_buf) == -1)
|
|
||||||
snprintf(path, sizeof(path), "%s/packages.rpm", swi->swi_dbpath);
|
|
||||||
+ /* check for SQLite DB backend */
|
|
||||||
+ if (stat(path, &stat_buf) == -1)
|
|
||||||
+ snprintf(path, sizeof(path), "%s/rpmdb.sqlite", swi->swi_dbpath);
|
|
||||||
path[ sizeof(path)-1 ] = 0;
|
|
||||||
swi->swi_directory = strdup(path);
|
|
||||||
#ifdef HAVE_RPMGETPATH
|
|
@ -1,110 +0,0 @@
|
|||||||
diff --git a/testing/fulltests/default/T070com2sec_simple b/testing/fulltests/default/T070com2sec_simple
|
|
||||||
index 6c07f74..7df0b51 100644
|
|
||||||
--- a/testing/fulltests/default/T070com2sec_simple
|
|
||||||
+++ b/testing/fulltests/default/T070com2sec_simple
|
|
||||||
@@ -134,34 +134,30 @@ SAVECHECKAGENT '<"c406a", 255.255.255.255/255.255.255.255> => "t406a"'
|
|
||||||
SAVECHECKAGENT 'line 30: Error:' # msg from h_strerror so it varies
|
|
||||||
SAVECHECKAGENT 'line 31: Error:' # msg from h_strerror so it varies
|
|
||||||
|
|
||||||
-if false; then
|
|
||||||
- # The two tests below have been disabled because these rely on resolving a
|
|
||||||
- # domain name into a local IP address. Such DNS replies are filtered out by
|
|
||||||
- # many security devices because to avoid DNS rebinding attacks. See also
|
|
||||||
- # https://en.wikipedia.org/wiki/DNS_rebinding.
|
|
||||||
-
|
|
||||||
- CHECKAGENT '<"c408a"'
|
|
||||||
- if [ "$snmp_last_test_result" -eq 0 ] ; then
|
|
||||||
- CHECKAGENT 'line 32: Error:'
|
|
||||||
- if [ "$snmp_last_test_result" -ne 1 ] ; then
|
|
||||||
- return_value=1
|
|
||||||
- FINISHED
|
|
||||||
- fi
|
|
||||||
- elif [ "$snmp_last_test_result" -ne 1 ] ; then
|
|
||||||
+FINISHED
|
|
||||||
+
|
|
||||||
+# don't test the rest, it depends on DNS, which is not available in Koji
|
|
||||||
+
|
|
||||||
+CHECKAGENT '<"c408a"'
|
|
||||||
+if [ "$snmp_last_test_result" -eq 0 ] ; then
|
|
||||||
+ CHECKAGENT 'line 32: Error:'
|
|
||||||
+ if [ "$snmp_last_test_result" -ne 1 ] ; then
|
|
||||||
return_value=1
|
|
||||||
FINISHED
|
|
||||||
fi
|
|
||||||
+elif [ "$snmp_last_test_result" -ne 1 ] ; then
|
|
||||||
+ return_value=1
|
|
||||||
+ FINISHED
|
|
||||||
+fi
|
|
||||||
|
|
||||||
- CHECKAGENT '<"c408b"'
|
|
||||||
- if [ "$snmp_last_test_result" -eq 0 ] ; then
|
|
||||||
- CHECKAGENT 'line 33: Error:'
|
|
||||||
- if [ "$snmp_last_test_result" -ne 1 ] ; then
|
|
||||||
- return_value=1
|
|
||||||
- fi
|
|
||||||
- elif [ "$snmp_last_test_result" -ne 1 ] ; then
|
|
||||||
+CHECKAGENT '<"c408b"'
|
|
||||||
+if [ "$snmp_last_test_result" -eq 0 ] ; then
|
|
||||||
+ CHECKAGENT 'line 33: Error:'
|
|
||||||
+ if [ "$snmp_last_test_result" -ne 1 ] ; then
|
|
||||||
return_value=1
|
|
||||||
fi
|
|
||||||
-
|
|
||||||
+elif [ "$snmp_last_test_result" -ne 1 ] ; then
|
|
||||||
+ return_value=1
|
|
||||||
fi
|
|
||||||
|
|
||||||
FINISHED
|
|
||||||
diff --git a/testing/fulltests/default/T071com2sec6_simple b/testing/fulltests/default/T071com2sec6_simple
|
|
||||||
index 76da70b..bc2d432 100644
|
|
||||||
--- a/testing/fulltests/default/T071com2sec6_simple
|
|
||||||
+++ b/testing/fulltests/default/T071com2sec6_simple
|
|
||||||
@@ -132,30 +132,27 @@ SAVECHECKAGENT '<"c606a", ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/ffff:ffff:ffff
|
|
||||||
SAVECHECKAGENT 'line 27: Error:'
|
|
||||||
SAVECHECKAGENT 'line 28: Error:'
|
|
||||||
|
|
||||||
-if false; then
|
|
||||||
- # The two tests below have been disabled because these rely on resolving a
|
|
||||||
- # domain name into a local IP address. Such DNS replies are filtered out by
|
|
||||||
- # many security devices because to avoid DNS rebinding attacks. See also
|
|
||||||
- # https://en.wikipedia.org/wiki/DNS_rebinding.
|
|
||||||
-
|
|
||||||
- # 608
|
|
||||||
- CHECKAGENT '<"c608a"'
|
|
||||||
- if [ "$snmp_last_test_result" -eq 0 ] ; then
|
|
||||||
- CHECKAGENT 'line 29: Error:'
|
|
||||||
- errnum=`expr $errnum - 1`
|
|
||||||
- if [ "$snmp_last_test_result" -ne 1 ] ; then
|
|
||||||
- FINISHED
|
|
||||||
- fi
|
|
||||||
- elif [ "$snmp_last_test_result" -ne 1 ] ; then
|
|
||||||
+FINISHED
|
|
||||||
+
|
|
||||||
+# don't test the rest, it depends on DNS, which is not available in Koji
|
|
||||||
+
|
|
||||||
+# 608
|
|
||||||
+CHECKAGENT '<"c608a"'
|
|
||||||
+if [ "$snmp_last_test_result" -eq 0 ] ; then
|
|
||||||
+ CHECKAGENT 'line 29: Error:'
|
|
||||||
+ errnum=`expr $errnum - 1`
|
|
||||||
+ if [ "$snmp_last_test_result" -ne 1 ] ; then
|
|
||||||
FINISHED
|
|
||||||
fi
|
|
||||||
+elif [ "$snmp_last_test_result" -ne 1 ] ; then
|
|
||||||
+ FINISHED
|
|
||||||
+fi
|
|
||||||
|
|
||||||
- CHECKAGENTCOUNT atleastone '<"c608b"'
|
|
||||||
- if [ "$snmp_last_test_result" -eq 0 ] ; then
|
|
||||||
- CHECKAGENT 'line 30: Error:'
|
|
||||||
- if [ "$snmp_last_test_result" -eq 1 ] ; then
|
|
||||||
- errnum=`expr $errnum - 1`
|
|
||||||
- fi
|
|
||||||
+CHECKAGENTCOUNT atleastone '<"c608b"'
|
|
||||||
+if [ "$snmp_last_test_result" -eq 0 ] ; then
|
|
||||||
+ CHECKAGENT 'line 30: Error:'
|
|
||||||
+ if [ "$snmp_last_test_result" -eq 1 ] ; then
|
|
||||||
+ errnum=`expr $errnum - 1`
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
@ -1,175 +0,0 @@
|
|||||||
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:
|
|
@ -1,6 +0,0 @@
|
|||||||
diff -urNp a/dist/autoconf-version b/dist/autoconf-version
|
|
||||||
--- a/dist/autoconf-version 2024-02-16 08:21:36.551729028 +0100
|
|
||||||
+++ b/dist/autoconf-version 2024-02-16 08:24:39.035608191 +0100
|
|
||||||
@@ -1 +1 @@
|
|
||||||
-2.71
|
|
||||||
+2.72
|
|
@ -1,120 +0,0 @@
|
|||||||
From f5ae6baf0018abda9dedc368fe6d52c0d7a8ab8f Mon Sep 17 00:00:00 2001
|
|
||||||
From: Philippe Troin <phil+github-commits@fifi.org>
|
|
||||||
Date: Sat, 3 Feb 2024 10:30:30 -0800
|
|
||||||
Subject: [PATCH] Add Linux 6.7 compatibility parsing /proc/net/snmp
|
|
||||||
|
|
||||||
Linux 6.7 adds a new OutTransmits field to Ip in /proc/net/snmp.
|
|
||||||
This breaks the hard-coded assumptions about the Ip line length.
|
|
||||||
Add compatibility to parse Linux 6.7 Ip header while keep support
|
|
||||||
for previous versions.
|
|
||||||
---
|
|
||||||
.../ip-mib/data_access/systemstats_linux.c | 46 +++++++++++++++----
|
|
||||||
1 file changed, 37 insertions(+), 9 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/agent/mibgroup/ip-mib/data_access/systemstats_linux.c b/agent/mibgroup/ip-mib/data_access/systemstats_linux.c
|
|
||||||
index 49e0a34d5c..f04e828a94 100644
|
|
||||||
--- a/agent/mibgroup/ip-mib/data_access/systemstats_linux.c
|
|
||||||
+++ b/agent/mibgroup/ip-mib/data_access/systemstats_linux.c
|
|
||||||
@@ -36,7 +36,7 @@ netsnmp_access_systemstats_arch_init(void)
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
- /proc/net/snmp
|
|
||||||
+ /proc/net/snmp - Linux 6.6 and lower
|
|
||||||
|
|
||||||
Ip: Forwarding DefaultTTL InReceives InHdrErrors InAddrErrors ForwDatagrams InUnknownProtos InDiscards InDelivers OutRequests OutDiscards OutNoRoutes ReasmTimeout ReasmReqds ReasmOKs ReasmFails FragOKs FragFails FragCreates
|
|
||||||
Ip: 2 64 7083534 0 0 0 0 0 6860233 6548963 0 0 1 286623 63322 1 259920 0 0
|
|
||||||
@@ -49,6 +49,26 @@ netsnmp_access_systemstats_arch_init(void)
|
|
||||||
|
|
||||||
Udp: InDatagrams NoPorts InErrors OutDatagrams
|
|
||||||
Udp: 1491094 122 0 1466178
|
|
||||||
+*
|
|
||||||
+ /proc/net/snmp - Linux 6.7 and higher
|
|
||||||
+
|
|
||||||
+ Ip: Forwarding DefaultTTL InReceives InHdrErrors InAddrErrors ForwDatagrams InUnknownProtos InDiscards InDelivers OutRequests OutDiscards OutNoRoutes ReasmTimeout ReasmReqds ReasmOKs ReasmFails FragOKs FragFails FragCreates OutTransmits
|
|
||||||
+ Ip: 1 64 50859058 496 0 37470604 0 0 20472980 7515791 1756 0 0 7264 3632 0 3548 0 7096 44961424
|
|
||||||
+
|
|
||||||
+ Icmp: InMsgs InErrors InCsumErrors InDestUnreachs InTimeExcds InParmProbs InSrcQuenchs InRedirects InEchos InEchoReps InTimestamps InTimestampReps InAddrMasks InAddrMaskReps OutMsgs OutErrors OutRateLimitGlobal OutRateLimitHost OutDestUnreachs OutTimeExcds OutParmProbs OutSrcQuenchs OutRedirects OutEchos OutEchoReps OutTimestamps OutTimestampReps OutAddrMasks OutAddrMaskReps
|
|
||||||
+ Icmp: 114447 2655 0 17589 0 0 0 0 66905 29953 0 0 0 0 143956 0 0 572 16610 484 0 0 0 59957 66905 0 0 0 0
|
|
||||||
+
|
|
||||||
+ IcmpMsg: InType0 InType3 InType8 OutType0 OutType3 OutType8 OutType11
|
|
||||||
+ IcmpMsg: 29953 17589 66905 66905 16610 59957 484
|
|
||||||
+
|
|
||||||
+ Tcp: RtoAlgorithm RtoMin RtoMax MaxConn ActiveOpens PassiveOpens AttemptFails EstabResets CurrEstab InSegs OutSegs RetransSegs InErrs OutRsts InCsumErrors
|
|
||||||
+ Tcp: 1 200 120000 -1 17744 13525 307 3783 6 18093137 9277788 3499 8 7442 0
|
|
||||||
+
|
|
||||||
+ Udp: InDatagrams NoPorts InErrors OutDatagrams RcvbufErrors SndbufErrors InCsumErrors IgnoredMulti MemErrors
|
|
||||||
+ Udp: 2257832 1422 0 2252835 0 0 0 84 0
|
|
||||||
+
|
|
||||||
+ UdpLite: InDatagrams NoPorts InErrors OutDatagrams RcvbufErrors SndbufErrors InCsumErrors IgnoredMulti MemErrors
|
|
||||||
+ UdpLite: 0 0 0 0 0 0 0 0 0
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
@@ -101,10 +121,10 @@ _systemstats_v4(netsnmp_container* container, u_int load_flags)
|
|
||||||
FILE *devin;
|
|
||||||
char line[1024];
|
|
||||||
netsnmp_systemstats_entry *entry = NULL;
|
|
||||||
- int scan_count;
|
|
||||||
+ int scan_count, expected_scan_count;
|
|
||||||
char *stats, *start = line;
|
|
||||||
int len;
|
|
||||||
- unsigned long long scan_vals[19];
|
|
||||||
+ unsigned long long scan_vals[20];
|
|
||||||
|
|
||||||
DEBUGMSGTL(("access:systemstats:container:arch", "load v4 (flags %x)\n",
|
|
||||||
load_flags));
|
|
||||||
@@ -126,10 +146,17 @@ _systemstats_v4(netsnmp_container* container, u_int load_flags)
|
|
||||||
*/
|
|
||||||
NETSNMP_IGNORE_RESULT(fgets(line, sizeof(line), devin));
|
|
||||||
len = strlen(line);
|
|
||||||
- if (224 != len) {
|
|
||||||
+ switch (len) {
|
|
||||||
+ case 224:
|
|
||||||
+ expected_scan_count = 19;
|
|
||||||
+ break;
|
|
||||||
+ case 237:
|
|
||||||
+ expected_scan_count = 20;
|
|
||||||
+ break;
|
|
||||||
+ default:
|
|
||||||
fclose(devin);
|
|
||||||
snmp_log(LOG_ERR, "systemstats_linux: unexpected header length in /proc/net/snmp."
|
|
||||||
- " %d != 224\n", len);
|
|
||||||
+ " %d not in { 224, 237 } \n", len);
|
|
||||||
return -4;
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -178,20 +205,20 @@ _systemstats_v4(netsnmp_container* container, u_int load_flags)
|
|
||||||
memset(scan_vals, 0x0, sizeof(scan_vals));
|
|
||||||
scan_count = sscanf(stats,
|
|
||||||
"%llu %llu %llu %llu %llu %llu %llu %llu %llu %llu"
|
|
||||||
- "%llu %llu %llu %llu %llu %llu %llu %llu %llu",
|
|
||||||
+ "%llu %llu %llu %llu %llu %llu %llu %llu %llu %llu",
|
|
||||||
&scan_vals[0],&scan_vals[1],&scan_vals[2],
|
|
||||||
&scan_vals[3],&scan_vals[4],&scan_vals[5],
|
|
||||||
&scan_vals[6],&scan_vals[7],&scan_vals[8],
|
|
||||||
&scan_vals[9],&scan_vals[10],&scan_vals[11],
|
|
||||||
&scan_vals[12],&scan_vals[13],&scan_vals[14],
|
|
||||||
&scan_vals[15],&scan_vals[16],&scan_vals[17],
|
|
||||||
- &scan_vals[18]);
|
|
||||||
+ &scan_vals[18],&scan_vals[19]);
|
|
||||||
DEBUGMSGTL(("access:systemstats", " read %d values\n", scan_count));
|
|
||||||
|
|
||||||
- if(scan_count != 19) {
|
|
||||||
+ if(scan_count != expected_scan_count) {
|
|
||||||
snmp_log(LOG_ERR,
|
|
||||||
"error scanning systemstats data (expected %d, got %d)\n",
|
|
||||||
- 19, scan_count);
|
|
||||||
+ expected_scan_count, scan_count);
|
|
||||||
netsnmp_access_systemstats_entry_free(entry);
|
|
||||||
return -4;
|
|
||||||
}
|
|
||||||
@@ -223,6 +250,7 @@ _systemstats_v4(netsnmp_container* container, u_int load_flags)
|
|
||||||
entry->stats.HCOutFragFails.high = scan_vals[17] >> 32;
|
|
||||||
entry->stats.HCOutFragCreates.low = scan_vals[18] & 0xffffffff;
|
|
||||||
entry->stats.HCOutFragCreates.high = scan_vals[18] >> 32;
|
|
||||||
+ /* entry->stats. = scan_vals[19]; / * OutTransmits */
|
|
||||||
|
|
||||||
entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINRECEIVES] = 1;
|
|
||||||
entry->stats.columnAvail[IPSYSTEMSTATSTABLE_INHDRERRORS] = 1;
|
|
||||||
|
|
@ -16,47 +16,47 @@
|
|||||||
arch=`arch`
|
arch=`arch`
|
||||||
echo $arch | grep -q i.86
|
echo $arch | grep -q i.86
|
||||||
if [ $? -eq 0 ] ; then
|
if [ $? -eq 0 ] ; then
|
||||||
net-snmp-config-i386 "$@"
|
net-snmp-config-i386 $*
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
if [ "$arch" = "ia64" ] ; then
|
if [ "$arch" = "ia64" ] ; then
|
||||||
net-snmp-config-ia64 "$@"
|
net-snmp-config-ia64 $*
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
if [ "$arch" = "ppc" ] ; then
|
if [ "$arch" = "ppc" ] ; then
|
||||||
net-snmp-config-ppc "$@"
|
net-snmp-config-ppc $*
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
if [ "$arch" = "ppc64" ] ; then
|
if [ "$arch" = "ppc64" ] ; then
|
||||||
net-snmp-config-ppc64 "$@"
|
net-snmp-config-ppc64 $*
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
if [ "$arch" = "s390" ] ; then
|
if [ "$arch" = "s390" ] ; then
|
||||||
net-snmp-config-s390 "$@"
|
net-snmp-config-s390 $*
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
if [ "$arch" = "s390x" ] ; then
|
if [ "$arch" = "s390x" ] ; then
|
||||||
net-snmp-config-s390x "$@"
|
net-snmp-config-s390x $*
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
if [ "$arch" = "x86_64" ] ; then
|
if [ "$arch" = "x86_64" ] ; then
|
||||||
net-snmp-config-x86_64 "$@"
|
net-snmp-config-x86_64 $*
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
if [ "$arch" = "alpha" ] ; then
|
if [ "$arch" = "alpha" ] ; then
|
||||||
net-snmp-config-alpha "$@"
|
net-snmp-config-alpha $*
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
if [ "$arch" = "sparc" ] ; then
|
if [ "$arch" = "sparc" ] ; then
|
||||||
net-snmp-config-sparc "$@"
|
net-snmp-config-sparc $*
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
if [ "$arch" = "sparc64" ] ; then
|
if [ "$arch" = "sparc64" ] ; then
|
||||||
net-snmp-config-sparc64 "$@"
|
net-snmp-config-sparc64 $*
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
if [ "$arch" = "aarch64" ] ; then
|
if [ "$arch" = "aarch64" ] ; then
|
||||||
net-snmp-config-aarch64 "$@"
|
net-snmp-config-aarch64 $*
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
echo "Cannot determine architecture"
|
echo "Cannot determine architecture"
|
||||||
|
@ -1,59 +0,0 @@
|
|||||||
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*)
|
|
@ -1 +1 @@
|
|||||||
d /run/net-snmp 0755 root root
|
d /var/run/net-snmp 0755 root root
|
||||||
|
770
net-snmp.spec
770
net-snmp.spec
@ -1,96 +1,89 @@
|
|||||||
|
# use netsnmp_tcp_wrappers 0 to disable tcp_wrappers support
|
||||||
|
%{!?netsnmp_tcp_wrappers:%global netsnmp_tcp_wrappers 1}
|
||||||
# use nestnmp_check 0 to speed up packaging by disabling 'make test'
|
# use nestnmp_check 0 to speed up packaging by disabling 'make test'
|
||||||
%{!?netsnmp_check: %global netsnmp_check 1}
|
%{!?netsnmp_check: %global netsnmp_check 1}
|
||||||
|
|
||||||
|
# allow compilation on Fedora 11 and older
|
||||||
|
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
|
||||||
# Arches on which we need to prevent arch conflicts on net-snmp-config.h
|
# Arches on which we need to prevent arch conflicts on net-snmp-config.h
|
||||||
%global multilib_arches %{ix86} ia64 ppc ppc64 s390 s390x x86_64 sparc sparcv9 sparc64 aarch64
|
%global multilib_arches %{ix86} ia64 ppc ppc64 s390 s390x x86_64 sparc sparcv9 sparc64 aarch64
|
||||||
|
|
||||||
# actual soname version
|
|
||||||
%global soname 40
|
|
||||||
|
|
||||||
Summary: A collection of SNMP protocol tools and libraries
|
Summary: A collection of SNMP protocol tools and libraries
|
||||||
Name: net-snmp
|
Name: net-snmp
|
||||||
Version: 5.9.4
|
Version: 5.7.3
|
||||||
Release: 8%{?dist}
|
Release: 15%{?dist}
|
||||||
Epoch: 1
|
Epoch: 1
|
||||||
|
|
||||||
License: Net-SNMP and OpenSSL
|
License: BSD
|
||||||
|
Group: System Environment/Daemons
|
||||||
URL: http://net-snmp.sourceforge.net/
|
URL: http://net-snmp.sourceforge.net/
|
||||||
Source0: https://downloads.sourceforge.net/project/net-snmp/net-snmp/%{version}/net-snmp-%{version}.tar.gz
|
Source0: https://downloads.sourceforge.net/project/net-snmp/net-snmp/%{version}/net-snmp-%{version}.tar.gz
|
||||||
Source1: net-snmp.redhat.conf
|
Source1: net-snmp.redhat.conf
|
||||||
Source2: net-snmp-config.h
|
Source2: net-snmpd.init
|
||||||
Source3: net-snmp-config
|
Source3: net-snmptrapd.init
|
||||||
Source4: net-snmp-trapd.redhat.conf
|
Source4: net-snmp-config.h
|
||||||
Source5: net-snmpd.sysconfig
|
Source5: net-snmp-config
|
||||||
Source6: net-snmptrapd.sysconfig
|
Source6: net-snmp-trapd.redhat.conf
|
||||||
Source7: net-snmp-tmpfs.conf
|
Source7: net-snmpd.sysconfig
|
||||||
Source8: snmpd.service
|
Source8: net-snmptrapd.sysconfig
|
||||||
Source9: snmptrapd.service
|
Source9: net-snmp-tmpfs.conf
|
||||||
Source10: IETF-MIB-LICENSE.txt
|
Source10: snmpd.service
|
||||||
|
Source11: snmptrapd.service
|
||||||
Patch1: net-snmp-5.9-pie.patch
|
Source12: IETF-MIB-LICENSE.txt
|
||||||
Patch2: net-snmp-5.9-dir-fix.patch
|
Patch1: net-snmp-5.7.2-pie.patch
|
||||||
Patch3: net-snmp-5.9-multilib.patch
|
Patch2: net-snmp-5.5-dir-fix.patch
|
||||||
Patch4: net-snmp-5.9-test-debug.patch
|
Patch3: net-snmp-5.6-multilib.patch
|
||||||
Patch5: net-snmp-5.7.2-cert-path.patch
|
Patch4: net-snmp-5.5-apsl-copying.patch
|
||||||
Patch6: net-snmp-5.9-cflags.patch
|
Patch5: net-snmp-5.6-test-debug.patch
|
||||||
Patch7: net-snmp-5.8-Remove-U64-typedef.patch
|
Patch6: net-snmp-5.7.2-systemd.patch
|
||||||
Patch8: net-snmp-5.7.3-iterator-fix.patch
|
Patch7: net-snmp-5.7.2-create-user-multilib.patch
|
||||||
Patch9: net-snmp-5.9-autofs-skip.patch
|
Patch8: net-snmp-5.7.2-autoreconf.patch
|
||||||
Patch10: net-snmp-5.9-coverity.patch
|
Patch9: net-snmp-5.7-agentx-crash.patch
|
||||||
Patch11: net-snmp-5.8-expand-SNMPCONFPATH.patch
|
Patch10: net-snmp-5.5-agentx-disconnect-crash.patch
|
||||||
Patch12: net-snmp-5.8-duplicate-ipAddress.patch
|
Patch11: net-snmp-5.7.2-cert-path.patch
|
||||||
Patch13: net-snmp-5.9-memory-reporting.patch
|
Patch12: net-snmp-5.7.3-snmpstatus-null.patch
|
||||||
Patch14: net-snmp-5.8-man-page.patch
|
Patch13: net-snmp-5.7.3-cflags.patch
|
||||||
Patch15: net-snmp-5.8-ipAddress-faster-load.patch
|
# Remove U64 typedef to build against Perl 5.24
|
||||||
Patch16: net-snmp-5.8-rpm-memory-leak.patch
|
# Backported from upstream
|
||||||
Patch17: net-snmp-5.9-aes-config.patch
|
Patch14: net-snmp-5.7.3-Remove-U64-typedef.patch
|
||||||
Patch18: net-snmp-5.8-clientaddr-error-message.patch
|
# Fixed Makefile.PL to build against Perl 5.24
|
||||||
Patch19: net-snmp-5.9-intermediate-certs.patch
|
# For more info: https://rt.perl.org/Public/Bug/Display.html?id=125907
|
||||||
Patch20: net-snmp-5.9.1-remove-des.patch
|
Patch15: net-snmp-5.7.3-Fix-Makefile-PL.patch
|
||||||
Patch21: net-snmp-libs-misunderstanding.patch
|
# Use strtok_r for strtok to avoid a race condition
|
||||||
Patch22: net-snmp-5.9-ipv6-disable-leak.patch
|
Patch16: net-snmp-5.7.3-strtok-r.patch
|
||||||
Patch23: net-snmp-5.9-rpmdb.patch
|
# Fix perl issue with use NetSNMP::TrapReceiver (add link to libmysqlclient.so)
|
||||||
Patch24: net-snmp-5.9.4-autoconf.patch
|
Patch17: net-snmp-5.7.3-mysqllib.patch
|
||||||
Patch25: net-snmp-5.9.4-kernel-6.7.patch
|
|
||||||
|
|
||||||
# Modern RPM API means at least EL6
|
|
||||||
Patch101: net-snmp-5.8-modern-rpm-api.patch
|
|
||||||
|
|
||||||
#disable this patch due compatibility issues
|
|
||||||
Patch102: net-snmp-5.9-python3.patch
|
|
||||||
|
|
||||||
|
Requires(post): chkconfig
|
||||||
|
Requires(preun): chkconfig
|
||||||
|
# for /sbin/service
|
||||||
|
Requires(preun): initscripts
|
||||||
|
# for /bin/rm
|
||||||
|
Requires(preun): coreutils
|
||||||
Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release}
|
Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release}
|
||||||
Requires: %{name}-agent-libs%{?_isa} = %{epoch}:%{version}-%{release}
|
Requires: %{name}-agent-libs%{?_isa} = %{epoch}:%{version}-%{release}
|
||||||
# This is actually needed for the %%triggerun script but Requires(triggerun)
|
# This is actually needed for the %%triggerun script but Requires(triggerun)
|
||||||
# is not valid. We can use %%post because this particular %%triggerun script
|
# is not valid. We can use %%post because this particular %triggerun script
|
||||||
# should fire just after this package is installed.
|
# should fire just after this package is installed.
|
||||||
%{?systemd_requires}
|
Requires(post): systemd-sysv
|
||||||
BuildRequires: make
|
|
||||||
BuildRequires: systemd
|
|
||||||
BuildRequires: gcc
|
|
||||||
BuildRequires: openssl-devel, bzip2-devel, elfutils-devel
|
BuildRequires: openssl-devel, bzip2-devel, elfutils-devel
|
||||||
BuildRequires: libselinux-devel, elfutils-libelf-devel, rpm-devel
|
BuildRequires: libselinux-devel, elfutils-libelf-devel, rpm-devel
|
||||||
BuildRequires: perl-devel, perl(ExtUtils::Embed), procps
|
BuildRequires: perl-devel, perl(ExtUtils::Embed), procps
|
||||||
BuildRequires: python3-devel, python3-setuptools
|
BuildRequires: python-devel, python-setuptools
|
||||||
BuildRequires: chrpath
|
BuildRequires: chrpath
|
||||||
BuildRequires: mariadb-connector-c-devel
|
BuildRequires: mysql-devel
|
||||||
# for netstat, needed by 'make test'
|
# for netstat, needed by 'make test'
|
||||||
BuildRequires: net-tools
|
BuildRequires: net-tools
|
||||||
# for make test
|
# for make test
|
||||||
BuildRequires: perl(:VERSION) >= 5.6
|
|
||||||
BuildRequires: perl(AutoLoader)
|
|
||||||
BuildRequires: perl(blib)
|
|
||||||
BuildRequires: perl(Carp)
|
|
||||||
BuildRequires: perl(DynaLoader)
|
|
||||||
BuildRequires: perl(Exporter)
|
|
||||||
BuildRequires: perl(overload)
|
|
||||||
BuildRequires: perl(strict)
|
|
||||||
BuildRequires: perl(TAP::Harness)
|
BuildRequires: perl(TAP::Harness)
|
||||||
BuildRequires: perl(vars)
|
BuildRequires: systemd-units
|
||||||
BuildRequires: perl(warnings)
|
|
||||||
%ifnarch s390 s390x ppc64le
|
%ifnarch s390 s390x ppc64le
|
||||||
BuildRequires: lm_sensors-devel >= 3
|
BuildRequires: lm_sensors-devel >= 3
|
||||||
%endif
|
%endif
|
||||||
|
%if %{netsnmp_tcp_wrappers}
|
||||||
|
BuildRequires: tcp_wrappers-devel
|
||||||
|
%endif
|
||||||
BuildRequires: autoconf, automake
|
BuildRequires: autoconf, automake
|
||||||
|
|
||||||
%description
|
%description
|
||||||
@ -106,6 +99,7 @@ You will probably also want to install the net-snmp-utils package,
|
|||||||
which contains NET-SNMP utilities.
|
which contains NET-SNMP utilities.
|
||||||
|
|
||||||
%package utils
|
%package utils
|
||||||
|
Group: Applications/System
|
||||||
Summary: Network management utilities using SNMP, from the NET-SNMP project
|
Summary: Network management utilities using SNMP, from the NET-SNMP project
|
||||||
Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release}
|
Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release}
|
||||||
|
|
||||||
@ -118,11 +112,14 @@ using the SNMP protocol. You will also need to install the net-snmp
|
|||||||
package.
|
package.
|
||||||
|
|
||||||
%package devel
|
%package devel
|
||||||
|
Group: Development/Libraries
|
||||||
Summary: The development environment for the NET-SNMP project
|
Summary: The development environment for the NET-SNMP project
|
||||||
Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release}
|
Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release}
|
||||||
Requires: %{name}-agent-libs%{?_isa} = %{epoch}:%{version}-%{release}
|
Requires: %{name}-agent-libs%{?_isa} = %{epoch}:%{version}-%{release}
|
||||||
Requires: elfutils-devel, rpm-devel, elfutils-libelf-devel, openssl-devel
|
Requires: elfutils-devel, rpm-devel, elfutils-libelf-devel, openssl-devel
|
||||||
Requires: redhat-rpm-config
|
%if %{netsnmp_tcp_wrappers}
|
||||||
|
Requires: tcp_wrappers-devel
|
||||||
|
%endif
|
||||||
%ifnarch s390 s390x ppc64le
|
%ifnarch s390 s390x ppc64le
|
||||||
Requires: lm_sensors-devel
|
Requires: lm_sensors-devel
|
||||||
%endif
|
%endif
|
||||||
@ -139,39 +136,25 @@ applications for use with the NET-SNMP project's network management
|
|||||||
tools. You'll also need to have the net-snmp and net-snmp-utils
|
tools. You'll also need to have the net-snmp and net-snmp-utils
|
||||||
packages installed.
|
packages installed.
|
||||||
|
|
||||||
%package perl-module
|
|
||||||
Summary: The perl NET-SNMP module
|
|
||||||
Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release}, perl-interpreter
|
|
||||||
BuildRequires: perl-interpreter
|
|
||||||
BuildRequires: perl-generators
|
|
||||||
|
|
||||||
%description perl-module
|
|
||||||
The net-snmp-perl package contains the perl files to use SNMP from within
|
|
||||||
Perl.
|
|
||||||
|
|
||||||
Install the net-snmp-perl package, if you want to use SNMP with perl.
|
|
||||||
|
|
||||||
|
|
||||||
%package perl
|
%package perl
|
||||||
Summary: The perl-based utilities and the mib2c tool
|
Group: Development/Libraries
|
||||||
Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release}, perl-interpreter
|
Summary: The perl NET-SNMP module and the mib2c tool
|
||||||
|
Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release}, perl
|
||||||
Requires: %{name}-agent-libs%{?_isa} = %{epoch}:%{version}-%{release}
|
Requires: %{name}-agent-libs%{?_isa} = %{epoch}:%{version}-%{release}
|
||||||
Requires: %{name}-devel%{?_isa} = %{epoch}:%{version}-%{release}
|
BuildRequires: perl
|
||||||
BuildRequires: perl-interpreter
|
|
||||||
BuildRequires: perl-generators
|
BuildRequires: perl-generators
|
||||||
|
|
||||||
%description perl
|
%description perl
|
||||||
The net-snmp-perl package contains the utilities written in perl.
|
The net-snmp-perl package contains the perl files to use SNMP from within
|
||||||
|
Perl.
|
||||||
|
|
||||||
Install the net-snmp-perl package, if you want to use mib2c or other
|
Install the net-snmp-perl package, if you want to use mib2c or SNMP
|
||||||
perl utilities. Use the net-snmp-perl-module package instead to get the
|
with perl.
|
||||||
SNMP perl module.
|
|
||||||
|
|
||||||
%package gui
|
%package gui
|
||||||
|
Group: Applications/System
|
||||||
Summary: An interactive graphical MIB browser for SNMP
|
Summary: An interactive graphical MIB browser for SNMP
|
||||||
Requires: perl-Tk, %{name}-perl-module%{?_isa} = %{epoch}:%{version}-%{release}
|
Requires: perl-Tk, net-snmp-perl%{?_isa} = %{epoch}:%{version}-%{release}
|
||||||
BuildRequires: perl-interpreter
|
|
||||||
BuildRequires: perl-generators
|
|
||||||
|
|
||||||
%description gui
|
%description gui
|
||||||
The net-snmp-gui package contains tkmib utility, which is a graphical user
|
The net-snmp-gui package contains tkmib utility, which is a graphical user
|
||||||
@ -182,6 +165,7 @@ the remote agents interactively.
|
|||||||
Install the net-snmp-gui package, if you want to use this interactive utility.
|
Install the net-snmp-gui package, if you want to use this interactive utility.
|
||||||
|
|
||||||
%package libs
|
%package libs
|
||||||
|
Group: Development/Libraries
|
||||||
Summary: The NET-SNMP runtime client libraries
|
Summary: The NET-SNMP runtime client libraries
|
||||||
|
|
||||||
%description libs
|
%description libs
|
||||||
@ -189,66 +173,65 @@ The net-snmp-libs package contains the runtime client libraries for shared
|
|||||||
binaries and applications.
|
binaries and applications.
|
||||||
|
|
||||||
%package agent-libs
|
%package agent-libs
|
||||||
|
Group: Development/Libraries
|
||||||
Summary: The NET-SNMP runtime agent libraries
|
Summary: The NET-SNMP runtime agent libraries
|
||||||
# the libs link against libperl.so:
|
# the libs link against libperl.so:
|
||||||
|
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
|
||||||
Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release}
|
Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release}
|
||||||
|
|
||||||
%description agent-libs
|
%description agent-libs
|
||||||
The net-snmp-agent-libs package contains the runtime agent libraries for shared
|
The net-snmp-agent-libs package contains the runtime agent libraries for shared
|
||||||
binaries and applications.
|
binaries and applications.
|
||||||
|
|
||||||
%package -n python3-net-snmp
|
%package python
|
||||||
%{?python_provide:%python_provide python3-net-snmp}
|
Group: Development/Libraries
|
||||||
# Remove before F30
|
|
||||||
Provides: %{name}-python = %{version}-%{release}
|
|
||||||
Provides: %{name}-python%{?_isa} = %{version}-%{release}
|
|
||||||
Obsoletes: %{name}-python < %{version}-%{release}
|
|
||||||
Summary: The Python 'netsnmp' module for the Net-SNMP
|
Summary: The Python 'netsnmp' module for the Net-SNMP
|
||||||
Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release}
|
Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release}
|
||||||
|
|
||||||
%description -n python3-net-snmp
|
%description python
|
||||||
The 'netsnmp' module provides a full featured, tri-lingual SNMP (SNMPv3,
|
The 'netsnmp' module provides a full featured, tri-lingual SNMP (SNMPv3,
|
||||||
SNMPv2c, SNMPv1) client API. The 'netsnmp' module internals rely on the
|
SNMPv2c, SNMPv1) client API. The 'netsnmp' module internals rely on the
|
||||||
Net-SNMP toolkit library.
|
Net-SNMP toolkit library.
|
||||||
|
|
||||||
%prep
|
%if 0%{?fedora} < 23
|
||||||
%setup -q
|
%package sysvinit
|
||||||
cp %{SOURCE10} .
|
Group: System Environment/Daemons
|
||||||
|
Summary: Legacy SysV init scripts for Net-SNMP daemons
|
||||||
|
Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release}
|
||||||
|
|
||||||
%ifnarch ia64
|
%description sysvinit
|
||||||
%patch 1 -p1 -b .pie
|
The net-snmp-sysvinit package provides SysV init scripts for Net-SNMP daemons.
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%patch 2 -p1 -b .dir-fix
|
%prep
|
||||||
%patch 3 -p1 -b .multilib
|
%setup -q
|
||||||
%patch 4 -p1
|
cp %{SOURCE12} .
|
||||||
%patch 5 -p1 -b .cert-path
|
|
||||||
%patch 6 -p1 -b .cflags
|
|
||||||
%patch 7 -p1 -b .u64-remove
|
|
||||||
%patch 8 -p1 -b .iterator-fix
|
|
||||||
%patch 9 -p1 -b .autofs-skip
|
|
||||||
%patch 10 -p1 -b .coverity
|
|
||||||
%patch 11 -p1 -b .expand-SNMPCONFPATH
|
|
||||||
%patch 12 -p1 -b .duplicate-ipAddress
|
|
||||||
%patch 13 -p1 -b .memory-reporting
|
|
||||||
%patch 14 -p1 -b .man-page
|
|
||||||
%patch 15 -p1 -b .ipAddress-faster-load
|
|
||||||
%patch 16 -p1 -b .rpm-memory-leak
|
|
||||||
%patch 17 -p1 -b .aes-config
|
|
||||||
%patch 18 -p1 -b .clientaddr-error-message
|
|
||||||
%patch 19 -p1 -b .intermediate-certs
|
|
||||||
%patch 20 -p1 -b .remove-des
|
|
||||||
%patch 21 -p1
|
|
||||||
%patch 22 -p1 -b .ipv6-disable-leak
|
|
||||||
%patch 23 -p1 -b .rpmdbpatch
|
|
||||||
%patch 24 -p1
|
|
||||||
%patch 25 -p1 -b .kernel-6.7
|
|
||||||
|
|
||||||
%patch 101 -p1 -b .modern-rpm-api
|
%ifnarch ia64
|
||||||
%patch 102 -p1
|
%patch1 -p1 -b .pie
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%patch2 -p1 -b .dir-fix
|
||||||
|
%patch3 -p1 -b .multilib
|
||||||
|
%patch4 -p1 -b .apsl
|
||||||
|
%patch5 -p1
|
||||||
|
%patch6 -p1 -b .systemd
|
||||||
|
%patch7 -p1 -b .multilib
|
||||||
|
%patch8 -p1 -b .autoreconf
|
||||||
|
%patch9 -p1 -b .agentx-crash
|
||||||
|
%patch10 -p1 -b .agentx-disconnect-crash
|
||||||
|
%patch11 -p1 -b .cert-path
|
||||||
|
%patch12 -p1 -b .snmpstatus-null
|
||||||
|
%patch13 -p1 -b .cflags
|
||||||
|
%patch14 -p1 -b .U64
|
||||||
|
%patch15 -p1 -b .make
|
||||||
|
%patch16 -p1 -b .strtok-r
|
||||||
|
%patch17 -p1 -b .mysqllib
|
||||||
|
|
||||||
|
%ifarch sparc64 s390 s390x
|
||||||
# disable failing test - see https://bugzilla.redhat.com/show_bug.cgi?id=680697
|
# disable failing test - see https://bugzilla.redhat.com/show_bug.cgi?id=680697
|
||||||
rm testing/fulltests/default/T200*
|
rm testing/fulltests/default/T200*
|
||||||
|
%endif
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
|
||||||
@ -270,31 +253,31 @@ MIBS="$MIBS ucd-snmp/lmsensorsMib"
|
|||||||
|
|
||||||
%configure \
|
%configure \
|
||||||
--disable-static --enable-shared \
|
--disable-static --enable-shared \
|
||||||
--enable-as-needed \
|
--with-cflags="$RPM_OPT_FLAGS -D_RPM_4_4_COMPAT" \
|
||||||
--enable-blumenthal-aes \
|
--with-ldflags="-Wl,-z,relro -Wl,-z,now" \
|
||||||
--enable-embedded-perl \
|
|
||||||
--enable-ipv6 \
|
|
||||||
--enable-local-smux \
|
|
||||||
--enable-mfd-rewrites \
|
|
||||||
--enable-ucd-snmp-compatibility \
|
|
||||||
--disable-des \
|
|
||||||
--sysconfdir=%{_sysconfdir} \
|
|
||||||
--with-cflags="$RPM_OPT_FLAGS -fPIE" \
|
|
||||||
--with-ldflags="$RPM_LD_FLAGS -lm" \
|
|
||||||
--with-logfile="/var/log/snmpd.log" \
|
|
||||||
--with-mib-modules="$MIBS" \
|
|
||||||
--with-mysql \
|
|
||||||
--with-openssl \
|
|
||||||
--with-persistent-directory="/var/lib/net-snmp" \
|
|
||||||
--with-perl-modules="INSTALLDIRS=vendor" \
|
|
||||||
--with-pic \
|
|
||||||
--with-security-modules=tsm \
|
|
||||||
--with-sys-location="Unknown" \
|
--with-sys-location="Unknown" \
|
||||||
--with-systemd \
|
--with-logfile="/var/log/snmpd.log" \
|
||||||
--with-temp-file-pattern=/run/net-snmp/snmp-tmp-XXXXXX \
|
--with-persistent-directory="/var/lib/net-snmp" \
|
||||||
|
--with-mib-modules="$MIBS" \
|
||||||
|
%if %{netsnmp_tcp_wrappers}
|
||||||
|
--with-libwrap=yes \
|
||||||
|
%endif
|
||||||
|
--sysconfdir=%{_sysconfdir} \
|
||||||
|
--enable-ipv6 \
|
||||||
|
--enable-ucd-snmp-compatibility \
|
||||||
|
--with-openssl \
|
||||||
|
--with-pic \
|
||||||
|
--enable-embedded-perl \
|
||||||
|
--enable-as-needed \
|
||||||
|
--with-perl-modules="INSTALLDIRS=vendor" \
|
||||||
|
--enable-mfd-rewrites \
|
||||||
|
--enable-local-smux \
|
||||||
|
--with-temp-file-pattern=/var/run/net-snmp/snmp-tmp-XXXXXX \
|
||||||
--with-transports="DTLSUDP TLSTCP" \
|
--with-transports="DTLSUDP TLSTCP" \
|
||||||
--with-sys-contact="root@localhost" \
|
--with-security-modules=tsm \
|
||||||
--without-pcre <<EOF
|
--with-mysql \
|
||||||
|
--with-systemd \
|
||||||
|
--with-sys-contact="root@localhost" <<EOF
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# store original libtool file, we will need it later
|
# store original libtool file, we will need it later
|
||||||
@ -304,19 +287,20 @@ sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
|
|||||||
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
|
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
|
||||||
|
|
||||||
# the package is not %%_smp_mflags safe
|
# the package is not %%_smp_mflags safe
|
||||||
%{__make}
|
make
|
||||||
|
|
||||||
# remove rpath from compiled perl libs
|
# remove rpath from compiled perl libs
|
||||||
find perl/blib -type f -name "*.so" -print -exec chrpath --delete {} \;
|
find perl/blib -type f -name "*.so" -print -exec chrpath --delete {} \;
|
||||||
|
|
||||||
# compile python module
|
# compile python module
|
||||||
pushd python
|
pushd python
|
||||||
%{__python3} setup.py --basedir="../" build
|
%{__python} setup.py --basedir="../" build
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
make install DESTDIR=%{buildroot}
|
rm -rf ${RPM_BUILD_ROOT}
|
||||||
|
make install DESTDIR=${RPM_BUILD_ROOT}
|
||||||
|
|
||||||
# Determine which arch net-snmp-config.h is going to try to #include.
|
# Determine which arch net-snmp-config.h is going to try to #include.
|
||||||
basearch=%{_arch}
|
basearch=%{_arch}
|
||||||
@ -328,39 +312,44 @@ basearch=i386
|
|||||||
# Do an net-snmp-config.h switcheroo to avoid file conflicts on systems where you
|
# Do an net-snmp-config.h switcheroo to avoid file conflicts on systems where you
|
||||||
# can have both a 32- and 64-bit version of the library, as they each need
|
# can have both a 32- and 64-bit version of the library, as they each need
|
||||||
# their own correct-but-different versions of net-snmp-config.h to be usable.
|
# their own correct-but-different versions of net-snmp-config.h to be usable.
|
||||||
mv %{buildroot}/%{_bindir}/net-snmp-config %{buildroot}/%{_bindir}/net-snmp-config-${basearch}
|
mv ${RPM_BUILD_ROOT}/%{_bindir}/net-snmp-config ${RPM_BUILD_ROOT}/%{_bindir}/net-snmp-config-${basearch}
|
||||||
install -m 755 %SOURCE3 %{buildroot}/%{_bindir}/net-snmp-config
|
install -m 755 %SOURCE5 ${RPM_BUILD_ROOT}/%{_bindir}/net-snmp-config
|
||||||
mv %{buildroot}/%{_includedir}/net-snmp/net-snmp-config.h %{buildroot}/%{_includedir}/net-snmp/net-snmp-config-${basearch}.h
|
mv ${RPM_BUILD_ROOT}/%{_includedir}/net-snmp/net-snmp-config.h ${RPM_BUILD_ROOT}/%{_includedir}/net-snmp/net-snmp-config-${basearch}.h
|
||||||
install -m644 %SOURCE2 %{buildroot}/%{_includedir}/net-snmp/net-snmp-config.h
|
install -m644 %SOURCE4 ${RPM_BUILD_ROOT}/%{_includedir}/net-snmp/net-snmp-config.h
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
install -d %{buildroot}%{_sysconfdir}/snmp
|
install -d ${RPM_BUILD_ROOT}%{_sysconfdir}/snmp
|
||||||
install -m 644 %SOURCE1 %{buildroot}%{_sysconfdir}/snmp/snmpd.conf
|
install -m 644 %SOURCE1 ${RPM_BUILD_ROOT}%{_sysconfdir}/snmp/snmpd.conf
|
||||||
install -m 644 %SOURCE4 %{buildroot}%{_sysconfdir}/snmp/snmptrapd.conf
|
install -m 644 %SOURCE6 ${RPM_BUILD_ROOT}%{_sysconfdir}/snmp/snmptrapd.conf
|
||||||
|
|
||||||
install -d %{buildroot}%{_sysconfdir}/sysconfig
|
%if 0%{?fedora} < 23
|
||||||
install -m 644 %SOURCE5 %{buildroot}%{_sysconfdir}/sysconfig/snmpd
|
install -d ${RPM_BUILD_ROOT}%{_initrddir}
|
||||||
install -m 644 %SOURCE6 %{buildroot}%{_sysconfdir}/sysconfig/snmptrapd
|
install -m 755 %SOURCE2 ${RPM_BUILD_ROOT}%{_initrddir}/snmpd
|
||||||
|
install -m 755 %SOURCE3 ${RPM_BUILD_ROOT}%{_initrddir}/snmptrapd
|
||||||
|
%endif
|
||||||
|
|
||||||
|
install -d ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig
|
||||||
|
install -m 644 %SOURCE7 ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/snmpd
|
||||||
|
install -m 644 %SOURCE8 ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/snmptrapd
|
||||||
|
|
||||||
# prepare /var/lib/net-snmp
|
# prepare /var/lib/net-snmp
|
||||||
install -d %{buildroot}%{_localstatedir}/lib/net-snmp
|
install -d ${RPM_BUILD_ROOT}%{_localstatedir}/lib/net-snmp
|
||||||
install -d %{buildroot}%{_localstatedir}/lib/net-snmp/mib_indexes
|
install -d ${RPM_BUILD_ROOT}%{_localstatedir}/lib/net-snmp/mib_indexes
|
||||||
install -d %{buildroot}%{_localstatedir}/lib/net-snmp/cert_indexes
|
install -d ${RPM_BUILD_ROOT}%{_localstatedir}/lib/net-snmp/cert_indexes
|
||||||
install -d %{buildroot}%{_localstatedir}/run/net-snmp
|
install -d ${RPM_BUILD_ROOT}%{_localstatedir}/run/net-snmp
|
||||||
|
|
||||||
# remove things we don't want to distribute
|
# remove things we don't want to distribute
|
||||||
rm -f %{buildroot}%{_bindir}/snmpinform
|
rm -f ${RPM_BUILD_ROOT}%{_bindir}/snmpinform
|
||||||
ln -s snmptrap %{buildroot}/usr/bin/snmpinform
|
ln -s snmptrap ${RPM_BUILD_ROOT}/usr/bin/snmpinform
|
||||||
rm -f %{buildroot}%{_bindir}/snmpcheck
|
rm -f ${RPM_BUILD_ROOT}%{_bindir}/snmpcheck
|
||||||
rm -f %{buildroot}/%{_bindir}/fixproc
|
rm -f ${RPM_BUILD_ROOT}/%{_bindir}/fixproc
|
||||||
rm -f %{buildroot}/%{_mandir}/man1/fixproc*
|
rm -f ${RPM_BUILD_ROOT}/%{_mandir}/man1/fixproc*
|
||||||
rm -f %{buildroot}/%{_bindir}/ipf-mod.pl
|
rm -f ${RPM_BUILD_ROOT}/%{_bindir}/ipf-mod.pl
|
||||||
rm -f %{buildroot}/%{_libdir}/*.la
|
rm -f ${RPM_BUILD_ROOT}/%{_libdir}/*.la
|
||||||
rm -f %{buildroot}/%{_libdir}/libsnmp*
|
rm -f ${RPM_BUILD_ROOT}/%{_libdir}/libsnmp*
|
||||||
rm -f %{buildroot}/%{_libdir}/perl5/vendor_perl/Bundle/MakefileSubs.pm
|
|
||||||
|
|
||||||
# remove special perl files
|
# remove special perl files
|
||||||
find %{buildroot} -name perllocal.pod \
|
find $RPM_BUILD_ROOT -name perllocal.pod \
|
||||||
-o -name .packlist \
|
-o -name .packlist \
|
||||||
-o -name "*.bs" \
|
-o -name "*.bs" \
|
||||||
-o -name Makefile.subs.pl \
|
-o -name Makefile.subs.pl \
|
||||||
@ -369,14 +358,14 @@ find %{buildroot} -name perllocal.pod \
|
|||||||
rm -f README.aix README.hpux11 README.osX README.Panasonic_AM3X.txt README.solaris README.win32
|
rm -f README.aix README.hpux11 README.osX README.Panasonic_AM3X.txt README.solaris README.win32
|
||||||
|
|
||||||
# copy missing mib2c.conf files
|
# copy missing mib2c.conf files
|
||||||
install -m 644 local/mib2c.*.conf %{buildroot}%{_datadir}/snmp
|
install -m 644 local/mib2c.*.conf ${RPM_BUILD_ROOT}%{_datadir}/snmp
|
||||||
|
|
||||||
# install python module
|
# install python module
|
||||||
pushd python
|
pushd python
|
||||||
%{__python3} setup.py --basedir=.. install -O1 --skip-build --root %{buildroot}
|
%{__python} setup.py --basedir=.. install -O1 --skip-build --root $RPM_BUILD_ROOT
|
||||||
popd
|
popd
|
||||||
|
|
||||||
find %{buildroot} -name '*.so' | xargs chmod 0755
|
find $RPM_BUILD_ROOT -name '*.so' | xargs chmod 0755
|
||||||
|
|
||||||
# trim down massive ChangeLog
|
# trim down massive ChangeLog
|
||||||
dd bs=1024 count=250 if=ChangeLog of=ChangeLog.trimmed
|
dd bs=1024 count=250 if=ChangeLog of=ChangeLog.trimmed
|
||||||
@ -390,11 +379,15 @@ done
|
|||||||
# remove executable bit from documentation samples
|
# remove executable bit from documentation samples
|
||||||
chmod 644 local/passtest local/ipf-mod.pl
|
chmod 644 local/passtest local/ipf-mod.pl
|
||||||
|
|
||||||
|
# dirty hack for #603243, until it's fixed properly upstream
|
||||||
|
install -m 755 -d $RPM_BUILD_ROOT/usr/include/net-snmp/agent/util_funcs
|
||||||
|
install -m 644 agent/mibgroup/util_funcs/*.h $RPM_BUILD_ROOT/usr/include/net-snmp/agent/util_funcs
|
||||||
|
|
||||||
# systemd stuff
|
# systemd stuff
|
||||||
install -m 755 -d %{buildroot}/%{_tmpfilesdir}
|
install -m 755 -d $RPM_BUILD_ROOT/%{_tmpfilesdir}
|
||||||
install -m 644 %SOURCE7 %{buildroot}/%{_tmpfilesdir}/net-snmp.conf
|
install -m 644 %SOURCE9 $RPM_BUILD_ROOT/%{_tmpfilesdir}/net-snmp.conf
|
||||||
install -m 755 -d %{buildroot}/%{_unitdir}
|
install -m 755 -d $RPM_BUILD_ROOT/%{_unitdir}
|
||||||
install -m 644 %SOURCE8 %SOURCE9 %{buildroot}/%{_unitdir}/
|
install -m 644 %SOURCE10 %SOURCE11 $RPM_BUILD_ROOT/%{_unitdir}/
|
||||||
|
|
||||||
%check
|
%check
|
||||||
%if %{netsnmp_check}
|
%if %{netsnmp_check}
|
||||||
@ -406,8 +399,7 @@ cp -f libtool.orig libtool
|
|||||||
# temporary workaround to make test "extending agent functionality with pass" working
|
# temporary workaround to make test "extending agent functionality with pass" working
|
||||||
chmod 755 local/passtest
|
chmod 755 local/passtest
|
||||||
|
|
||||||
LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test
|
LD_LIBRARY_PATH=${RPM_BUILD_ROOT}/%{_libdir} make test
|
||||||
|
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
|
||||||
@ -421,8 +413,35 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test
|
|||||||
%postun
|
%postun
|
||||||
%systemd_postun_with_restart snmpd.service snmptrapd.service
|
%systemd_postun_with_restart snmpd.service snmptrapd.service
|
||||||
|
|
||||||
%ldconfig_scriptlets libs
|
|
||||||
%ldconfig_scriptlets agent-libs
|
%triggerun -- net-snmp < 1:5.7-5
|
||||||
|
# Convert SysV -> systemd.
|
||||||
|
# Save the current service runlevel info,
|
||||||
|
# User must manually run systemd-sysv-convert --apply snmpd
|
||||||
|
# to migrate them to systemd targets
|
||||||
|
/usr/bin/systemd-sysv-convert --save snmpd >/dev/null 2>&1 ||:
|
||||||
|
/usr/bin/systemd-sysv-convert --save snmptrapd >/dev/null 2>&1 ||:
|
||||||
|
/sbin/chkconfig --del snmpd >/dev/null 2>&1 || :
|
||||||
|
/sbin/chkconfig --del snmptrapd >/dev/null 2>&1 || :
|
||||||
|
/bin/systemctl try-restart snmpd.service >/dev/null 2>&1 || :
|
||||||
|
/bin/systemctl try-restart snmptrapd.service >/dev/null 2>&1 || :
|
||||||
|
|
||||||
|
%if 0%{?fedora} < 23
|
||||||
|
%triggerpostun -n net-snmp-sysvinit -- net-snmp < 1:5.7-5
|
||||||
|
/sbin/chkconfig --add snmpd >/dev/null 2>&1 || :
|
||||||
|
/sbin/chkconfig --add snmptrapd >/dev/null 2>&1 || :
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%post libs -p /sbin/ldconfig
|
||||||
|
|
||||||
|
%postun libs -p /sbin/ldconfig
|
||||||
|
|
||||||
|
%post agent-libs -p /sbin/ldconfig
|
||||||
|
|
||||||
|
%postun agent-libs -p /sbin/ldconfig
|
||||||
|
|
||||||
|
%clean
|
||||||
|
rm -rf ${RPM_BUILD_ROOT}
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%doc COPYING ChangeLog.trimmed EXAMPLE.conf FAQ NEWS TODO
|
%doc COPYING ChangeLog.trimmed EXAMPLE.conf FAQ NEWS TODO
|
||||||
@ -461,35 +480,31 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test
|
|||||||
|
|
||||||
%files devel
|
%files devel
|
||||||
%{_libdir}/lib*.so
|
%{_libdir}/lib*.so
|
||||||
%{_libdir}/pkgconfig/*
|
/usr/include/*
|
||||||
%{_includedir}/*
|
|
||||||
%attr(0644,root,root) %{_mandir}/man3/*.3.*
|
%attr(0644,root,root) %{_mandir}/man3/*.3.*
|
||||||
%attr(0755,root,root) %{_bindir}/net-snmp-config*
|
%attr(0755,root,root) %{_bindir}/net-snmp-config*
|
||||||
%attr(0644,root,root) %{_mandir}/man1/net-snmp-config*.1.*
|
%attr(0644,root,root) %{_mandir}/man1/net-snmp-config*.1.*
|
||||||
|
|
||||||
%files perl-module
|
|
||||||
%attr(0644,root,root) %{_mandir}/man3/*.3pm.*
|
|
||||||
%{perl_vendorarch}/*SNMP*
|
|
||||||
%{perl_vendorarch}/auto/*SNMP*
|
|
||||||
%{perl_vendorarch}/auto/Bundle/*SNMP*
|
|
||||||
|
|
||||||
%files perl
|
%files perl
|
||||||
%{_bindir}/mib2c-update
|
%{_bindir}/mib2c-update
|
||||||
%{_bindir}/mib2c
|
%{_bindir}/mib2c
|
||||||
%{_bindir}/snmp-bridge-mib
|
%{_bindir}/snmp-bridge-mib
|
||||||
%{_bindir}/net-snmp-cert
|
%{_bindir}/net-snmp-cert
|
||||||
%{_bindir}/checkbandwidth
|
|
||||||
%dir %{_datadir}/snmp
|
%dir %{_datadir}/snmp
|
||||||
%{_datadir}/snmp/mib2c*
|
%{_datadir}/snmp/mib2c*
|
||||||
%{_datadir}/snmp/*.pl
|
%{_datadir}/snmp/*.pl
|
||||||
%{_bindir}/traptoemail
|
%{_bindir}/traptoemail
|
||||||
%attr(0644,root,root) %{_mandir}/man[15]/mib2c*
|
%attr(0644,root,root) %{_mandir}/man[15]/mib2c*
|
||||||
|
%attr(0644,root,root) %{_mandir}/man3/*.3pm.*
|
||||||
%attr(0644,root,root) %{_mandir}/man1/traptoemail*.1*
|
%attr(0644,root,root) %{_mandir}/man1/traptoemail*.1*
|
||||||
%attr(0644,root,root) %{_mandir}/man1/snmp-bridge-mib.1*
|
%attr(0644,root,root) %{_mandir}/man1/snmp-bridge-mib.1*
|
||||||
|
%{perl_vendorarch}/*SNMP*
|
||||||
|
%{perl_vendorarch}/auto/*SNMP*
|
||||||
|
%{perl_vendorarch}/auto/Bundle/*SNMP*
|
||||||
|
|
||||||
%files -n python3-net-snmp
|
%files python
|
||||||
%doc README
|
%doc README
|
||||||
%{python3_sitearch}/*
|
%{python_sitearch}/*
|
||||||
|
|
||||||
%files gui
|
%files gui
|
||||||
%{_bindir}/tkmib
|
%{_bindir}/tkmib
|
||||||
@ -498,7 +513,7 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test
|
|||||||
%files libs
|
%files libs
|
||||||
%doc COPYING README ChangeLog.trimmed FAQ NEWS TODO
|
%doc COPYING README ChangeLog.trimmed FAQ NEWS TODO
|
||||||
%doc IETF-MIB-LICENSE.txt
|
%doc IETF-MIB-LICENSE.txt
|
||||||
%{_libdir}/libnetsnmp.so.%{soname}*
|
%{_libdir}/libnetsnmp.so.*
|
||||||
%dir %{_datadir}/snmp
|
%dir %{_datadir}/snmp
|
||||||
%dir %{_datadir}/snmp/mibs
|
%dir %{_datadir}/snmp/mibs
|
||||||
%{_datadir}/snmp/mibs/*
|
%{_datadir}/snmp/mibs/*
|
||||||
@ -507,350 +522,23 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test
|
|||||||
%dir %{_localstatedir}/lib/net-snmp/cert_indexes
|
%dir %{_localstatedir}/lib/net-snmp/cert_indexes
|
||||||
|
|
||||||
%files agent-libs
|
%files agent-libs
|
||||||
%{_libdir}/libnetsnmpagent*.so.%{soname}*
|
%{_libdir}/libnetsnmpagent*.so.*
|
||||||
%{_libdir}/libnetsnmphelpers*.so.%{soname}*
|
%{_libdir}/libnetsnmphelpers*.so.*
|
||||||
%{_libdir}/libnetsnmpmibs*.so.%{soname}*
|
%{_libdir}/libnetsnmpmibs*.so.*
|
||||||
%{_libdir}/libnetsnmptrapd*.so.%{soname}*
|
%{_libdir}/libnetsnmptrapd*.so.*
|
||||||
|
|
||||||
|
%if 0%{?fedora} < 23
|
||||||
|
%files sysvinit
|
||||||
|
%{_initrddir}/snmpd
|
||||||
|
%{_initrddir}/snmptrapd
|
||||||
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Thu Jul 18 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1:5.9.4-8
|
* Wed Jul 26 2017 Josef Ridky <jridky@redhat.com> - 1:5.7.3-15
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
|
- Update mysqllib patch with upstream reported version (#1470004)
|
||||||
|
|
||||||
* Wed Jun 12 2024 Jitka Plesnikova <jplesnik@redhat.com> - 1:5.9.4-7
|
* Thu Jul 13 2017 Josef Ridky <jridky@redhat.com> - 1:5.7.3-14
|
||||||
- Perl 5.40 rebuild
|
- Fix perl issue with use NetSNMP::TrapReceiver (add link to libmysqlclient.so) (#1470004)
|
||||||
|
|
||||||
* Fri Jun 07 2024 Python Maint <python-maint@redhat.com> - 1:5.9.4-6
|
|
||||||
- Rebuilt for Python 3.13
|
|
||||||
|
|
||||||
* Tue Mar 12 2024 Josef Ridky <jridky@redhat.com> - 1:5.9.4-5
|
|
||||||
- Fix parsing issue for kernel 6.7+ (#2266893)
|
|
||||||
|
|
||||||
* Fri Feb 16 2024 Josef Ridky <jridky@redhat.com> - 1:5.9.4-4
|
|
||||||
- Autoconf upgrade (#2256768)
|
|
||||||
|
|
||||||
* Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1:5.9.4-3
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
|
|
||||||
|
|
||||||
* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1:5.9.4-2
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
|
|
||||||
|
|
||||||
* Wed Aug 16 2023 Josef Ridky <jridky@redhat.com> - 1:5.9.4-1
|
|
||||||
- New upstream release 5.9.4 (#2184202)
|
|
||||||
|
|
||||||
* Mon Aug 14 2023 Josef Ridky <jridky@redhat.com> - 1:5.9.3-8
|
|
||||||
- Fix warning for RPM DB
|
|
||||||
- split perl module into separate package that doesn't pull in gcc and
|
|
||||||
other build dependencies (thanks Chris Adams)
|
|
||||||
- don't install MakefileSubs.pm - it's just needed at module build time
|
|
||||||
(thanks Chris Adams)
|
|
||||||
|
|
||||||
* Tue Aug 01 2023 Josef Ridky <jridky@redhat.com> - 1:5.9.3-7
|
|
||||||
- Sync fixes with RHEL
|
|
||||||
- Fix sendmesg error code change for new kernel
|
|
||||||
|
|
||||||
* Wed Jul 19 2023 Josef Ridky <jridky@redhat.com> - 1:5.9.3-6
|
|
||||||
- Migrate to SPDX license format
|
|
||||||
|
|
||||||
* Tue Jul 11 2023 Jitka Plesnikova <jplesnik@redhat.com> - 1:5.9.3-5
|
|
||||||
- Perl 5.38 rebuild
|
|
||||||
|
|
||||||
* Tue Jun 13 2023 Python Maint <python-maint@redhat.com> - 1:5.9.3-4
|
|
||||||
- Rebuilt for Python 3.12
|
|
||||||
|
|
||||||
* Fri May 19 2023 Petr Pisar <ppisar@redhat.com> - 1:5.9.3-3
|
|
||||||
- Rebuild against rpm-4.19 (https://fedoraproject.org/wiki/Changes/RPM-4.19)
|
|
||||||
|
|
||||||
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1:5.9.3-2
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
|
|
||||||
|
|
||||||
* Thu Aug 04 2022 Josef Ridky <jridky@redhat.com> - 1:5.9.3-1
|
|
||||||
- New upstream release 5.9.3 (#2072230)
|
|
||||||
|
|
||||||
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1:5.9.1-17
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
|
|
||||||
|
|
||||||
* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 1:5.9.1-16
|
|
||||||
- Rebuilt for Python 3.11
|
|
||||||
|
|
||||||
* Mon May 30 2022 Jitka Plesnikova <jplesnik@redhat.com> - 1:5.9.1-15
|
|
||||||
- Perl 5.36 rebuild
|
|
||||||
|
|
||||||
* Sat Jan 29 2022 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1:5.9.1-14
|
|
||||||
- Remove linker flags from Libs.private (#2043092)
|
|
||||||
|
|
||||||
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1:5.9.1-13
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
|
|
||||||
|
|
||||||
* Mon Oct 04 2021 Josef Ridky <jridky@redhat.com> - 1:5.9.1-12
|
|
||||||
- fix FTBFS of ERR_get_error (#2008781)
|
|
||||||
|
|
||||||
* Wed Sep 15 2021 Sahana Prasad <sahana@redhat.com> - 1:5.9.1-11
|
|
||||||
- Rebuilt with OpenSSL 3.0.0
|
|
||||||
|
|
||||||
* Wed Sep 15 2021 Josef Ridky <jridky@redhat.com> - 1:5.9.1-10
|
|
||||||
- Remove ERR_GET_FUNC from code (#2004351)
|
|
||||||
|
|
||||||
* Tue Sep 14 2021 Sahana Prasad <sahana@redhat.com> - 1:5.9.1-9
|
|
||||||
- Rebuilt with OpenSSL 3.0.0
|
|
||||||
|
|
||||||
* Wed Sep 01 2021 Josef Ridky <jridky@redhat.com> - 1:5.9.1-8
|
|
||||||
- fix FTBFS (#1999475)
|
|
||||||
|
|
||||||
* Thu Jul 29 2021 Josef Ridky <jridky@redhat.com> - 1:5.9.1-7
|
|
||||||
- revert cflags modification in net-snmp-config as was reverted in upstream
|
|
||||||
and add proper dependency to net-snmp-devel sub-package (#1544527)
|
|
||||||
|
|
||||||
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1:5.9.1-6
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
|
|
||||||
|
|
||||||
* Mon Jul 19 2021 Josef Ridky <jridky@redhat.com> - 1:5.9.1-5
|
|
||||||
- fix UseNumeric in Python library (#1970937)
|
|
||||||
|
|
||||||
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 1:5.9.1-4
|
|
||||||
- Rebuilt for Python 3.10
|
|
||||||
|
|
||||||
* Tue Jun 01 2021 Josef Ridky <jridky@redhat.com> - 1:5.9.1-3
|
|
||||||
- disable DES for F35+
|
|
||||||
|
|
||||||
* Tue Jun 01 2021 Josef Ridky <jridky@redhat.com> - 1:5.9.1-2
|
|
||||||
- restore DES for F34 and F33
|
|
||||||
|
|
||||||
* Wed May 26 2021 Josef Ridky <jridky@redhat.com> - 1:5.9.1-1
|
|
||||||
- New upstream release 5.9.1 (#1946399)
|
|
||||||
- remove DES support
|
|
||||||
|
|
||||||
* Fri May 21 2021 Jitka Plesnikova <jplesnik@redhat.com> - 1:5.9-10
|
|
||||||
- Perl 5.34 rebuild
|
|
||||||
|
|
||||||
* Mon Mar 15 2021 Josef Ridky <jridky@redhat.com> - 1:5.9-9
|
|
||||||
- fix issue with parsing IPv4 address twice
|
|
||||||
|
|
||||||
* Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1:5.9-8
|
|
||||||
- Rebuilt for updated systemd-rpm-macros
|
|
||||||
See https://pagure.io/fesco/issue/2583.
|
|
||||||
|
|
||||||
* Thu Feb 04 2021 Josef Ridky <jridky@redhat.com> - 1:5.9-7
|
|
||||||
- remove file with unsupported license
|
|
||||||
- use make and make install macros
|
|
||||||
|
|
||||||
* Thu Jan 28 2021 Josef Ridky <jridky@redhat.com> - 1:5.9-6
|
|
||||||
- add support for digests detected from ECC certificates
|
|
||||||
- add support for intermediate certificates
|
|
||||||
- fix crash caused by small buffer size
|
|
||||||
|
|
||||||
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1:5.9-5
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
|
||||||
|
|
||||||
* Mon Jan 18 2021 Josef Ridky <jridky@redhat.com> - 1:5.9-4
|
|
||||||
- fix issue with parsing long trap headers (#1912725)
|
|
||||||
- fix error message when the address specified by clientaddr option
|
|
||||||
is wrong or cannot be bound
|
|
||||||
- fix issue with quoting empty passphrase
|
|
||||||
|
|
||||||
* Wed Nov 18 2020 Josef Ridky <jridky@redhat.com> - 1:5.9-3
|
|
||||||
- update net-snmp-tmpfs.conf for /var/run to /run (#1893471)
|
|
||||||
|
|
||||||
* Tue Sep 01 2020 Josef Ridky <jridky@redhat.com> - 1:5.9-2
|
|
||||||
- Disable pcre binding
|
|
||||||
- Add support for available memory report
|
|
||||||
|
|
||||||
* Mon Aug 17 2020 Josef Ridky <jridky@redhat.com> - 1:5.9-1
|
|
||||||
- New upstream release 5.9
|
|
||||||
|
|
||||||
* Tue Aug 04 2020 Josef Ridky <jridky@redhat.com> - 1:5.8-25
|
|
||||||
- link math library to fix FTBFS for hplip (#1863855)
|
|
||||||
|
|
||||||
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1:5.8-24
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
|
||||||
|
|
||||||
* Tue Jul 07 2020 Josef Ridky <jridky@redhat.com> - 1:5.8-23
|
|
||||||
- change /var/run/net-snmp to /run/net-snmp (#1737631)
|
|
||||||
|
|
||||||
* Tue Jul 07 2020 Josef Ridky <jridky@redhat.com> - 1:5.8-22
|
|
||||||
- proxied OIDs unspecified in proxy statement in snmpd.conf
|
|
||||||
- UCD-SNMP-MIB::dskTable doesn't update dynamically
|
|
||||||
- expand SNMPCONFPATH variable
|
|
||||||
- log meningful message on duplicate IP address
|
|
||||||
- memory reporting adjustment
|
|
||||||
- fix typos in man page
|
|
||||||
- speedup ipAddressTable loading
|
|
||||||
- fix memory leak when shut down librpm
|
|
||||||
- services starts after network-online.target
|
|
||||||
- add missing part of memory leak patch
|
|
||||||
- add support for AES192 and AES256
|
|
||||||
- fix net-snmp-config wrapper script (#1815984)
|
|
||||||
|
|
||||||
* Mon Jun 22 2020 Jitka Plesnikova <jplesnik@redhat.com> - 1:5.8-21
|
|
||||||
- Perl 5.32 rebuild
|
|
||||||
|
|
||||||
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 1:5.8-20
|
|
||||||
- Rebuilt for Python 3.9
|
|
||||||
|
|
||||||
* Thu Apr 09 2020 Josef Ridky <jridky@redhat.com> -1:5.8-19
|
|
||||||
- update skip_autofs patch (#1810104)
|
|
||||||
- exit snmpd after snmpd -h command
|
|
||||||
- fix issues found by coverity scan
|
|
||||||
- fix issue with flood messages
|
|
||||||
- fix double free or corruption error when freeing security context
|
|
||||||
|
|
||||||
* Tue Mar 24 2020 Petr Pisar <ppisar@redhat.com> - 1:5.8-18
|
|
||||||
- Build-require Perl dependencies for running the tests
|
|
||||||
|
|
||||||
* Wed Feb 26 2020 Josef Ridky <jridky@redhat.com> - 1:5.8-17
|
|
||||||
- fix config error with RPM library (#1807274)
|
|
||||||
|
|
||||||
* Mon Feb 17 2020 Josef Ridky <jridky@redhat.com> - 1:5.8-16
|
|
||||||
- set net-snmp-devel as requirement for net-snmp-perl
|
|
||||||
|
|
||||||
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1:5.8-15
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
|
||||||
|
|
||||||
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 1:5.8-14
|
|
||||||
- Rebuilt for Python 3.8.0rc1 (#1748018)
|
|
||||||
|
|
||||||
* Thu Sep 19 2019 Josef Ridky <jridky@redhat.com> - 1:5.8-13
|
|
||||||
- Fix snmpv3 trap forwarding (#1753506)
|
|
||||||
|
|
||||||
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 1:5.8-12
|
|
||||||
- Rebuilt for Python 3.8
|
|
||||||
|
|
||||||
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1:5.8-11
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
|
||||||
|
|
||||||
* Fri Jun 28 2019 Josef Ridky <jridky@redhat.com> - 1:5.8-10
|
|
||||||
- remove file with unsupported license
|
|
||||||
- fix daemon crash on resend request (#1663027)
|
|
||||||
- fix issue with trapsink default port
|
|
||||||
|
|
||||||
* Mon Jun 10 22:13:21 CET 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1:5.8-9
|
|
||||||
- Rebuild for RPM 4.15
|
|
||||||
|
|
||||||
* Mon Jun 10 15:42:03 CET 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1:5.8-8
|
|
||||||
- Rebuild for RPM 4.15
|
|
||||||
|
|
||||||
* Thu May 30 2019 Jitka Plesnikova <jplesnik@redhat.com> - 1:5.8-7
|
|
||||||
- Perl 5.30 rebuild
|
|
||||||
|
|
||||||
* Thu Feb 07 2019 Josef Ridky <jridky@redhat.com> - 1:5.8-6
|
|
||||||
- fix IPv6 address assignment for clientaddr option (#1673272)
|
|
||||||
|
|
||||||
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1:5.8-5
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
|
||||||
|
|
||||||
* Mon Jan 14 2019 Björn Esser <besser82@fedoraproject.org> - 1:5.8-4
|
|
||||||
- Rebuilt for libcrypt.so.2 (#1666033)
|
|
||||||
|
|
||||||
* Tue Nov 27 2018 Josef Ridky <jridky@redhat.com> - 1:5.8-3
|
|
||||||
- backport memory leak fixes from upstream
|
|
||||||
- add fPIE to CFLAGS (#1543853)
|
|
||||||
- use default LDFLAGS
|
|
||||||
|
|
||||||
* Mon Jul 23 2018 Josef Ridky <jridky@redhat.com> - 1:5.8-2
|
|
||||||
- fix unresoved error with mysql functions
|
|
||||||
- implement changes to announce soname changes
|
|
||||||
|
|
||||||
* Wed Jul 18 2018 Josef Ridky <jridky@redhat.com> - 1:5.8-1
|
|
||||||
- New upstream release 5.8
|
|
||||||
- remove APSL downstream patch due this copyright is already
|
|
||||||
coveret by part 8 in COPYING file
|
|
||||||
|
|
||||||
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1:5.7.3-42
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
|
||||||
|
|
||||||
* Sat Jul 07 2018 Miro Hrončok <mhroncok@redhat.com> - 1:5.7.3-41
|
|
||||||
- Rebuilt for Python 3.7
|
|
||||||
|
|
||||||
* Wed Jun 27 2018 Jitka Plesnikova <jplesnik@redhat.com> - 1:5.7.3-40
|
|
||||||
- Perl 5.28 rebuild
|
|
||||||
|
|
||||||
* Mon May 21 2018 Josef Ridky <jridky@redhat.com> - 1:5.7.3-39
|
|
||||||
- python3 support draft
|
|
||||||
|
|
||||||
* Mon May 21 2018 Josef Ridky <jridky@redhat.com> - 1:5.7.3-38
|
|
||||||
- revert Python3 support
|
|
||||||
|
|
||||||
* Tue Mar 27 2018 Josef Ridky <jridky@redhat.com> - 1:5.7.3-37
|
|
||||||
- backport upstream patch for structure iterator
|
|
||||||
|
|
||||||
* Thu Mar 08 2018 Josef Ridky <jridky@redhat.com> - 1:5.7.3-36
|
|
||||||
- CVE-2018-1000116 Heap corruption in snmp_pdu_parse (#1552844)
|
|
||||||
|
|
||||||
* Tue Feb 27 2018 Josef Ridky <jridky@redhat.com> - 1:5.7.3-35
|
|
||||||
- compile against Python3
|
|
||||||
- add gcc requirement
|
|
||||||
- remove rm buildroot
|
|
||||||
|
|
||||||
* Fri Feb 16 2018 Josef Ridky <jridky@redhat.com> - 1:5.7.3-34
|
|
||||||
- fix wrong systemd patch (#1545946)
|
|
||||||
|
|
||||||
* Thu Feb 08 2018 Josef Ridky <jridky@redhat.com> - 1:5.7.3-33
|
|
||||||
- Fix strstr() crash when looking for RPM Group tag
|
|
||||||
- Fix wrong usage of structure iterator
|
|
||||||
- Fix issue with statistics from autofs
|
|
||||||
|
|
||||||
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1:5.7.3-32
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
|
|
||||||
|
|
||||||
* Sat Feb 03 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1:5.7.3-31
|
|
||||||
- Switch to %%ldconfig_scriptlets
|
|
||||||
|
|
||||||
* Wed Jan 31 2018 Josef Ridky <jridky@redhat.com> - 1:5.7.3-30
|
|
||||||
- remove Group tag
|
|
||||||
- remove sysvinit package and init files (no longer needed)
|
|
||||||
- fix python2 references and dependencies in spec file
|
|
||||||
|
|
||||||
* Sat Jan 20 2018 Björn Esser <besser82@fedoraproject.org> - 1:5.7.3-29
|
|
||||||
- Rebuilt for switch to libxcrypt
|
|
||||||
|
|
||||||
* Wed Dec 13 2017 Josef Ridky <jridky@redhat.com> - 1:5.7.3-28
|
|
||||||
- remove tcp_wrapper (#1518768)
|
|
||||||
- use mariadb-connector instead of mysql-devel (#1339272)
|
|
||||||
|
|
||||||
* Sun Aug 20 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1:5.7.3-27
|
|
||||||
- Add Provides for the old name without %%_isa
|
|
||||||
|
|
||||||
* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1:5.7.3-26
|
|
||||||
- Python 2 binary package renamed to python2-net-snmp
|
|
||||||
See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
|
|
||||||
|
|
||||||
* Fri Aug 11 2017 Igor Gnatenko <ignatenko@redhat.com> - 1:5.7.3-25
|
|
||||||
- Rebuilt after RPM update (№ 3)
|
|
||||||
|
|
||||||
* Thu Aug 10 2017 Igor Gnatenko <ignatenko@redhat.com> - 1:5.7.3-24
|
|
||||||
- Rebuilt for RPM soname bump
|
|
||||||
|
|
||||||
* Thu Aug 10 2017 Igor Gnatenko <ignatenko@redhat.com> - 1:5.7.3-23
|
|
||||||
- Rebuilt for RPM soname bump
|
|
||||||
|
|
||||||
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1:5.7.3-22
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
|
|
||||||
|
|
||||||
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1:5.7.3-21
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
|
|
||||||
|
|
||||||
* Thu Jul 20 2017 Adam Williamson <awilliam@redhat.com> -1:5.7.3-20
|
|
||||||
- Edit fix of issue with undefined symbol my_progname when try to load
|
|
||||||
NetSNMP::TrapReceiver in perl script (#1470004)
|
|
||||||
|
|
||||||
* Thu Jul 20 2017 Josef Ridky <jridky@redhat.com> - 1:5.7.3-19
|
|
||||||
- Fix issue with undefined symbol my_progname when try to load NetSNMP::TrapReceiver in perl script. (#1470004)
|
|
||||||
|
|
||||||
* Wed Jul 19 2017 Adam Williamson <awilliam@redhat.com> - 1:5.7.3-18
|
|
||||||
- Fix build with MariaDB 10.2
|
|
||||||
|
|
||||||
* Thu Jul 13 2017 Petr Pisar <ppisar@redhat.com> - 1:5.7.3-17
|
|
||||||
- perl dependency renamed to perl-interpreter
|
|
||||||
<https://fedoraproject.org/wiki/Changes/perl_Package_to_Install_Core_Modules>
|
|
||||||
|
|
||||||
* Sun Jun 04 2017 Jitka Plesnikova <jplesnik@redhat.com> - 1:5.7.3-16
|
|
||||||
- Perl 5.26 rebuild
|
|
||||||
|
|
||||||
* Wed Feb 15 2017 Josef Ridky <jridky@redhat.com> - 1:5.7.3-15
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
|
|
||||||
- Add support for new version of OpenSSL library (#1423984)
|
|
||||||
|
|
||||||
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1:5.7.3-14
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
|
|
||||||
|
|
||||||
* Fri Aug 12 2016 Josef Ridky <jridky@redhat.com> - 1:5.7.3-13
|
* Fri Aug 12 2016 Josef Ridky <jridky@redhat.com> - 1:5.7.3-13
|
||||||
- net-snmp.redhat.conf: update default configuration to conform to the best practices (#1359123)
|
- net-snmp.redhat.conf: update default configuration to conform to the best practices (#1359123)
|
||||||
|
115
net-snmpd.init
Executable file
115
net-snmpd.init
Executable file
@ -0,0 +1,115 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# ucd-snmp init file for snmpd
|
||||||
|
#
|
||||||
|
# chkconfig: - 50 50
|
||||||
|
# description: Simple Network Management Protocol (SNMP) Daemon
|
||||||
|
#
|
||||||
|
# processname: /usr/sbin/snmpd
|
||||||
|
# config: /etc/snmp/snmpd.conf
|
||||||
|
# config: /usr/share/snmp/snmpd.conf
|
||||||
|
# pidfile: /var/run/snmpd.pid
|
||||||
|
|
||||||
|
### BEGIN INIT INFO
|
||||||
|
# Provides: snmpd
|
||||||
|
# Required-Start: $local_fs $network
|
||||||
|
# Required-Stop: $local_fs $network
|
||||||
|
# Should-Start:
|
||||||
|
# Should-Stop:
|
||||||
|
# Default-Start:
|
||||||
|
# Default-Stop:
|
||||||
|
# Short-Description: start and stop Net-SNMP daemon
|
||||||
|
# Description: Simple Network Management Protocol (SNMP) Daemon
|
||||||
|
### END INIT INFO
|
||||||
|
|
||||||
|
# source function library
|
||||||
|
. /etc/init.d/functions
|
||||||
|
|
||||||
|
|
||||||
|
OPTIONS="-LS0-6d -Lf /dev/null -p /var/run/snmpd.pid"
|
||||||
|
if [ -e /etc/sysconfig/snmpd ]; then
|
||||||
|
. /etc/sysconfig/snmpd
|
||||||
|
fi
|
||||||
|
|
||||||
|
RETVAL=0
|
||||||
|
prog="snmpd"
|
||||||
|
binary=/usr/sbin/snmpd
|
||||||
|
pidfile=/var/run/snmpd.pid
|
||||||
|
|
||||||
|
start() {
|
||||||
|
[ -x $binary ] || exit 5
|
||||||
|
echo -n $"Starting $prog: "
|
||||||
|
if [ $UID -ne 0 ]; then
|
||||||
|
RETVAL=1
|
||||||
|
failure
|
||||||
|
else
|
||||||
|
daemon --pidfile=$pidfile $binary $OPTIONS
|
||||||
|
RETVAL=$?
|
||||||
|
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/snmpd
|
||||||
|
fi;
|
||||||
|
echo
|
||||||
|
return $RETVAL
|
||||||
|
}
|
||||||
|
|
||||||
|
stop() {
|
||||||
|
echo -n $"Stopping $prog: "
|
||||||
|
if [ $UID -ne 0 ]; then
|
||||||
|
RETVAL=1
|
||||||
|
failure
|
||||||
|
else
|
||||||
|
killproc -p $pidfile $binary
|
||||||
|
RETVAL=$?
|
||||||
|
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/snmpd
|
||||||
|
fi;
|
||||||
|
echo
|
||||||
|
return $RETVAL
|
||||||
|
}
|
||||||
|
|
||||||
|
reload(){
|
||||||
|
echo -n $"Reloading $prog: "
|
||||||
|
killproc -p $pidfile $binary -HUP
|
||||||
|
RETVAL=$?
|
||||||
|
echo
|
||||||
|
return $RETVAL
|
||||||
|
}
|
||||||
|
|
||||||
|
restart(){
|
||||||
|
stop
|
||||||
|
start
|
||||||
|
}
|
||||||
|
|
||||||
|
condrestart(){
|
||||||
|
[ -e /var/lock/subsys/snmpd ] && restart
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start)
|
||||||
|
start
|
||||||
|
RETVAL=$?
|
||||||
|
;;
|
||||||
|
stop)
|
||||||
|
stop
|
||||||
|
RETVAL=$?
|
||||||
|
;;
|
||||||
|
restart)
|
||||||
|
restart
|
||||||
|
RETVAL=$?
|
||||||
|
;;
|
||||||
|
reload|force-reload)
|
||||||
|
reload
|
||||||
|
RETVAL=$?
|
||||||
|
;;
|
||||||
|
condrestart|try-restart)
|
||||||
|
condrestart
|
||||||
|
RETVAL=$?
|
||||||
|
;;
|
||||||
|
status)
|
||||||
|
status snmpd
|
||||||
|
RETVAL=$?
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload}"
|
||||||
|
RETVAL=2
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit $RETVAL
|
103
net-snmptrapd.init
Executable file
103
net-snmptrapd.init
Executable file
@ -0,0 +1,103 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# ucd-snmp init file for snmptrapd
|
||||||
|
#
|
||||||
|
# chkconfig: - 50 50
|
||||||
|
# description: Simple Network Management Protocol (SNMP) Trap Daemon
|
||||||
|
#
|
||||||
|
# processname: /usr/sbin/snmptrapd
|
||||||
|
# config: /etc/snmp/snmptrapd.conf
|
||||||
|
# config: /usr/share/snmp/snmptrapd.conf
|
||||||
|
# pidfile: /var/run/snmptrapd.pid
|
||||||
|
|
||||||
|
|
||||||
|
### BEGIN INIT INFO
|
||||||
|
# Provides: snmptrapd
|
||||||
|
# Required-Start: $local_fs $network
|
||||||
|
# Required-Stop: $local_fs $network
|
||||||
|
# Should-Start:
|
||||||
|
# Should-Stop:
|
||||||
|
# Default-Start:
|
||||||
|
# Default-Stop:
|
||||||
|
# Short-Description: start and stop Net-SNMP trap daemon
|
||||||
|
# Description: Simple Network Management Protocol (SNMP) trap daemon
|
||||||
|
### END INIT INFO
|
||||||
|
|
||||||
|
# source function library
|
||||||
|
. /etc/init.d/functions
|
||||||
|
|
||||||
|
OPTIONS="-Lsd -p /var/run/snmptrapd.pid"
|
||||||
|
if [ -e /etc/sysconfig/snmptrapd ]; then
|
||||||
|
. /etc/sysconfig/snmptrapd
|
||||||
|
fi
|
||||||
|
|
||||||
|
RETVAL=0
|
||||||
|
prog="snmptrapd"
|
||||||
|
binary=/usr/sbin/snmptrapd
|
||||||
|
pidfile=/var/run/snmptrapd.pid
|
||||||
|
|
||||||
|
start() {
|
||||||
|
[ -x $binary ] || exit 5
|
||||||
|
echo -n $"Starting $prog: "
|
||||||
|
daemon --pidfile=$pidfile /usr/sbin/snmptrapd $OPTIONS
|
||||||
|
RETVAL=$?
|
||||||
|
echo
|
||||||
|
touch /var/lock/subsys/snmptrapd
|
||||||
|
return $RETVAL
|
||||||
|
}
|
||||||
|
|
||||||
|
stop() {
|
||||||
|
echo -n $"Stopping $prog: "
|
||||||
|
killproc -p $pidfile /usr/sbin/snmptrapd
|
||||||
|
RETVAL=$?
|
||||||
|
echo
|
||||||
|
rm -f /var/lock/subsys/snmptrapd
|
||||||
|
return $RETVAL
|
||||||
|
}
|
||||||
|
|
||||||
|
reload(){
|
||||||
|
stop
|
||||||
|
start
|
||||||
|
}
|
||||||
|
|
||||||
|
restart(){
|
||||||
|
stop
|
||||||
|
start
|
||||||
|
}
|
||||||
|
|
||||||
|
condrestart(){
|
||||||
|
[ -e /var/lock/subsys/snmptrapd ] && restart
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start)
|
||||||
|
start
|
||||||
|
RETVAL=$?
|
||||||
|
;;
|
||||||
|
stop)
|
||||||
|
stop
|
||||||
|
RETVAL=$?
|
||||||
|
;;
|
||||||
|
restart)
|
||||||
|
restart
|
||||||
|
RETVAL=$?
|
||||||
|
;;
|
||||||
|
reload|force-reload)
|
||||||
|
reload
|
||||||
|
RETVAL=$?
|
||||||
|
;;
|
||||||
|
condrestart|try-restart)
|
||||||
|
condrestart
|
||||||
|
RETVAL=$?
|
||||||
|
;;
|
||||||
|
status)
|
||||||
|
status snmptrapd
|
||||||
|
RETVAL=$?
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload}"
|
||||||
|
RETVAL=2
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit $RETVAL
|
@ -1,6 +1,6 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Simple Network Management Protocol (SNMP) Daemon.
|
Description=Simple Network Management Protocol (SNMP) Daemon.
|
||||||
After=syslog.target network-online.target
|
After=syslog.target network.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=notify
|
Type=notify
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Simple Network Management Protocol (SNMP) Trap Daemon.
|
Description=Simple Network Management Protocol (SNMP) Trap Daemon.
|
||||||
After=syslog.target network-online.target
|
After=syslog.target network.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=notify
|
Type=notify
|
||||||
|
2
sources
2
sources
@ -1 +1 @@
|
|||||||
SHA512 (net-snmp-5.9.4.tar.gz) = a510fa91a21e9ddc86a12fd1d0bc6b356e63f3ea53f184d2e31439004d41d902390664134dc40b3b828eabb4282eaf3da628a07c4d480fa00eff7e700950c423
|
d4a3459e1577d0efa8d96ca70a885e53 net-snmp-5.7.3.tar.gz
|
||||||
|
@ -1,36 +0,0 @@
|
|||||||
# SPDX-License-Identifier: LGPL-2.1+
|
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
#
|
|
||||||
# Makefile of /CoreOS/net-snmp
|
|
||||||
# Description: Test if net-snmp working ok
|
|
||||||
# Author: Susant Sahani<susant@redhat.com>
|
|
||||||
#
|
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
export TEST=/CoreOS/net-snmp
|
|
||||||
export TESTVERSION=1.0
|
|
||||||
BUILT_FILES=
|
|
||||||
FILES=$(METADATA) runtest.sh Makefile PURPOSE
|
|
||||||
.PHONY: all install download clean
|
|
||||||
run: $(FILES) build
|
|
||||||
./runtest.sh
|
|
||||||
build: $(BUILT_FILES)
|
|
||||||
test -x runtest.sh || chmod a+x runtest.sh
|
|
||||||
clean:
|
|
||||||
rm -f *~ $(BUILT_FILES)
|
|
||||||
include /usr/share/rhts/lib/rhts-make.include
|
|
||||||
$(METADATA): Makefile
|
|
||||||
@echo "Owner: Susant Sahani<susant@redhat.com>" > $(METADATA)
|
|
||||||
@echo "Name: $(TEST)" >> $(METADATA)
|
|
||||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
|
||||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
|
||||||
@echo "Description: Test snmpd" >> $(METADATA)
|
|
||||||
@echo "Type: Sanity" >> $(METADATA)
|
|
||||||
@echo "TestTime: 5m" >> $(METADATA)
|
|
||||||
@echo "RunFor: net-snmp" >> $(METADATA)
|
|
||||||
@echo "Requires: net=snmp" >> $(METADATA)
|
|
||||||
@echo "Priority: Normal" >> $(METADATA)
|
|
||||||
@echo "License: GPLv2" >> $(METADATA)
|
|
||||||
@echo "Confidential: no" >> $(METADATA)
|
|
||||||
@echo "Destructive: no" >> $(METADATA)
|
|
||||||
@echo "Releases: -Fedora 28" >> $(METADATA)
|
|
||||||
rhts-lint $(METADATA)
|
|
@ -1,3 +0,0 @@
|
|||||||
PURPOSE of /CoreOS/net-snmp
|
|
||||||
Description: tests for net-snmp
|
|
||||||
Author: Susant Sahani<susant@redhat.com>
|
|
@ -1,175 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
# SPDX-License-Identifier: LGPL-2.1+
|
|
||||||
# ~~~
|
|
||||||
# Description: Tests for snmpd
|
|
||||||
#
|
|
||||||
# Author: Susant Sahani <susant@redhat.com>
|
|
||||||
# Copyright (c) 2018 Red Hat, Inc.
|
|
||||||
# ~~~
|
|
||||||
|
|
||||||
import errno
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
import time
|
|
||||||
import unittest
|
|
||||||
import subprocess
|
|
||||||
import signal
|
|
||||||
import shutil
|
|
||||||
import psutil
|
|
||||||
import socket
|
|
||||||
import platform
|
|
||||||
import re
|
|
||||||
from pyroute2 import IPRoute
|
|
||||||
from psutil import virtual_memory
|
|
||||||
from collections import OrderedDict
|
|
||||||
|
|
||||||
HOST='192.168.111.50'
|
|
||||||
|
|
||||||
def setUpModule():
|
|
||||||
"""Initialize the environment, and perform sanity checks on it."""
|
|
||||||
|
|
||||||
if shutil.which('snmpd') is None:
|
|
||||||
raise OSError(errno.ENOENT, 'snmpd not found')
|
|
||||||
|
|
||||||
if shutil.which('snmpwalk') is None:
|
|
||||||
raise OSError(errno.ENOENT, 'snmpwalk not found')
|
|
||||||
|
|
||||||
def tearDownModule():
|
|
||||||
pass
|
|
||||||
|
|
||||||
class GenericUtilities():
|
|
||||||
"""Provide a set of utility functions start stop daemons. write config files etc """
|
|
||||||
|
|
||||||
def StartSnmpd(self):
|
|
||||||
"""Start snmpd"""
|
|
||||||
subprocess.check_output(['systemctl', 'start', 'snmpd'])
|
|
||||||
|
|
||||||
def StopSnmpd(self):
|
|
||||||
"""Stop snmpd"""
|
|
||||||
subprocess.check_output(['systemctl', 'stop', 'snmpd'])
|
|
||||||
|
|
||||||
def SetupVethInterface(self):
|
|
||||||
"""Setup veth interface"""
|
|
||||||
|
|
||||||
ip = IPRoute()
|
|
||||||
|
|
||||||
ip.link('add', ifname='veth-test', peer='veth-peer', kind='veth')
|
|
||||||
idx_veth_test = ip.link_lookup(ifname='veth-test')[0]
|
|
||||||
idx_veth_peer = ip.link_lookup(ifname='veth-peer')[0]
|
|
||||||
|
|
||||||
ip.link('set', index=idx_veth_test, address='12:11:12:13:14:18')
|
|
||||||
ip.link('set', index=idx_veth_peer, address='22:21:22:23:24:29')
|
|
||||||
ip.link('set', index=idx_veth_test, state='up')
|
|
||||||
ip.link('set', index=idx_veth_peer, state='up')
|
|
||||||
ip.addr('add', index=idx_veth_test, address='192.168.111.50')
|
|
||||||
ip.addr('add', index=idx_veth_peer, address='192.168.111.51')
|
|
||||||
|
|
||||||
ip.close()
|
|
||||||
|
|
||||||
def TearDownVethInterface(self):
|
|
||||||
ip = IPRoute()
|
|
||||||
|
|
||||||
ip.link('del', index=ip.link_lookup(ifname='veth-test')[0])
|
|
||||||
ip.close()
|
|
||||||
|
|
||||||
class SnmpdTests(unittest.TestCase, GenericUtilities):
|
|
||||||
|
|
||||||
def setUp(self):
|
|
||||||
self.SetupVethInterface()
|
|
||||||
time.sleep(1)
|
|
||||||
self.StartSnmpd()
|
|
||||||
|
|
||||||
def tearDown(self):
|
|
||||||
self.StopSnmpd()
|
|
||||||
self.TearDownVethInterface()
|
|
||||||
|
|
||||||
def test_UCD_SNMP_MIB_memory(self):
|
|
||||||
''' UCD-SNMP-MIB::memory '''
|
|
||||||
|
|
||||||
subprocess.check_output(['snmpwalk', '-v2c', '-c' , 'public', HOST, 'UCD-SNMP-MIB::memory'])
|
|
||||||
|
|
||||||
meminfo=OrderedDict()
|
|
||||||
with open('/proc/meminfo') as f:
|
|
||||||
for line in f:
|
|
||||||
meminfo[line.split(':')[0]] = line.split(':')[1].strip()
|
|
||||||
|
|
||||||
output=subprocess.check_output(['snmpwalk', '-v2c', '-c' , 'public', HOST, 'UCD-SNMP-MIB::memTotalReal.0']).rstrip().decode('utf-8')
|
|
||||||
self.assertRegex(output, meminfo['MemTotal'])
|
|
||||||
|
|
||||||
def test_SNMP_hrSWRunPath(self):
|
|
||||||
""" process id """
|
|
||||||
output=subprocess.check_output(['snmpwalk', '-v2c', '-c' , 'public', HOST, 'HOST-RESOURCES-MIB::hrSWRunPath.1']).rstrip().decode('utf-8')
|
|
||||||
self.assertRegex(output, 'systemd')
|
|
||||||
|
|
||||||
def test_SNMP_IF_MIB_network_interface(self):
|
|
||||||
""" verify network interface (1.3.6.1.2.1.2.2.1) SNMP variables """
|
|
||||||
|
|
||||||
ip = IPRoute()
|
|
||||||
|
|
||||||
subprocess.check_output(['snmpwalk', '-v2c', '-c', 'public', HOST, '1.3.6.1.2.1.2.2.1'])
|
|
||||||
|
|
||||||
# 1.3.6.1.2.1.2.2.1.1 IF-MIB::ifIndex
|
|
||||||
output=subprocess.check_output(['snmpwalk', '-v2c', '-c', 'public', HOST, '1.3.6.1.2.1.2.2.1.1']).rstrip().decode('utf-8')
|
|
||||||
self.assertRegex(output, 'IF-MIB::ifIndex.1 = INTEGER: 1')
|
|
||||||
|
|
||||||
# 1.3.6.1.2.1.2.2.1.1 IF-MIB::ifDescr
|
|
||||||
output=subprocess.check_output(['snmpwalk', '-v2c', '-c', 'public', HOST, '1.3.6.1.2.1.2.2.1.2']).rstrip().decode('utf-8')
|
|
||||||
for link in ip.get_links():
|
|
||||||
self.assertRegex(output, link.get_attr('IFLA_IFNAME'))
|
|
||||||
|
|
||||||
# IP-MIB::ipAdEntAddr 1.3.6.1.2.1.4.20.1.1
|
|
||||||
output=subprocess.check_output(['snmpwalk', '-v2c', '-c', 'public', HOST, '1.3.6.1.2.1.4.20.1.1']).rstrip().decode('utf-8')
|
|
||||||
for addr in ip.get_addr():
|
|
||||||
if addr.get_attr('IFA_ADDRESS'):
|
|
||||||
if addr.get_attr('IFA_ADDRESS') != '::1' and addr.get_attr('Ifamily') == 2:
|
|
||||||
self.assertRegex(output, addr.get_attr('IFA_ADDRESS'))
|
|
||||||
|
|
||||||
# IF-MIB::ifPhysAddress. 1.3.6.1.2.1.2.2.1.6
|
|
||||||
output=subprocess.check_output(['snmpwalk', '-v2c', '-c', 'public', HOST, '1.3.6.1.2.1.2.2.1.6']).rstrip().decode('utf-8')
|
|
||||||
for link in ip.get_links():
|
|
||||||
if link.get_attr('IFLA_ADDRESS') and link.get_attr('IFLA_ADDRESS') != '00:00:00:00:00:00':
|
|
||||||
snmp_mac = re.sub(r'\b0+(\d)', r'\1', link.get_attr('IFLA_ADDRESS')).lstrip('0')
|
|
||||||
self.assertRegex(output, snmp_mac)
|
|
||||||
|
|
||||||
ip.close()
|
|
||||||
|
|
||||||
def test_SNMP_MIB_2_System(self):
|
|
||||||
""" verify RFC 1213 System (1.3.6.1.2.1.1) SNMP variables"""
|
|
||||||
|
|
||||||
subprocess.check_output(['snmpwalk', '-v2c', '-c', 'public', HOST, '1.3.6.1.2.1.1']).rstrip().decode('utf-8')
|
|
||||||
|
|
||||||
# 1.3.6.1.2.1.1.1 - sysDescr
|
|
||||||
output=subprocess.check_output(['snmpwalk', '-v2c', '-c', 'public', HOST, '1.3.6.1.2.1.1.1']).rstrip().decode('utf-8')
|
|
||||||
self.assertRegex(output, platform.machine())
|
|
||||||
self.assertRegex(output, platform.node())
|
|
||||||
self.assertRegex(output, platform.processor())
|
|
||||||
self.assertRegex(output, platform.release())
|
|
||||||
self.assertRegex(output, platform.version())
|
|
||||||
|
|
||||||
# 1.3.6.1.2.1.1.2 - sysObjectID
|
|
||||||
subprocess.check_output(['snmpwalk', '-v2c', '-c', 'public', HOST, '1.3.6.1.2.1.1.2'])
|
|
||||||
|
|
||||||
# 1.3.6.1.2.1.1.3 - sysUpTime
|
|
||||||
subprocess.check_output(['snmpwalk', '-v2c', '-c', 'public', HOST, '1.3.6.1.2.1.1.3'])
|
|
||||||
|
|
||||||
# 1.3.6.1.2.1.1.4 - sysContact
|
|
||||||
output=subprocess.check_output(['snmpwalk', '-v2c', '-c', 'public', HOST, '1.3.6.1.2.1.1.4']).rstrip().decode('utf-8')
|
|
||||||
self.assertRegex(output, 'fedora-ci <fedoraci@fedoraproject.org>')
|
|
||||||
|
|
||||||
# 1.3.6.1.2.1.1.5 - sysName
|
|
||||||
output=subprocess.check_output(['snmpwalk', '-v2c', '-c', 'public', HOST, '1.3.6.1.2.1.1.5']).rstrip().decode('utf-8')
|
|
||||||
self.assertRegex(output, socket.gethostname())
|
|
||||||
|
|
||||||
# 1.3.6.1.2.1.1.6 - sysLocation
|
|
||||||
output=subprocess.check_output(['snmpwalk', '-v2c', '-c', 'public', HOST, '1.3.6.1.2.1.1.6']).rstrip().decode('utf-8')
|
|
||||||
self.assertRegex(output, 'Pune, IN')
|
|
||||||
|
|
||||||
def test_basic_snmpwalk(self):
|
|
||||||
""" verify snmpwalk getting success snmpwalk -v2c -c public localhost """
|
|
||||||
|
|
||||||
subprocess.check_output(['snmpwalk', '-v2c', '-c', 'public', HOST])
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
unittest.main(testRunner=unittest.TextTestRunner(stream=sys.stdout,
|
|
||||||
verbosity=3))
|
|
@ -1,51 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# SPDX-License-Identifier: LGPL-2.1+
|
|
||||||
# ~~~
|
|
||||||
# runtest.sh of net-snmp
|
|
||||||
# Description: net-snmp tests
|
|
||||||
#
|
|
||||||
# Author: Susant Sahani <susant@redhat.com>
|
|
||||||
# Copyright (c) 2018 Red Hat, Inc.
|
|
||||||
# ~~~
|
|
||||||
|
|
||||||
# Include Beaker environment
|
|
||||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
|
||||||
|
|
||||||
PACKAGE_NET_SNMP="net-snmp"
|
|
||||||
PACKAGE_NET_SNMP_UTILS="net-snmp-utils"
|
|
||||||
|
|
||||||
NET_SNMP_CONF_FILE="/etc/snmp/snmpd.conf"
|
|
||||||
|
|
||||||
rlJournalStart
|
|
||||||
rlPhaseStartSetup
|
|
||||||
rlAssertRpm $PACKAGE_NET_SNMP
|
|
||||||
rlAssertRpm $PACKAGE_NET_SNMP_UTILS
|
|
||||||
|
|
||||||
rlRun "systemctl stop firewalld" 0,5
|
|
||||||
rlRun "setenforce 0" 0,1
|
|
||||||
|
|
||||||
rlRun "[ -e /sys/class/net/veth-test ] && ip link del veth-test" 0,1
|
|
||||||
rlRun "cp net-snmp-tests.py /usr/bin/"
|
|
||||||
|
|
||||||
rlFileBackup "$NET_SNMP_CONF_FILE"
|
|
||||||
rlRun "cp snmpd.conf $NET_SNMP_CONF_FILE"
|
|
||||||
|
|
||||||
rlPhaseEnd
|
|
||||||
|
|
||||||
rlPhaseStartTest
|
|
||||||
rlLog "Starting net-snmp tests ..."
|
|
||||||
rlRun "/usr/bin/python3 /usr/bin/net-snmp-tests.py"
|
|
||||||
rlPhaseEnd
|
|
||||||
|
|
||||||
rlPhaseStartCleanup
|
|
||||||
rlRun "rm /usr/bin/net-snmp-tests.py $NET_SNMP_CONFIG_FILE"
|
|
||||||
rlRun "systemctl daemon-reload"
|
|
||||||
rlRun "[ -e /sys/class/net/veth-test ] && ip link del veth-test" 0,1
|
|
||||||
rlFileRestore
|
|
||||||
rlRun "setenforce 1" 0,1
|
|
||||||
rlLog "net-snmp tests done"
|
|
||||||
rlPhaseEnd
|
|
||||||
rlJournalPrintText
|
|
||||||
rlJournalEnd
|
|
||||||
|
|
||||||
rlGetTestState
|
|
@ -1,7 +0,0 @@
|
|||||||
agentAddress udp:192.168.111.50:161
|
|
||||||
|
|
||||||
syslocation Pune, IN
|
|
||||||
syscontact fedora-ci <fedoraci@fedoraproject.org>
|
|
||||||
|
|
||||||
dontLogTCPWrappersConnects yes
|
|
||||||
rocommunity public
|
|
@ -1,14 +0,0 @@
|
|||||||
- hosts: localhost
|
|
||||||
roles:
|
|
||||||
- role: standard-test-beakerlib
|
|
||||||
tags:
|
|
||||||
- classic
|
|
||||||
tests:
|
|
||||||
- integration-tests
|
|
||||||
required_packages:
|
|
||||||
- python3
|
|
||||||
- systemd
|
|
||||||
- iproute
|
|
||||||
- python3-pyroute2
|
|
||||||
- net-snmp
|
|
||||||
- net-snmp-utils
|
|
Loading…
Reference in New Issue
Block a user