summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJochen Friedrich <jochen@scram.de>2007-08-01 14:06:54 +0000
committerJochen Friedrich <jochen@scram.de>2007-08-01 14:06:54 +0000
commit347f299aacb6e246a415900ca8a91c5f6c390f4c (patch)
tree0e8eb7ac2c295b52b85bc434ada3d71df4d585cc
parentbc8245e52f2d6d3aacdcb50b789bca0474b10d29 (diff)
downloadpkg-net-snmp-5.3.1-8.tar.gz
Add patch to snmptrapd to make it close its file handles.v5.3.1-8
git-svn-id: svn://svn.debian.org/pkg-net-snmp/branches/net-snmp53@193 db575a87-f10d-0410-9662-f1d5ac62e4ba
-rw-r--r--debian/changelog6
-rw-r--r--debian/patches/41_snmptrapd_close_handles.README1
-rw-r--r--debian/patches/41_snmptrapd_close_handles.patch19
3 files changed, 26 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index a2e8617..37a2f2c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -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@scram.de> Tue, 31 Jul 2007 17:00:59 +0200
+
net-snmp (5.3.1-7) unstable; urgency=low
[ Christian Perrier ]
diff --git a/debian/patches/41_snmptrapd_close_handles.README b/debian/patches/41_snmptrapd_close_handles.README
new file mode 100644
index 0000000..e551e1d
--- /dev/null
+++ b/debian/patches/41_snmptrapd_close_handles.README
@@ -0,0 +1 @@
+Close all non standard file handles in snmptrapd.c (copied from snmpd.c)
diff --git a/debian/patches/41_snmptrapd_close_handles.patch b/debian/patches/41_snmptrapd_close_handles.patch
new file mode 100644
index 0000000..5bf3543
--- /dev/null
+++ b/debian/patches/41_snmptrapd_close_handles.patch
@@ -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