summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Volkov <pva@gentoo.org>2007-12-27 17:15:33 +0000
committerPeter Volkov <pva@gentoo.org>2007-12-27 17:15:33 +0000
commit98caf0a1edfcbc1bf041b50c828a3cdec26945a4 (patch)
treef333c840cc5824c7d008428e131eb8b5ee9e1d8e /net-analyzer/net-snmp/files
parentAdded dev-tcltk/Tk_Theme for removal. (diff)
downloadhistorical-98caf0a1edfcbc1bf041b50c828a3cdec26945a4.tar.gz
historical-98caf0a1edfcbc1bf041b50c828a3cdec26945a4.tar.bz2
historical-98caf0a1edfcbc1bf041b50c828a3cdec26945a4.zip
Fixes memory leaks reported in bug #180266, thank Doug <doug.manley AT gmail.com> for report and ivestigation. Added upstream patch to suppress annoying "registration != duplicate" warning for root oids.
Package-Manager: portage-2.1.3.19
Diffstat (limited to 'net-analyzer/net-snmp/files')
-rw-r--r--net-analyzer/net-snmp/files/digest-net-snmp-5.4.1-r23
-rw-r--r--net-analyzer/net-snmp/files/net-snmp-5.4.1-clientaddr-fix.patch72
-rw-r--r--net-analyzer/net-snmp/files/net-snmp-5.4.1-suppresssuppress-annoying.patch17
3 files changed, 72 insertions, 20 deletions
diff --git a/net-analyzer/net-snmp/files/digest-net-snmp-5.4.1-r2 b/net-analyzer/net-snmp/files/digest-net-snmp-5.4.1-r2
new file mode 100644
index 000000000000..34865f92ea1e
--- /dev/null
+++ b/net-analyzer/net-snmp/files/digest-net-snmp-5.4.1-r2
@@ -0,0 +1,3 @@
+MD5 6c974df7a5a5b1579f72115e6b045bda net-snmp-5.4.1.tar.gz 5122455
+RMD160 3723488dab8d164702a7d55c9c72eeaec07dd50c net-snmp-5.4.1.tar.gz 5122455
+SHA256 0ea976722c993c87dede8eb6348e6feb059e3851bbef2de824bf18ac97cdb565 net-snmp-5.4.1.tar.gz 5122455
diff --git a/net-analyzer/net-snmp/files/net-snmp-5.4.1-clientaddr-fix.patch b/net-analyzer/net-snmp/files/net-snmp-5.4.1-clientaddr-fix.patch
index 116e524f0c85..e80922144be6 100644
--- a/net-analyzer/net-snmp/files/net-snmp-5.4.1-clientaddr-fix.patch
+++ b/net-analyzer/net-snmp/files/net-snmp-5.4.1-clientaddr-fix.patch
@@ -1,4 +1,4 @@
-Fix clientaddr functionality.
+Fix clientaddr functionality. Includes further memory leak and newline fixes.
Previously, the clientaddr option in snmp.conf was parsed, but the actual
clientaddr was used to bind(), yet sendmsg() was still called with 0.0.0.0.
@@ -13,22 +13,30 @@ Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Status: Merged in upstream r16654
Tracking-URL: https://sourceforge.net/tracker/?func=detail&atid=312694&aid=1775124&group_id=12694
-diff -NuwbBar --exclude docs --exclude '*.o' --exclude 'config.*' --exclude perl --exclude '*~' net-snmp-5.4.old/snmplib/snmpUDPDomain.c net-snmp-5.4/snmplib/snmpUDPDomain.c
---- net-snmp-5.4.old/snmplib/snmpUDPDomain.c 2006-09-19 16:42:17.000000000 -0700
-+++ net-snmp-5.4/snmplib/snmpUDPDomain.c 2007-08-15 19:17:27.000000000 -0700
-@@ -100,12 +100,15 @@ netsnmp_udp_fmtaddr(netsnmp_transport *t
- struct sockaddr_in *to = NULL;
+Further fixes:
+Revision 16681
+ add missing newline in debug msg
+Revision 16704
+ CHANGES: snmplib: BUG: Coverity #183: fix memory leak if IP_PKTINFO fails
+Revision 16716
+ CHANGES: snmplib: Do not leak memory whenever an udp address is formatted.
+
+Fixes bug: bugs.gentoo.org/180266
+
+diff -Naur net-snmp-5.4.1.orig/snmplib/snmpUDPDomain.c net-snmp-5.4.1/snmplib/snmpUDPDomain.c
+--- net-snmp-5.4.1.orig/snmplib/snmpUDPDomain.c 2007-06-11 02:15:24.000000000 +0400
++++ net-snmp-5.4.1/snmplib/snmpUDPDomain.c 2007-12-27 18:15:56.000000000 +0300
+@@ -104,11 +104,13 @@
char tmp[64];
to = (struct sockaddr_in *) &(addr_pair->remote_addr);
-+ /* Using strdup on the output of inet_ntoa is important! */
if (to == NULL) {
- return strdup("UDP: unknown");
+ sprintf(tmp, "UDP: [%s]->unknown",
-+ strdup(inet_ntoa(addr_pair->local_addr)));
++ inet_ntoa(addr_pair->local_addr));
+ } else {
-+ sprintf(tmp, "UDP: [%s]->[%s]:%hu",
-+ strdup(inet_ntoa(addr_pair->local_addr)),
-+ strdup(inet_ntoa(to->sin_addr)), ntohs(to->sin_port));
++ sprintf(tmp, "UDP: [%s]->", inet_ntoa(addr_pair->local_addr));
++ sprintf(tmp + strlen(tmp), "[%s]:%hd",
++ inet_ntoa(to->sin_addr), ntohs(to->sin_port));
}
-
- sprintf(tmp, "UDP: [%s]:%hu",
@@ -36,28 +44,52 @@ diff -NuwbBar --exclude docs --exclude '*.o' --exclude 'config.*' --exclude perl
return strdup(tmp);
}
}
-@@ -670,11 +673,23 @@ netsnmp_udp_transport(struct sockaddr_in
- NETSNMP_DS_LIB_CLIENT_ADDR);
+@@ -642,6 +644,7 @@
+ if (setsockopt(t->sock, SOL_IP, IP_PKTINFO, &sockopt, sizeof sockopt) == -1) {
+ DEBUGMSGTL(("netsnmp_udp", "couldn't set IP_PKTINFO: %s\n",
+ strerror(errno)));
++ netsnmp_transport_free(t);
+ return NULL;
+ }
+ DEBUGMSGTL(("netsnmp_udp", "set IP_PKTINFO\n"));
+@@ -667,10 +670,24 @@
if (client_socket) {
struct sockaddr_in client_addr;
-+ int ret;
netsnmp_sockaddr_in2(&client_addr, client_socket, NULL);
+ addr_pair.local_addr = client_addr.sin_addr;
client_addr.sin_port = 0;
- bind(t->sock, (struct sockaddr *)&client_addr,
-+ ret = bind(t->sock, (struct sockaddr *)&client_addr,
++ rc = bind(t->sock, (struct sockaddr *)&client_addr,
sizeof(struct sockaddr));
-+ if(ret)
++ if ( rc != 0 ) {
+ DEBUGMSGTL(("netsnmp_udp", "failed to bind for clientaddr: %d %s\n",
-+ errno,strerror(errno)));
-+ /* TODO: should we exit here? */
++ errno, strerror(errno)));
++ netsnmp_udp_close(t);
++ netsnmp_transport_free(t);
++ return NULL;
++ }
}
+
-+ str = netsnmp_udp_fmtaddr(NULL, (void *)&addr_pair,
-+ sizeof(netsnmp_udp_addr_pair));
++ str = netsnmp_udp_fmtaddr(NULL, (void *)&addr_pair,
++ sizeof(netsnmp_udp_addr_pair));
+ DEBUGMSGTL(("netsnmp_udp", "client open %s\n", str));
+ free(str);
+
/*
* Save the (remote) address in the
* transport-specific data pointer for later use by netsnmp_udp_send.
+@@ -839,12 +856,12 @@
+ if (host == NULL) {
+ DEBUGMSGTL(("netsnmp_sockaddr_in",
+ "servname not numeric, "
+- "check if it really is a destination)"));
++ "check if it really is a destination)\n"));
+ host = port;
+ port = NULL;
+ } else {
+ DEBUGMSGTL(("netsnmp_sockaddr_in",
+- "servname not numeric"));
++ "servname not numeric\n"));
+ free(peername);
+ return 0;
+ }
diff --git a/net-analyzer/net-snmp/files/net-snmp-5.4.1-suppresssuppress-annoying.patch b/net-analyzer/net-snmp/files/net-snmp-5.4.1-suppresssuppress-annoying.patch
new file mode 100644
index 000000000000..f08d8f712694
--- /dev/null
+++ b/net-analyzer/net-snmp/files/net-snmp-5.4.1-suppresssuppress-annoying.patch
@@ -0,0 +1,17 @@
+NEWS: agent: suppress annoying "registration != duplicate" warning for root oids
+(otherwise, you'll get this message on almost every startup)
+
+http://net-snmp.svn.sourceforge.net/viewvc/net-snmp?view=rev&revision=16669
+
+--- branches/V5-4-patches/net-snmp/agent/agent_registry.c 2007/08/20 08:06:42 16668
++++ branches/V5-4-patches/net-snmp/agent/agent_registry.c 2007/08/22 21:56:23 16669
+@@ -532,7 +532,8 @@
+
+ if (next && (next->namelen == new_sub->namelen) &&
+ (next->priority == new_sub->priority)) {
+- netsnmp_assert(!"registration != duplicate"); /* always false */
++ if (new_sub->namelen != 1) /* ignore root OID dups */
++ netsnmp_assert(!"registration != duplicate"); /* always false */
+ return MIB_DUPLICATE_REGISTRATION;
+ }
+