Accepting request 139446 from net-snmp:factory

Automatic submission by obs-autosubmit

OBS-URL: https://build.opensuse.org/request/show/139446
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/net-snmp?expand=0&rev=60
This commit is contained in:
Stephan Kulow 2012-11-02 06:31:12 +00:00 committed by Git OBS Bridge
parent d45bdf8b63
commit 0451d39814
27 changed files with 115 additions and 633 deletions

View File

@ -1,26 +0,0 @@
Index: net-snmp-5.7/agent/Makefile.in
===================================================================
--- net-snmp-5.7.orig/agent/Makefile.in
+++ net-snmp-5.7/agent/Makefile.in
@@ -294,7 +294,7 @@ getmibstat.o: mibgroup/kernel_sunos5.c
$(CC) $(CFLAGS) -o $@ -D_GETMIBSTAT_TEST -DDODEBUG -c $?
snmpd$(EXEEXT): ${LAGENTOBJS} $(USELIBS) $(AGENTLIB) $(MIBLIB) $(LIBTARG)
- $(LINK) $(CFLAGS) -o $@ ${LAGENTOBJS} $(LOCAL_LIBS) ${LDFLAGS} ${OUR_AGENT_LIBS}
+ $(LINK) $(CFLAGS) -o $@ -pie ${LAGENTOBJS} $(LOCAL_LIBS) ${LDFLAGS} ${OUR_AGENT_LIBS}
libnetsnmpagent.$(LIB_EXTENSION)$(LIB_VERSION): ${LLIBAGENTOBJS} $(USELIBS)
Index: net-snmp-5.7/apps/Makefile.in
===================================================================
--- net-snmp-5.7.orig/apps/Makefile.in
+++ net-snmp-5.7/apps/Makefile.in
@@ -173,7 +173,7 @@ snmptest$(EXEEXT): snmptest.$(OSUFFIX
$(LINK) ${CFLAGS} -o $@ snmptest.$(OSUFFIX) $(LOCAL_LIBS) ${LDFLAGS} ${LIBS}
snmptrapd$(EXEEXT): $(TRAPD_OBJECTS) $(USETRAPLIBS) $(INSTALLLIBS)
- $(LINK) ${CFLAGS} -o $@ $(TRAPD_OBJECTS) $(INSTALLLIBS) $(LOCAL_LIBS) ${LDFLAGS} ${TRAPLIBS}
+ $(LINK) ${CFLAGS} -o $@ -pie $(TRAPD_OBJECTS) $(INSTALLLIBS) $(LOCAL_LIBS) ${LDFLAGS} ${TRAPLIBS}
snmptrap$(EXEEXT): snmptrap.$(OSUFFIX) $(USELIBS)
$(LINK) ${CFLAGS} -o $@ snmptrap.$(OSUFFIX) $(LOCAL_LIBS) ${LDFLAGS} ${LIBS}

View File

@ -1,52 +0,0 @@
From: Mendel Mobach <mendel@mobach.nl>
Add ReiserFS to the list of recognized file systems and move
JFS and XFS defines below the right comment.
---
agent/mibgroup/hardware/fsys/fsys_mntent.c | 1 +
agent/mibgroup/hardware/fsys/mnttypes.h | 13 ++++++-------
2 files changed, 7 insertions(+), 7 deletions(-)
Index: net-snmp-5.7/agent/mibgroup/hardware/fsys/fsys_mntent.c
===================================================================
--- net-snmp-5.7.orig/agent/mibgroup/hardware/fsys/fsys_mntent.c
+++ net-snmp-5.7/agent/mibgroup/hardware/fsys/fsys_mntent.c
@@ -135,6 +135,7 @@ _fsys_type( char *typename )
!strcmp(typename, MNTTYPE_GFS2) ||
!strcmp(typename, MNTTYPE_XFS) ||
!strcmp(typename, MNTTYPE_JFS) ||
+ !strcmp(typename, MNTTYPE_REISERFS) ||
!strcmp(typename, MNTTYPE_LOFS))
return NETSNMP_FS_TYPE_OTHER;
Index: net-snmp-5.7/agent/mibgroup/hardware/fsys/mnttypes.h
===================================================================
--- net-snmp-5.7.orig/agent/mibgroup/hardware/fsys/mnttypes.h
+++ net-snmp-5.7/agent/mibgroup/hardware/fsys/mnttypes.h
@@ -114,6 +114,12 @@
#ifndef MNTTYPE_GFS2
#define MNTTYPE_GFS2 "gfs2"
#endif
+#ifndef MNTTYPE_XFS
+#define MNTTYPE_XFS "xfs"
+#endif
+#ifndef MNTTYPE_JFS
+#define MNTTYPE_JFS "jfs"
+#endif
/*
* File systems to monitor, but not covered by HR-TYPES enumerations
@@ -156,12 +162,5 @@
#ifndef MNTTYPE_RPCPIPE
#define MNTTYPE_RPCPIPE "rpc_pipefs"
#endif
-#ifndef MNTTYPE_XFS
-#define MNTTYPE_XFS "xfs"
-#endif
-#ifndef MNTTYPE_JFS
-#define MNTTYPE_JFS "jfs"
-#endif
-
#endif /* _NETSNMP_FSYS_MNTTYPES_H */

View File

@ -1,18 +0,0 @@
commit c9ac420343e16df2b7065f5bf2790df44e247fba
Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
Date: Tue Mar 20 10:26:10 2012 +0000
Allow distribution as part of normal Net-SNMP packages.
Index: net-snmp-5.7.1/AGENT.txt
===================================================================
--- net-snmp-5.7.1.orig/AGENT.txt
+++ net-snmp-5.7.1/AGENT.txt
@@ -1166,4 +1166,6 @@ above all feedback, would be most apprec
------------------------------------------------------------------------
Copyright 1999, 2000 - D.T.Shield.
-Not to be distributed without the explicit permission of the author.
+This file may be distributed as part of a source or binary packaging
+of the Net-SNMP software suite. It may not be distributed independently
+without the explicit permission of the author.

View File

