fixed temporary filename generation in snmptrapd Resolves: #616347

This commit is contained in:
Jan Šafránek 2010-07-20 11:15:12 +00:00
parent d4416d317f
commit fd3b10c1ad
2 changed files with 38 additions and 1 deletions

View File

@ -0,0 +1,32 @@
616347 - snmptrapd dies when starting external script
Source: upstream, SVN rev. 19231
Index: net-snmp/snmplib/system.c
===================================================================
--- net-snmp/snmplib/system.c (revision 19230)
+++ net-snmp/snmplib/system.c (revision 19231)
@@ -158,6 +158,10 @@
#include <grp.h>
#endif
+#if HAVE_LIMITS_H
+#include <limits.h>
+#endif
+
#include <net-snmp/types.h>
#include <net-snmp/output_api.h>
#include <net-snmp/utilities.h>
@@ -1027,7 +1031,11 @@
const char *
netsnmp_mktemp(void)
{
- static char name[32];
+#ifdef PATH_MAX
+ static char name[PATH_MAX];
+#else
+ static char name[256];
+#endif
int fd = -1;
strcpy(name, get_temp_file_pattern());

View File

@ -11,7 +11,7 @@
Summary: A collection of SNMP protocol tools and libraries
Name: net-snmp
Version: 5.5
Release: 13%{?dist}
Release: 14%{?dist}
Epoch: 1
License: BSD and MIT
@ -35,6 +35,7 @@ Patch6: net-snmp-5.5-missing-bcast.patch
Patch7: net-snmp-5.5-tcp-pid.patch
Patch8: net-snmp-5.5-test-tmpdir.patch
Patch9: net-snmp-5.5-include-struct.patch
Patch10: net-snmp-5.5-mktemp-size.patch
Requires(post): chkconfig
Requires(preun): chkconfig
@ -168,6 +169,7 @@ Net-SNMP toolkit library.
# no backup of this one, it would break tests!
%patch8 -p1
%patch9 -p1 -b .include-struct
%patch10 -p1 -b .mktemp-size
%build
MIBS="host agentx smux \
@ -417,6 +419,9 @@ rm -rf ${RPM_BUILD_ROOT}
%{_datadir}/snmp/mibs/*
%changelog
* Tue Jul 20 2010 Jan Safranek <jsafrane@redhat.com> - 1:5.5-14
- fixed temporary filename generation in snmptrapd (#616347)
* Wed Jun 16 2010 Jan Safranek <jsafrane@redhat.com> - 1:5.5-13
- add missing header files from util_funcs directory (#603243)