diff options
author | Jochen Friedrich <jochen@scram.de> | 2007-08-02 12:29:00 +0000 |
---|---|---|
committer | Jochen Friedrich <jochen@scram.de> | 2007-08-02 12:29:00 +0000 |
commit | 50bcf7efb10d53681d779efe02473b19a49d9192 (patch) | |
tree | 89ef79a786e477e0cbb991345f50a022968abd39 /debian/patches | |
parent | b0f2fe8b2e53b205f0990722da0baa5b15f1a268 (diff) | |
download | pkg-net-snmp-50bcf7efb10d53681d779efe02473b19a49d9192.tar.gz |
Add patch to snmptrapd to make it close its file handles. (Merge R193)
git-svn-id: svn://svn.debian.org/pkg-net-snmp/trunk@196 db575a87-f10d-0410-9662-f1d5ac62e4ba
Diffstat (limited to 'debian/patches')
-rw-r--r-- | debian/patches/41_snmptrapd_close_handles.README | 1 | ||||
-rw-r--r-- | debian/patches/41_snmptrapd_close_handles.patch | 19 |
2 files changed, 20 insertions, 0 deletions
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 |