@ -1,30 +0,0 @@
commit 4c5633f1603e4bd03ed05c37d782ec8911759c47
Author: Robert Story <rstory@freesnmp.com>
Date: Mon May 14 11:40:06 2012 -0400
NEWS: snmp: BUG: 3526549: CVE-2012-2141 Array index error leading to crash
Index: net-snmp-5.7.1/agent/mibgroup/agent/extend.c
===================================================================
--- net-snmp-5.7.1.orig/agent/mibgroup/agent/extend.c
+++ net-snmp-5.7.1/agent/mibgroup/agent/extend.c
@@ -1209,7 +1209,7 @@ _extend_find_entry( netsnmp_request_info
* ...and check the line requested is valid
*/
line_idx = *table_info->indexes->next_variable->val.integer;
- if (eptr->numlines < line_idx)
+ if (line_idx < 1 || line_idx > eptr->numlines)
return NULL;
}
}
@@ -1380,6 +1380,10 @@ handle_nsExtendOutput2Table(netsnmp_mib_
* Determine which line we've been asked for....
*/
line_idx = *table_info->indexes->next_variable->val.integer;
+ if (line_idx < 1 || line_idx > extension->numlines) {
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHINSTANCE);
+ continue;
+ }
cp = extension->lines[line_idx-1];
/*

View File

@ -1,47 +0,0 @@
commit 76ff25d9bf97579e7213102065fd5096f049a4c5
Author: Bart Van Assche <bvanassche@acm.org>
Date: Fri Oct 7 14:13:18 2011 +0200
CHANGES: snmpd: HOST-RESOURCES-MIB::hrStorageTable: fix bug in handling large filesystems, where large means above 8 TB (= 2**31 * 4096 bytes).
This patch fixes a bug introduced in commit
71d8293f387a6cd66bb0dbb13c0f50174d2e678b.
For the original bug report, see also
https://sourceforge.net/tracker/?func=detail&atid=112694&aid=3419825&group_id=12694.
diff --git a/agent/mibgroup/hardware/fsys/hw_fsys.c b/agent/mibgroup/hardware/fsys/hw_fsys.c
index c96284e..be698b2 100644
--- a/agent/mibgroup/hardware/fsys/hw_fsys.c
+++ b/agent/mibgroup/hardware/fsys/hw_fsys.c
@@ -321,19 +321,23 @@ netsnmp_fsys_avail( netsnmp_fsys_info *f) {
/* recalculate f->size_32, used_32, avail_32 and units_32 from f->size & comp.*/
void
-netsnmp_fsys_calculate32( netsnmp_fsys_info *f)
+netsnmp_fsys_calculate32(netsnmp_fsys_info *f)
{
unsigned long long s = f->size;
- unsigned long long u = f->units;
- int factor = 0;
+ unsigned shift = 0;
+
while (s > INT32_MAX) {
s = s >> 1;
- u = u << 1;
- factor++;
+ shift++;
}
f->size_32 = s;
- f->units_32 = u;
- f->avail_32 = f->avail << factor;
- f->used_32 = f->used << factor;
+ f->units_32 = f->units << shift;
+ f->avail_32 = f->avail >> shift;
+ f->used_32 = f->used >> shift;
+
+ DEBUGMSGTL(("fsys", "Results of 32-bit conversion: size %llu -> %lu;"
+ " units %llu -> %lu; avail %llu -> %lu; used %llu -> %lu\n",
+ f->size, f->size_32, f->units, f->units_32,
+ f->avail, f->avail_32, f->used, f->used_32));
}

View File

@ -1,21 +0,0 @@
commit 6ef6907642247c663b9b8964b9fd44a211dbcaa7
Author: Bart Van Assche <bvanassche@acm.org>
Date: Thu Oct 20 20:30:54 2011 +0200
CHANGES: snmpd: BUG: 3408398: Fix a memory leak in agent/mibgroup/hardware/fsys.
This memory leak was introduced via commit
9bf3d96d96a8ecd4a5fc35c326dc937467002b6c: Initial HAL
implementation of FileSystem information (March 7, 2008).
diff --git a/agent/mibgroup/hardware/fsys/fsys_getfsstats.c b/agent/mibgroup/hardware/fsys/fsys_getfsstats.c
index 55327b7..3cc9bc5 100644
--- a/agent/mibgroup/hardware/fsys/fsys_getfsstats.c
+++ b/agent/mibgroup/hardware/fsys/fsys_getfsstats.c
@@ -175,4 +175,6 @@ netsnmp_fsys_arch_load( void )
}
netsnmp_fsys_calculate32(entry);
}
+
+ free(stats);
}

View File

