[Pkg-net-snmp-commits] r193 - in branches/net-snmp53/debian: . patches

jochen at alioth.debian.org jochen at alioth.debian.org
Wed Aug 1 14:06:55 UTC 2007


Author: jochen
Date: 2007-08-01 14:06:54 +0000 (Wed, 01 Aug 2007)
New Revision: 193

Added:
   branches/net-snmp53/debian/patches/41_snmptrapd_close_handles.README
   branches/net-snmp53/debian/patches/41_snmptrapd_close_handles.patch
Modified:
   branches/net-snmp53/debian/changelog
Log:
Add patch to snmptrapd to make it close its file handles.


Modified: branches/net-snmp53/debian/changelog
===================================================================
--- branches/net-snmp53/debian/changelog	2007-07-21 22:05:29 UTC (rev 192)
+++ branches/net-snmp53/debian/changelog	2007-08-01 14:06:54 UTC (rev 193)
@@ -1,3 +1,9 @@
+net-snmp (5.3.1-8) unstable; urgency=low
+
+  * Add patch to snmptrapd to close its file handles (Closes: #391203)
+
+ -- Jochen Friedrich <jochen at scram.de>  Tue, 31 Jul 2007 17:00:59 +0200
+
 net-snmp (5.3.1-7) unstable; urgency=low
 
   [ Christian Perrier ]

Added: branches/net-snmp53/debian/patches/41_snmptrapd_close_handles.README
===================================================================
--- branches/net-snmp53/debian/patches/41_snmptrapd_close_handles.README	                        (rev 0)
+++ branches/net-snmp53/debian/patches/41_snmptrapd_close_handles.README	2007-08-01 14:06:54 UTC (rev 193)
@@ -0,0 +1 @@
+Close all non standard file handles in snmptrapd.c (copied from snmpd.c)

Added: branches/net-snmp53/debian/patches/41_snmptrapd_close_handles.patch
===================================================================
--- branches/net-snmp53/debian/patches/41_snmptrapd_close_handles.patch	                        (rev 0)
+++ branches/net-snmp53/debian/patches/41_snmptrapd_close_handles.patch	2007-08-01 14:06:54 UTC (rev 193)
@@ -0,0 +1,19 @@
+--- net-snmp-5.3.1/apps/snmptrapd.c.orig	2007-07-06 17:02:00.000000000 +0200
++++ net-snmp-5.3.1/apps/snmptrapd.c	2007-07-31 16:45:38.000000000 +0200
+@@ -596,6 +596,16 @@
+ #endif
+     netsnmp_trapd_handler *traph;
+ 
++#ifndef WIN32
++    /*
++     * close all non-standard file descriptors we may have
++     * inherited from the shell.
++     */
++    for (i = getdtablesize() - 1; i > 2; --i) {
++	(void) close(i);
++    }
++#endif /* #WIN32 */
++
+ #ifdef SIGTERM
+     signal(SIGTERM, term_handler);
+ #endif




More information about the Pkg-net-snmp-commits mailing list