@ -1,24 +0,0 @@
commit 1be8cf08a67a91855fee1ec4a2d8e087c7812456
Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
Date: Tue Dec 27 18:04:10 2011 +0000
CHANGES: agentx: PATCHES: 3445437: Log AgentX disconnections
(in line with connections) Patch provided by Bill Fenner
Index: net-snmp-5.7.1/agent/mibgroup/agentx/subagent.c
===================================================================
--- net-snmp-5.7.1.orig/agent/mibgroup/agentx/subagent.c
+++ net-snmp-5.7.1/agent/mibgroup/agentx/subagent.c
@@ -298,8 +298,10 @@ handle_agentx_packet(int operation, nets
* agentx_reopen_session unregisters itself if it succeeds in talking
* to the master agent.
*/
- snmp_alarm_register(period, SA_REPEAT, agentx_reopen_session,
- NULL);
+ snmp_alarm_register(period, SA_REPEAT, agentx_reopen_session, NULL);
+ snmp_log(LOG_INFO, "AgentX master disconnected us, reconnecting in %d\n", period);
+ } else {
+ snmp_log(LOG_INFO, "AgentX master disconnected us, not reconnecting\n");
}
return 0;
} else if (operation != NETSNMP_CALLBACK_OP_RECEIVED_MESSAGE) {

View File

@ -1,76 +0,0 @@
commit 2a17b37430c1852998c3588e547d7eb61c06da71
Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
Date: Tue Dec 27 21:45:38 2011 +0000
CHANGES: agentx: PATCHES: 3445440: More robust handling of AgentX errors
Patch provided by Bill Fenner
Index: net-snmp-5.7.1/agent/mibgroup/agentx/subagent.c
===================================================================
--- net-snmp-5.7.1.orig/agent/mibgroup/agentx/subagent.c
+++ net-snmp-5.7.1/agent/mibgroup/agentx/subagent.c
@@ -243,6 +243,24 @@ free_set_vars(netsnmp_session * ss, nets
}
#endif /* !NETSNMP_NO_WRITE_SUPPORT */
+static void
+send_agentx_error(netsnmp_session *session, netsnmp_pdu *pdu, int errstat, int errindex)
+{
+ pdu = snmp_clone_pdu(pdu);
+ pdu->command = AGENTX_MSG_RESPONSE;
+ pdu->version = session->version;
+ pdu->errstat = errstat;
+ pdu->errindex = errindex;
+ snmp_free_varbind(pdu->variables);
+ pdu->variables = NULL;
+
+ DEBUGMSGTL(("agentx/subagent", "Sending AgentX response error stat %d idx %d\n",
+ errstat, errindex));
+ if (!snmp_send(session, pdu)) {
+ snmp_free_pdu(pdu);
+ }
+}
+
int
handle_agentx_packet(int operation, netsnmp_session * session, int reqid,
netsnmp_pdu *pdu, void *magic)
@@ -327,6 +345,7 @@ handle_agentx_packet(int operation, nets
(ns_subagent_magic *) calloc(1, sizeof(ns_subagent_magic));
if (smagic == NULL) {
DEBUGMSGTL(("agentx/subagent", "couldn't malloc() smagic\n"));
+ /* would like to send_agentx_error(), but it needs memory too */
return 1;
}
smagic->original_command = pdu->command;
@@ -391,6 +410,7 @@ handle_agentx_packet(int operation, nets
if (asi == NULL) {
SNMP_FREE(smagic);
snmp_log(LOG_WARNING, "save_set_vars() failed\n");
+ send_agentx_error(session, pdu, AGENTX_ERR_PARSE_FAILED, 0);
return 1;
}
asi->mode = pdu->command = SNMP_MSG_INTERNAL_SET_RESERVE1;
@@ -404,6 +424,7 @@ handle_agentx_packet(int operation, nets
if (asi == NULL) {
SNMP_FREE(smagic);
snmp_log(LOG_WARNING, "restore_set_vars() failed\n");
+ send_agentx_error(session, pdu, AGENTX_ERR_PROCESSING_ERROR, 0);
return 1;
}
if (asi->mode != SNMP_MSG_INTERNAL_SET_RESERVE2) {
@@ -411,6 +432,7 @@ handle_agentx_packet(int operation, nets
snmp_log(LOG_WARNING,
"dropping bad AgentX request (wrong mode %d)\n",
asi->mode);
+ send_agentx_error(session, pdu, AGENTX_ERR_PROCESSING_ERROR, 0);
return 1;
}
asi->mode = pdu->command = SNMP_MSG_INTERNAL_SET_ACTION;
@@ -424,6 +446,7 @@ handle_agentx_packet(int operation, nets
if (asi == NULL) {
SNMP_FREE(smagic);
snmp_log(LOG_WARNING, "restore_set_vars() failed\n");
+ send_agentx_error(session, pdu, AGENTX_ERR_PROCESSING_ERROR, 0);
return 1;
}
if (asi->mode == SNMP_MSG_INTERNAL_SET_RESERVE1 ||

View File

@ -1,22 +0,0 @@
commit 5fd26e4fa3e000ea9c81c38ab975b7946efe2157
Author: Bart Van Assche <bvanassche@acm.org>
Date: Wed Sep 28 17:49:55 2011 +0200
CHANGES: agent: Avoid that netsnmp_register_old_api() failure triggers a double free.
Fixes a regression introduced via commit
aa4d47c2609e52818c9cdf1a8e2205de9a335a0a (svn r19515).
diff --git a/agent/helpers/old_api.c b/agent/helpers/old_api.c
index b1630e6..2d710b0 100644
--- a/agent/helpers/old_api.c
+++ b/agent/helpers/old_api.c
@@ -127,7 +127,7 @@ netsnmp_register_old_api(const char *moduleName,
*/
if (netsnmp_register_handler(reginfo) != MIB_REGISTERED_OK) {
/** netsnmp_handler_registration_free(reginfo); already freed */
- SNMP_FREE(vp);
+ /* SNMP_FREE(vp); already freed */
}
}
return SNMPERR_SUCCESS;

View File

@ -1,58 +0,0 @@
commit 13952f6bee9f408867ab6d2fdfdde4f284074957
Author: Jan Safranek <jsafranek@users.sourceforge.net>
Date: Wed Oct 26 14:05:16 2011 +0200
CHANGES: snmplib: from Siddhesh Poyarekar: properly clean up old requests in a subagent when we reconnect to master.
An snmp subagent linked against net-snmp-libs may crash if it handles a
response which has magic referring to an older disconnected main session. This
may happen when the subagent
attempts to clean up old requests on reconnection of the disconnected master
session.
Index: net-snmp-5.7.1/agent/mibgroup/agentx/subagent.c
===================================================================
--- net-snmp-5.7.1.orig/agent/mibgroup/agentx/subagent.c
+++ net-snmp-5.7.1/agent/mibgroup/agentx/subagent.c
@@ -484,6 +484,26 @@ handle_agentx_packet(int operation, nets
return 1;
}
+static int
+_invalid_op_and_magic(int op, ns_subagent_magic *smagic)
+{
+ int invalid = 0;
+
+ if (smagic && (snmp_sess_pointer(smagic->session) == NULL ||
+ op == NETSNMP_CALLBACK_OP_TIMED_OUT)) {
+ if (smagic->ovars != NULL) {
+ snmp_free_varbind(smagic->ovars);
+ }
+ free(smagic);
+ invalid = 1;
+ }
+
+ if (op != NETSNMP_CALLBACK_OP_RECEIVED_MESSAGE || smagic == NULL)
+ invalid = 1;
+
+ return invalid;
+}
+
int
handle_subagent_response(int op, netsnmp_session * session, int reqid,
netsnmp_pdu *pdu, void *magic)
@@ -492,13 +512,7 @@ handle_subagent_response(int op, netsnmp
netsnmp_variable_list *u = NULL, *v = NULL;
int rc = 0;
- if (op != NETSNMP_CALLBACK_OP_RECEIVED_MESSAGE || magic == NULL) {
- if (op == NETSNMP_CALLBACK_OP_TIMED_OUT && magic != NULL) {
- if (smagic->ovars != NULL) {
- snmp_free_varbind(smagic->ovars);
- }
- free(smagic);
- }
+ if (_invalid_op_and_magic(op, magic)) {
return 1;
}

View File

@ -1,32 +0,0 @@
commit debac498fe8410110107a2fe64f8afb748edaa07
Author: Jan Safranek <jsafranek@users.sourceforge.net>
Date: Mon Feb 6 16:48:09 2012 +0100
CHANGES: added OCFS2 (Oracle Cluster FS) to hrStorageTable and hrFSTable
Index: net-snmp-5.7.1/agent/mibgroup/hardware/fsys/fsys_mntent.c
===================================================================
--- net-snmp-5.7.1.orig/agent/mibgroup/hardware/fsys/fsys_mntent.c
+++ net-snmp-5.7.1/agent/mibgroup/hardware/fsys/fsys_mntent.c
@@ -136,6 +136,7 @@ _fsys_type( char *typename )
!strcmp(typename, MNTTYPE_XFS) ||
!strcmp(typename, MNTTYPE_JFS) ||
!strcmp(typename, MNTTYPE_REISERFS) ||
+ !strcmp(typename, MNTTYPE_OCFS2) ||
!strcmp(typename, MNTTYPE_LOFS))
return NETSNMP_FS_TYPE_OTHER;
Index: net-snmp-5.7.1/agent/mibgroup/hardware/fsys/mnttypes.h
===================================================================
--- net-snmp-5.7.1.orig/agent/mibgroup/hardware/fsys/mnttypes.h
+++ net-snmp-5.7.1/agent/mibgroup/hardware/fsys/mnttypes.h
@@ -133,6 +133,9 @@
#ifndef MNTTYPE_MVFS
#define MNTTYPE_MVFS "mvfs"
#endif
+#ifndef MNTTYPE_OCFS2
+#define MNTTYPE_OCFS2 "ocfs2"
+#endif
/*
* File systems to skip

View File

@ -1,55 +0,0 @@
commit 7bead9ca917c67566d5ed98ab507bbc02816217d
Author: Bart Van Assche <bvanassche@acm.org>
Date: Wed Nov 30 14:08:08 2011 +0100
AgentX subagent: Reduce code duplication
Index: net-snmp-5.7.1/agent/mibgroup/agentx/subagent.c
===================================================================
--- net-snmp-5.7.1.orig/agent/mibgroup/agentx/subagent.c
+++ net-snmp-5.7.1/agent/mibgroup/agentx/subagent.c
@@ -792,6 +792,7 @@ subagent_open_master_session(void)
{
netsnmp_transport *t;
netsnmp_session sess;
+ const char *agentx_socket;
DEBUGMSGTL(("agentx/subagent", "opening session...\n"));
@@ -809,9 +810,9 @@ subagent_open_master_session(void)
sess.callback = handle_agentx_packet;
sess.authenticator = NULL;
- t = netsnmp_transport_open_client(
- "agentx", netsnmp_ds_get_string(NETSNMP_DS_APPLICATION_ID,
- NETSNMP_DS_AGENT_X_SOCKET));
+ agentx_socket = netsnmp_ds_get_string(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_X_SOCKET);
+ t = netsnmp_transport_open_client("agentx", agentx_socket);
if (t == NULL) {
/*
* Diagnose snmp_open errors with the input
@@ -820,12 +821,9 @@ subagent_open_master_session(void)
if (!netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
NETSNMP_DS_AGENT_NO_CONNECTION_WARNINGS)) {
char buf[1024];
- const char *socket =
- netsnmp_ds_get_string(NETSNMP_DS_APPLICATION_ID,
- NETSNMP_DS_AGENT_X_SOCKET);
snprintf(buf, sizeof(buf), "Warning: "
"Failed to connect to the agentx master agent (%s)",
- socket ? socket : "[NIL]");
+ agentx_socket ? agentx_socket : "[NIL]");
if (!netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
NETSNMP_DS_AGENT_NO_ROOT_ACCESS)) {
netsnmp_sess_log_error(LOG_WARNING, buf, &sess);
@@ -846,8 +844,7 @@ subagent_open_master_session(void)
char buf[1024];
snprintf(buf, sizeof(buf), "Error: "
"Failed to create the agentx master agent session (%s)",
- netsnmp_ds_get_string(NETSNMP_DS_APPLICATION_ID,
- NETSNMP_DS_AGENT_X_SOCKET));
+ agentx_socket);
snmp_sess_perror(buf, &sess);
}
netsnmp_transport_free(t);

View File

@ -1,19 +0,0 @@
commit 0815a7536c76f7e4842638683f674894a1a8ce14
Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
Date: Thu Dec 29 14:42:54 2011 +0000
Report problems with SetUndo processing
Missed when applying patch #3445440
Index: net-snmp-5.7.1/agent/mibgroup/agentx/subagent.c
===================================================================
--- net-snmp-5.7.1.orig/agent/mibgroup/agentx/subagent.c
+++ net-snmp-5.7.1/agent/mibgroup/agentx/subagent.c
@@ -471,6 +471,7 @@ handle_agentx_packet(int operation, nets
if (asi == NULL) {
SNMP_FREE(smagic);
snmp_log(LOG_WARNING, "restore_set_vars() failed\n");
+ send_agentx_error(session, pdu, AGENTX_ERR_PROCESSING_ERROR, 0);
return 1;
}
asi->mode = pdu->command = SNMP_MSG_INTERNAL_SET_UNDO;

View File

@ -1,23 +0,0 @@
commit cf82b894b2217c26edc6f1356351c932415604e2
Author: Bart Van Assche <bvanassche@acm.org>
Date: Sat Oct 15 14:45:08 2011 +0200
CHANGES: snmplib: BUG: 3423915: Change default number of retries back from 0 to 5
This patch fixes a bug introduced via commit 6cac050 (May 5, 2011,
added support for specifying the default number of retries in
snmpd.conf).
diff --git a/snmplib/snmp_api.c b/snmplib/snmp_api.c
index 980b6f8..61cfa39 100644
--- a/snmplib/snmp_api.c
+++ b/snmplib/snmp_api.c
@@ -704,6 +704,8 @@ _init_snmp(void)
netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID,
NETSNMP_DS_LIB_HEX_OUTPUT_LENGTH, 16);
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_RETRIES,
+ DEFAULT_RETRIES);
#ifdef NETSNMP_USE_REVERSE_ASNENCODING
netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,

View File

@ -1,22 +0,0 @@
commit 1421924b4852142192c5bb9e93ddbfed69e908fa
Author: Bart Van Assche <bvanassche@acm.org>
Date: Wed Sep 21 22:20:08 2011 +0200
CHANGES: snmplib: Avoid waiting indefinitely if a session has timeout zero
diff --git a/snmplib/snmp_api.c b/snmplib/snmp_api.c
index df0dc1c..980b6f8 100644
--- a/snmplib/snmp_api.c
+++ b/snmplib/snmp_api.c
@@ -6032,8 +6032,9 @@ snmp_sess_select_info2_flags(void *sessp,
*/
requests++;
for (rp = slp->internal->requests; rp; rp = rp->next_request) {
- if ((!timerisset(&earliest)
- || (timercmp(&rp->expire, &earliest, <)))) {
+ if (!timerisset(&earliest)
+ || (timerisset(&rp->expire)
+ && timercmp(&rp->expire, &earliest, <))) {
earliest = rp->expire;
DEBUGMSG(("verbose:sess_select","(to in %d.%06d sec) ",
(int)earliest.tv_sec, (int)earliest.tv_usec));

View File

@ -1,19 +0,0 @@
commit 97172b311d20f4441c7a7e90092b59c1e0da99f7
Author: Thomas Jarosch <tjarosch@users.sourceforge.net>
Date: Wed Oct 5 08:46:39 2011 +0200
CHANGES: PATCH: 3418649: HOST-RESOURCES-MIB: Use pclose() instead of fclose() to close a pipe.
diff --git a/agent/mibgroup/host/data_access/swinst_apt.c b/agent/mibgroup/host/data_access/swinst_apt.c
index d204857..a562faf 100644
--- a/agent/mibgroup/host/data_access/swinst_apt.c
+++ b/agent/mibgroup/host/data_access/swinst_apt.c
@@ -95,7 +95,7 @@ netsnmp_swinst_arch_load( netsnmp_container *container, u_int flags)
entry->swDate_len = 8;
memcpy(entry->swDate, "\0\0\1\1\0\0\0\0", 8);
}
- fclose(p);
+ pclose(p);
DEBUGMSGTL(("swinst:load:arch"," loaded %d entries\n",
CONTAINER_SIZE(container)));

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:36c61f5b7a950d1aa21da11a1371f91fd38596147a41170c7b529be924319d1f
size 4382983

View File

@ -6,10 +6,10 @@ Date: Tue Feb 7 14:53:44 2012 +0100
I fixed also the memory leak reported in the tracker comments.
Index: net-snmp-5.7.1/agent/mibgroup/agentx/master.c
Index: net-snmp-5.7.2/agent/mibgroup/agentx/master.c
===================================================================
--- net-snmp-5.7.1.orig/agent/mibgroup/agentx/master.c
+++ net-snmp-5.7.1/agent/mibgroup/agentx/master.c
--- net-snmp-5.7.2.orig/agent/mibgroup/agentx/master.c
+++ net-snmp-5.7.2/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",
@ -29,11 +29,11 @@ Index: net-snmp-5.7.1/agent/mibgroup/agentx/master.c
}
return SNMP_ERR_NOERROR;
Index: net-snmp-5.7.1/agent/mibgroup/agentx/master_admin.c
Index: net-snmp-5.7.2/agent/mibgroup/agentx/master_admin.c
===================================================================
--- net-snmp-5.7.1.orig/agent/mibgroup/agentx/master_admin.c
+++ net-snmp-5.7.1/agent/mibgroup/agentx/master_admin.c
@@ -135,11 +135,16 @@ close_agentx_session(netsnmp_session * s
--- net-snmp-5.7.2.orig/agent/mibgroup/agentx/master_admin.c
+++ net-snmp-5.7.2/agent/mibgroup/agentx/master_admin.c
@@ -133,11 +133,16 @@ close_agentx_session(netsnmp_session * s
* requests, so that the delegated request will be completed and
* further requests can be processed
*/

View File

@ -1,7 +1,7 @@
Index: net-snmp-5.6.1/net-snmp-config.in
Index: net-snmp-5.7.2/net-snmp-config.in
===================================================================
--- net-snmp-5.6.1.orig/net-snmp-config.in
+++ net-snmp-5.6.1/net-snmp-config.in
--- net-snmp-5.7.2.orig/net-snmp-config.in
+++ net-snmp-5.7.2/net-snmp-config.in
@@ -41,6 +41,14 @@ count()
echo $#
}
@ -50,7 +50,7 @@ Index: net-snmp-5.6.1/net-snmp-config.in
;;
--external-libs)
+ check_devel_files
echo $NSC_LDFLAGS $NSC_LNETSNMPLIBS $NSC_LIBS
echo $NSC_LDFLAGS $NSC_LNETSNMPLIBS $NSC_LIBS @PERLLDOPTS_FOR_APPS@
;;
#################################################### agent lib
--base-agent-libs)

View File

@ -1,7 +1,7 @@
Index: net-snmp-5.5/local/tkmib
Index: net-snmp-5.7.2/local/tkmib
===================================================================
--- net-snmp-5.5.orig/local/tkmib
+++ net-snmp-5.5/local/tkmib
--- net-snmp-5.7.2.orig/local/tkmib
+++ net-snmp-5.7.2/local/tkmib
@@ -27,10 +27,9 @@ instructions.
if (!$havetk) {

26
net-snmp-5.7.2-pie.patch Normal file
View File

@ -0,0 +1,26 @@
Index: net-snmp-5.7.2/agent/Makefile.in
===================================================================
--- net-snmp-5.7.2.orig/agent/Makefile.in
+++ net-snmp-5.7.2/agent/Makefile.in
@@ -294,7 +294,7 @@ getmibstat.o: mibgroup/kernel_sunos5.c
$(CC) $(CFLAGS) -o $@ -D_GETMIBSTAT_TEST -DDODEBUG -c $?
snmpd$(EXEEXT): ${LAGENTOBJS} $(USELIBS) $(AGENTLIB) $(HELPERLIB) $(MIBLIB) $(LIBTARG)
- $(LINK) $(CFLAGS) -o $@ ${LAGENTOBJS} ${LDFLAGS} ${OUR_AGENT_LIBS}
+ $(LINK) $(CFLAGS) -o $@ -pie ${LAGENTOBJS} ${LDFLAGS} ${OUR_AGENT_LIBS}
libnetsnmpagent.$(LIB_EXTENSION)$(LIB_VERSION): ${LLIBAGENTOBJS} $(USELIBS)
$(LIB_LD_CMD) $(AGENTLIB) ${LLIBAGENTOBJS} $(USELIBS) ${LAGENTLIBS} @LD_NO_UNDEFINED@ $(LDFLAGS) $(PERLLDOPTS_FOR_LIBS) $(LIB_LD_LIBS) @AGENTLIBS@
Index: net-snmp-5.7.2/apps/Makefile.in
===================================================================
--- net-snmp-5.7.2.orig/apps/Makefile.in
+++ net-snmp-5.7.2/apps/Makefile.in
@@ -170,7 +170,7 @@ snmptest$(EXEEXT): snmptest.$(OSUFFIX
$(LINK) ${CFLAGS} -o $@ snmptest.$(OSUFFIX) ${LDFLAGS} ${LIBS}
snmptrapd$(EXEEXT): $(TRAPD_OBJECTS) $(USETRAPLIBS) $(INSTALLLIBS)
- $(LINK) ${CFLAGS} -o $@ $(TRAPD_OBJECTS) $(INSTALLLIBS) ${LDFLAGS} ${TRAPLIBS}
+ $(LINK) ${CFLAGS} -o $@ -pie $(TRAPD_OBJECTS) $(INSTALLLIBS) ${LDFLAGS} ${TRAPLIBS}
snmptrap$(EXEEXT): snmptrap.$(OSUFFIX) $(USELIBS)
$(LINK) ${CFLAGS} -o $@ snmptrap.$(OSUFFIX) ${LDFLAGS} ${LIBS}

View File

@ -1,7 +1,7 @@
Index: net-snmp-5.5/agent/mibgroup/agentx/protocol.h
Index: net-snmp-5.7.2/agent/mibgroup/agentx/protocol.h
===================================================================
--- net-snmp-5.5.orig/agent/mibgroup/agentx/protocol.h
+++ net-snmp-5.5/agent/mibgroup/agentx/protocol.h
--- net-snmp-5.7.2.orig/agent/mibgroup/agentx/protocol.h
+++ net-snmp-5.7.2/agent/mibgroup/agentx/protocol.h
@@ -13,7 +13,7 @@ extern "C" {
#define AGENTX_PORT 705

View File

@ -1,7 +1,7 @@
Index: net-snmp-5.5/testing/rfc1213/snmpfun.sh
Index: net-snmp-5.7.2/testing/rfc1213/snmpfun.sh
===================================================================
--- net-snmp-5.5.orig/testing/rfc1213/snmpfun.sh
+++ net-snmp-5.5/testing/rfc1213/snmpfun.sh
--- net-snmp-5.7.2.orig/testing/rfc1213/snmpfun.sh
+++ net-snmp-5.7.2/testing/rfc1213/snmpfun.sh
@@ -1,4 +1,3 @@
-
# functions used by RFC-1213 MIB test modules
@ -78,10 +78,10 @@ Index: net-snmp-5.5/testing/rfc1213/snmpfun.sh
}
+
Index: net-snmp-5.5/testing/rfc1213/test_fun
Index: net-snmp-5.7.2/testing/rfc1213/test_fun
===================================================================
--- net-snmp-5.5.orig/testing/rfc1213/test_fun
+++ net-snmp-5.5/testing/rfc1213/test_fun
--- net-snmp-5.7.2.orig/testing/rfc1213/test_fun
+++ net-snmp-5.7.2/testing/rfc1213/test_fun
@@ -51,6 +51,9 @@ test_finish()
if [ x$1 == x"PASS" ];then
pass_num=`expr $pass_num + 1`

View File

@ -1,7 +1,7 @@
Index: net-snmp-5.5/LICENSE.VELOCITY
Index: net-snmp-5.7.2/LICENSE.VELOCITY
===================================================================
--- /dev/null
+++ net-snmp-5.5/LICENSE.VELOCITY
+++ net-snmp-5.7.2/LICENSE.VELOCITY
@@ -0,0 +1,41 @@
+/* Portions of these files are subject to the following copyright(s). See
+ * the Net-SNMP's COPYING file for more details and other copyrights
@ -44,10 +44,10 @@ Index: net-snmp-5.5/LICENSE.VELOCITY
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
Index: net-snmp-5.5/agent/mibgroup/velocity.h
Index: net-snmp-5.7.2/agent/mibgroup/velocity.h
===================================================================
--- /dev/null
+++ net-snmp-5.5/agent/mibgroup/velocity.h
+++ net-snmp-5.7.2/agent/mibgroup/velocity.h
@@ -0,0 +1,28 @@
+/*
+ * Velocity 'wrapper' interface which is an extension of the host resources
@ -77,10 +77,10 @@ Index: net-snmp-5.5/agent/mibgroup/velocity.h
+config_add_mib(UCD-SNMP-MIB)
+config_add_mib(VELOCITY-MIB)
+config_add_mib(VELOCITY-TYPES)
Index: net-snmp-5.5/agent/mibgroup/velocity/velocity_app.c
Index: net-snmp-5.7.2/agent/mibgroup/velocity/velocity_app.c
===================================================================
--- /dev/null
+++ net-snmp-5.5/agent/mibgroup/velocity/velocity_app.c
+++ net-snmp-5.7.2/agent/mibgroup/velocity/velocity_app.c
@@ -0,0 +1,499 @@
+#include <net-snmp/net-snmp-config.h>
+
@ -581,10 +581,10 @@ Index: net-snmp-5.5/agent/mibgroup/velocity/velocity_app.c
+ return total;
+}
+
Index: net-snmp-5.5/agent/mibgroup/velocity/velocity_app.h
Index: net-snmp-5.7.2/agent/mibgroup/velocity/velocity_app.h
===================================================================
--- /dev/null
+++ net-snmp-5.5/agent/mibgroup/velocity/velocity_app.h
+++ net-snmp-5.7.2/agent/mibgroup/velocity/velocity_app.h
@@ -0,0 +1,38 @@
+/*
+ * Application watching mib group
@ -624,10 +624,10 @@ Index: net-snmp-5.5/agent/mibgroup/velocity/velocity_app.h
+#define APPIDS 7
+
+#endif /* _MIBGROUP_APP_H */
Index: net-snmp-5.5/agent/mibgroup/velocity/velocity_swrun.c
Index: net-snmp-5.7.2/agent/mibgroup/velocity/velocity_swrun.c
===================================================================
--- /dev/null
+++ net-snmp-5.5/agent/mibgroup/velocity/velocity_swrun.c
+++ net-snmp-5.7.2/agent/mibgroup/velocity/velocity_swrun.c
@@ -0,0 +1,1595 @@
+/*
+ * Velocity MIB - Running Software group implementation - velocity_swrun.c
@ -2224,10 +2224,10 @@ Index: net-snmp-5.5/agent/mibgroup/velocity/velocity_swrun.c
+ End_VELOCITY_SWRun();
+ return total;
+}
Index: net-snmp-5.5/agent/mibgroup/velocity/velocity_swrun.h
Index: net-snmp-5.7.2/agent/mibgroup/velocity/velocity_swrun.h
===================================================================
--- /dev/null
+++ net-snmp-5.5/agent/mibgroup/velocity/velocity_swrun.h
+++ net-snmp-5.7.2/agent/mibgroup/velocity/velocity_swrun.h
@@ -0,0 +1,13 @@
+/*
+ * Velocity MIB - Running Software group interface - velocity_swrun.h
@ -2242,10 +2242,10 @@ Index: net-snmp-5.5/agent/mibgroup/velocity/velocity_swrun.h
+
+
+#endif /* _MIBGROUP_VELOCITYSWRUN_H */
Index: net-snmp-5.5/agent/mibgroup/velocity/velocity_system.c
Index: net-snmp-5.7.2/agent/mibgroup/velocity/velocity_system.c
===================================================================
--- /dev/null
+++ net-snmp-5.5/agent/mibgroup/velocity/velocity_system.c
+++ net-snmp-5.7.2/agent/mibgroup/velocity/velocity_system.c
@@ -0,0 +1,403 @@
+/*
+ * Velocity MIB - system group implementation - velocity_system.c
@ -2650,10 +2650,10 @@ Index: net-snmp-5.5/agent/mibgroup/velocity/velocity_system.c
+}
+
+#endif /* UTMP_FILE */
Index: net-snmp-5.5/agent/mibgroup/velocity/velocity_system.h
Index: net-snmp-5.7.2/agent/mibgroup/velocity/velocity_system.h
===================================================================
--- /dev/null
+++ net-snmp-5.5/agent/mibgroup/velocity/velocity_system.h
+++ net-snmp-5.7.2/agent/mibgroup/velocity/velocity_system.h
@@ -0,0 +1,12 @@
+/*
+ * Velocity MIB - system group interface - velocity_system.h
@ -2667,10 +2667,10 @@ Index: net-snmp-5.5/agent/mibgroup/velocity/velocity_system.h
+
+
+#endif /* _MIBGROUP_VELOCITYSYSTEM_H */
Index: net-snmp-5.5/mibs/VELOCITY-MIB.txt
Index: net-snmp-5.7.2/mibs/VELOCITY-MIB.txt
===================================================================
--- /dev/null
+++ net-snmp-5.5/mibs/VELOCITY-MIB.txt
+++ net-snmp-5.7.2/mibs/VELOCITY-MIB.txt
@@ -0,0 +1,671 @@
+VELOCITY-MIB DEFINITIONS ::= BEGIN
+
@ -3343,10 +3343,10 @@ Index: net-snmp-5.5/mibs/VELOCITY-MIB.txt
+ ::= { velocityMIBGroups 5 }
+
+END
Index: net-snmp-5.5/mibs/VELOCITY-TYPES.txt
Index: net-snmp-5.7.2/mibs/VELOCITY-TYPES.txt
===================================================================
--- /dev/null
+++ net-snmp-5.5/mibs/VELOCITY-TYPES.txt
+++ net-snmp-5.7.2/mibs/VELOCITY-TYPES.txt
@@ -0,0 +1,23 @@
+VELOCITY-TYPES DEFINITIONS ::= BEGIN
+

3
net-snmp-5.7.2.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:235cb0889d20d5e4c2aed54a78c4388b8edcb31a2d5f355760980dab466a6713
size 4511950

View File

@ -1,3 +1,33 @@
-------------------------------------------------------------------
Wed Oct 10 18:21:19 UTC 2012 - lchiquitto@suse.com
- update to version 5.7.2: several bug fixes in the agent, client
utilities and libraries. The CHANGES file shipped with the
package contains a comprehensive list of fixes and improvements
- rebase patches to apply cleanly:
* net-snmp-5.7.2-perl-tk-warning.patch
* net-snmp-5.7.2-socket-path.patch
* net-snmp-5.7.2-testing-empty-arptable.patch
* net-snmp-5.7.2-pie.patch
* net-snmp-5.7.2-velocity-mib.patch
* net-snmp-5.7.2-fix-snmpd-crashing-when-an-agentx-disconnects.patch
- remove patches that are now present in the upstream release:
* net-snmp-5.7.0-recognize-reiserfs.patch
* net-snmp-5.7.1-snmplib-zero-timeout.patch
* net-snmp-5.7.1-old-api-double-free.patch
* net-snmp-5.7.1-use-pclose-to-close-pipes.patch
* net-snmp-5.7.1-fix-handling-of-large-filesystems.patch
* net-snmp-5.7.1-snmplib-default-retries.patch
* net-snmp-5.7.1-fsys-memory-leak.patch
* net-snmp-5.7.1-adjust-copyright-in-agent-txt-file.patch
* net-snmp-5.7.1-recognize-ocfs2.patch
* net-snmp-5.7.1-properly-clean-up-old-requests-in-subagents.patch
* net-snmp-5.7.1-reduce-code-duplication-in-agentx.patch
* net-snmp-5.7.1-log-agentx-disconnections.patch
* net-snmp-5.7.1-more-robust-handling-of-agentx-errors.patch
* net-snmp-5.7.1-report-problems-with-setundo-processing.patch
* net-snmp-5.7.1-fix-array-index-error.patch
-------------------------------------------------------------------
Fri Sep 7 17:28:00 UTC 2012 - jengelh@inai.de

View File

@ -26,7 +26,7 @@
%define netsnmp_agentx_socket_dir_rfc /var/agentx
Name: net-snmp
Version: 5.7.1
Version: 5.7.2
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: openssl-devel
@ -55,31 +55,16 @@ Source6: test_installed
Source7: net-snmp.sysconfig
Source8: net-snmp-rpmlintrc
Source9: baselibs.conf
Patch1: net-snmp-5.5.0-socket-path.patch
Patch2: net-snmp-5.5.0-testing-empty-arptable.patch
Patch3: net-snmp-5.7.0-pie.patch
Patch5: net-snmp-5.6.1-net-snmp-config-headercheck.patch
Patch6: net-snmp-5.5.0-perl-tk-warning.patch
Patch7: net-snmp-5.7.0-velocity-mib.patch
Patch8: net-snmp-5.7.0-recognize-reiserfs.patch
Patch10: net-snmp-5.7.1-snmplib-zero-timeout.patch
Patch11: net-snmp-5.7.1-old-api-double-free.patch
Patch12: net-snmp-5.7.1-use-pclose-to-close-pipes.patch
Patch13: net-snmp-5.7.1-fix-handling-of-large-filesystems.patch
Patch14: net-snmp-5.7.1-snmplib-default-retries.patch
Patch15: net-snmp-5.7.1-fsys-memory-leak.patch
Patch16: net-snmp-5.7.1-adjust-copyright-in-agent-txt-file.patch
Patch17: net-snmp-5.7.1-recognize-ocfs2.patch
Patch18: net-snmp-5.7.1-properly-clean-up-old-requests-in-subagents.patch
Patch19: net-snmp-5.7.1-reduce-code-duplication-in-agentx.patch
Patch20: net-snmp-5.7.1-log-agentx-disconnections.patch
Patch21: net-snmp-5.7.1-more-robust-handling-of-agentx-errors.patch
Patch22: net-snmp-5.7.1-report-problems-with-setundo-processing.patch
Patch23: net-snmp-5.7.1-fix-snmpd-crashing-when-an-agentx-disconnects.patch
Patch24: net-snmp-5.7.1-fix-array-index-error.patch
Patch1: net-snmp-5.7.2-socket-path.patch
Patch2: net-snmp-5.7.2-testing-empty-arptable.patch
Patch3: net-snmp-5.7.2-pie.patch
Patch5: net-snmp-5.7.2-net-snmp-config-headercheck.patch
Patch6: net-snmp-5.7.2-perl-tk-warning.patch
Patch7: net-snmp-5.7.2-velocity-mib.patch
Patch23: net-snmp-5.7.2-fix-snmpd-crashing-when-an-agentx-disconnects.patch
#
Summary: SNMP Daemon
License: BSD-3-Clause ; MIT
License: BSD-3-Clause and MIT
Group: Productivity/Networking/Other
%description
@ -110,7 +95,7 @@ Requires: perl-base = %{perl_version}
Requires: snmp-mibs = %{version}
#
Summary: Shared Libraries from net-snmp
License: BSD-3-Clause ; MIT
License: BSD-3-Clause and MIT
Group: Productivity/Networking/Other
%description -n libsnmp30
@ -151,7 +136,7 @@ Requires: libsensors4-devel
%endif
#
Summary: Development files from net-snmp
License: BSD-3-Clause ; MIT
License: BSD-3-Clause and MIT
Group: Development/Libraries/C and C++
%description devel
@ -177,7 +162,7 @@ Authors:
%package -n snmp-mibs
#
Summary: MIB files from net-snmp
License: BSD-3-Clause ; MIT
License: BSD-3-Clause and MIT
Group: Productivity/Networking/Other
%description -n snmp-mibs
@ -223,22 +208,7 @@ Authors:
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1
%patch17 -p1
%patch18 -p1
%patch19 -p1
%patch20 -p1
%patch21 -p1
%patch22 -p1
%patch23 -p1
%patch24 -p1
%build
MIBS="misc/ipfwacc ucd-snmp/diskio etherlike-mib rmon-mib velocity smux \
@ -328,7 +298,7 @@ rm -f "%buildroot/%_libdir"/*.la
%files
%defattr(-,root,root)
%doc AGENT.txt COPYING EXAMPLE.conf EXAMPLE.conf.def
%doc FAQ NEWS TODO
%doc FAQ NEWS TODO CHANGES
%doc README README.agent-mibs README.agentx README.krb5 README.snmpv3 README.thread
%dir /etc/snmp
%config(noreplace) /etc/snmp/snmpd.conf